mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Added "miter -equiv -flatten"
This commit is contained in:
		
							parent
							
								
									8d04ca7d22
								
							
						
					
					
						commit
						4c38ec1cc8
					
				
					 2 changed files with 15 additions and 2 deletions
				
			
		|  | @ -27,6 +27,7 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args, | ||||||
| 	bool flag_make_outputs = false; | 	bool flag_make_outputs = false; | ||||||
| 	bool flag_make_outcmp = false; | 	bool flag_make_outcmp = false; | ||||||
| 	bool flag_make_assert = false; | 	bool flag_make_assert = false; | ||||||
|  | 	bool flag_flatten = false; | ||||||
| 
 | 
 | ||||||
| 	log_header("Executing MITER pass (creating miter circuit).\n"); | 	log_header("Executing MITER pass (creating miter circuit).\n"); | ||||||
| 
 | 
 | ||||||
|  | @ -49,6 +50,10 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args, | ||||||
| 			flag_make_assert = true; | 			flag_make_assert = true; | ||||||
| 			continue; | 			continue; | ||||||
| 		} | 		} | ||||||
|  | 		if (args[argidx] == "-flatten") { | ||||||
|  | 			flag_flatten = true; | ||||||
|  | 			continue; | ||||||
|  | 		} | ||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
| 	if (argidx+3 != args.size() || args[argidx].substr(0, 1) == "-") | 	if (argidx+3 != args.size() || args[argidx].substr(0, 1) == "-") | ||||||
|  | @ -287,6 +292,12 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args, | ||||||
| 	miter_module->add(not_cell); | 	miter_module->add(not_cell); | ||||||
| 
 | 
 | ||||||
| 	miter_module->fixup_ports(); | 	miter_module->fixup_ports(); | ||||||
|  | 
 | ||||||
|  | 	if (flag_flatten) { | ||||||
|  | 		log_push(); | ||||||
|  | 		Pass::call_on_module(design, miter_module, "flatten; opt_const -undriven;;"); | ||||||
|  | 		log_pop(); | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| struct MiterPass : public Pass { | struct MiterPass : public Pass { | ||||||
|  | @ -317,6 +328,9 @@ struct MiterPass : public Pass { | ||||||
| 		log("    -make_assert\n"); | 		log("    -make_assert\n"); | ||||||
| 		log("        also create an 'assert' cell that checks if trigger is always low.\n"); | 		log("        also create an 'assert' cell that checks if trigger is always low.\n"); | ||||||
| 		log("\n"); | 		log("\n"); | ||||||
|  | 		log("    -flatten\n"); | ||||||
|  | 		log("        call 'flatten; opt_const -undriven;;' on the miter circuit.\n"); | ||||||
|  | 		log("\n"); | ||||||
| 	} | 	} | ||||||
| 	virtual void execute(std::vector<std::string> args, RTLIL::Design *design) | 	virtual void execute(std::vector<std::string> args, RTLIL::Design *design) | ||||||
| 	{ | 	{ | ||||||
|  |  | ||||||
|  | @ -35,7 +35,6 @@ for idx in range(100): | ||||||
|         print('copy uut_%05d gold' % idx) |         print('copy uut_%05d gold' % idx) | ||||||
|         print('rename uut_%05d gate' % idx) |         print('rename uut_%05d gate' % idx) | ||||||
|         print('share -aggressive gate') |         print('share -aggressive gate') | ||||||
|         print('miter -equiv -ignore_gold_x -make_outputs -make_outcmp gold gate miter') |         print('miter -equiv -flatten -ignore_gold_x -make_outputs -make_outcmp gold gate miter') | ||||||
|         print('flatten miter') |  | ||||||
|         print('sat -verify -prove trigger 0 -show-inputs -show-outputs miter') |         print('sat -verify -prove trigger 0 -show-inputs -show-outputs miter') | ||||||
|   |   | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue