mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Merge remote-tracking branch 'origin/clifford/onpassreg' into eddie/abc9_scratchpad
This commit is contained in:
		
						commit
						dd718838bb
					
				
					 3 changed files with 20 additions and 1 deletions
				
			
		|  | @ -114,20 +114,35 @@ void Pass::run_register() | |||
| 
 | ||||
| void Pass::init_register() | ||||
| { | ||||
| 	vector<Pass*> added_passes; | ||||
| 	while (first_queued_pass) { | ||||
| 		added_passes.push_back(first_queued_pass); | ||||
| 		first_queued_pass->run_register(); | ||||
| 		first_queued_pass = first_queued_pass->next_queued_pass; | ||||
| 	} | ||||
| 	for (auto added_pass : added_passes) | ||||
| 		added_pass->on_register(); | ||||
| } | ||||
| 
 | ||||
| void Pass::done_register() | ||||
| { | ||||
| 	for (auto &it : pass_register) | ||||
| 		it.second->on_shutdown(); | ||||
| 
 | ||||
| 	frontend_register.clear(); | ||||
| 	pass_register.clear(); | ||||
| 	backend_register.clear(); | ||||
| 	log_assert(first_queued_pass == NULL); | ||||
| } | ||||
| 
 | ||||
| void Pass::on_register() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| void Pass::on_shutdown() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| Pass::~Pass() | ||||
| { | ||||
| } | ||||
|  |  | |||
|  | @ -62,6 +62,9 @@ struct Pass | |||
| 	virtual void run_register(); | ||||
| 	static void init_register(); | ||||
| 	static void done_register(); | ||||
| 
 | ||||
| 	virtual void on_register(); | ||||
| 	virtual void on_shutdown(); | ||||
| }; | ||||
| 
 | ||||
| struct ScriptPass : Pass | ||||
|  |  | |||
|  | @ -579,6 +579,8 @@ void yosys_shutdown() | |||
| 	already_shutdown = true; | ||||
| 	log_pop(); | ||||
| 
 | ||||
| 	Pass::done_register(); | ||||
| 
 | ||||
| 	delete yosys_design; | ||||
| 	yosys_design = NULL; | ||||
| 
 | ||||
|  | @ -588,7 +590,6 @@ void yosys_shutdown() | |||
| 	log_errfile = NULL; | ||||
| 	log_files.clear(); | ||||
| 
 | ||||
| 	Pass::done_register(); | ||||
| 	yosys_celltypes.clear(); | ||||
| 
 | ||||
| #ifdef YOSYS_ENABLE_TCL | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue