mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Merge pull request #1753 from YosysHQ/dave/abc9-speedup
Add ScriptPass::run_nocheck and use for abc9
This commit is contained in:
		
						commit
						f2550d45ff
					
				
					 3 changed files with 20 additions and 7 deletions
				
			
		|  | @ -400,6 +400,18 @@ void ScriptPass::run(std::string command, std::string info) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void ScriptPass::run_nocheck(std::string command, std::string info) | ||||||
|  | { | ||||||
|  | 	if (active_design == nullptr) { | ||||||
|  | 		if (info.empty()) | ||||||
|  | 			log("        %s\n", command.c_str()); | ||||||
|  | 		else | ||||||
|  | 			log("        %s    %s\n", command.c_str(), info.c_str()); | ||||||
|  | 	} else { | ||||||
|  | 		Pass::call(active_design, command); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void ScriptPass::run_script(RTLIL::Design *design, std::string run_from, std::string run_to) | void ScriptPass::run_script(RTLIL::Design *design, std::string run_from, std::string run_to) | ||||||
| { | { | ||||||
| 	help_mode = false; | 	help_mode = false; | ||||||
|  |  | ||||||
|  | @ -84,6 +84,7 @@ struct ScriptPass : Pass | ||||||
| 
 | 
 | ||||||
| 	bool check_label(std::string label, std::string info = std::string()); | 	bool check_label(std::string label, std::string info = std::string()); | ||||||
| 	void run(std::string command, std::string info = std::string()); | 	void run(std::string command, std::string info = std::string()); | ||||||
|  | 	void run_nocheck(std::string command, std::string info = std::string()); | ||||||
| 	void run_script(RTLIL::Design *design, std::string run_from = std::string(), std::string run_to = std::string()); | 	void run_script(RTLIL::Design *design, std::string run_from = std::string(), std::string run_to = std::string()); | ||||||
| 	void help_script(); | 	void help_script(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -332,9 +332,9 @@ struct Abc9Pass : public ScriptPass | ||||||
| 					tempdir_name = make_temp_dir(tempdir_name); | 					tempdir_name = make_temp_dir(tempdir_name); | ||||||
| 
 | 
 | ||||||
| 					if (!lut_mode) | 					if (!lut_mode) | ||||||
| 						run(stringf("abc9_ops -write_lut %s/input.lut", tempdir_name.c_str())); | 						run_nocheck(stringf("abc9_ops -write_lut %s/input.lut", tempdir_name.c_str())); | ||||||
| 					run(stringf("abc9_ops -write_box %s/input.box", tempdir_name.c_str())); | 					run_nocheck(stringf("abc9_ops -write_box %s/input.box", tempdir_name.c_str())); | ||||||
| 					run(stringf("write_xaiger -map %s/input.sym %s/input.xaig", tempdir_name.c_str(), tempdir_name.c_str())); | 					run_nocheck(stringf("write_xaiger -map %s/input.sym %s/input.xaig", tempdir_name.c_str(), tempdir_name.c_str())); | ||||||
| 
 | 
 | ||||||
| 					int num_outputs = active_design->scratchpad_get_int("write_xaiger.num_outputs"); | 					int num_outputs = active_design->scratchpad_get_int("write_xaiger.num_outputs"); | ||||||
| 
 | 
 | ||||||
|  | @ -350,9 +350,9 @@ struct Abc9Pass : public ScriptPass | ||||||
| 						if (!lut_mode) | 						if (!lut_mode) | ||||||
| 							abc9_exe_cmd += stringf(" -lut %s/input.lut", tempdir_name.c_str()); | 							abc9_exe_cmd += stringf(" -lut %s/input.lut", tempdir_name.c_str()); | ||||||
| 						abc9_exe_cmd += stringf(" -box %s/input.box", tempdir_name.c_str()); | 						abc9_exe_cmd += stringf(" -box %s/input.box", tempdir_name.c_str()); | ||||||
| 						run(abc9_exe_cmd); | 						run_nocheck(abc9_exe_cmd); | ||||||
| 						run(stringf("read_aiger -xaiger -wideports -module_name %s$abc9 -map %s/input.sym %s/output.aig", log_id(mod), tempdir_name.c_str(), tempdir_name.c_str())); | 						run_nocheck(stringf("read_aiger -xaiger -wideports -module_name %s$abc9 -map %s/input.sym %s/output.aig", log_id(mod), tempdir_name.c_str(), tempdir_name.c_str())); | ||||||
| 						run("abc9_ops -reintegrate"); | 						run_nocheck("abc9_ops -reintegrate"); | ||||||
| 					} | 					} | ||||||
| 					else | 					else | ||||||
| 						log("Don't call ABC as there is nothing to map.\n"); | 						log("Don't call ABC as there is nothing to map.\n"); | ||||||
|  | @ -361,7 +361,7 @@ struct Abc9Pass : public ScriptPass | ||||||
| 						log("Removing temp directory.\n"); | 						log("Removing temp directory.\n"); | ||||||
| 						remove_directory(tempdir_name); | 						remove_directory(tempdir_name); | ||||||
| 					} | 					} | ||||||
| 
 | 					mod->check(); | ||||||
| 					active_design->selection().selected_modules.clear(); | 					active_design->selection().selected_modules.clear(); | ||||||
| 					log_pop(); | 					log_pop(); | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue