mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	synth_sf2: add -discard-ffinit option to discard ff initial value
sf2 ff have no initial values, but some IP cores use initial values. In order to use those cores on sf2, it is required to discard the initial value (to be carefully used).
This commit is contained in:
		
							parent
							
								
									7117817dbe
								
							
						
					
					
						commit
						4543751a77
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -66,6 +66,9 @@ struct SynthSf2Pass : public ScriptPass | |||
| 		log("    -clkbuf\n"); | ||||
| 		log("        insert direct PAD->global_net buffers\n"); | ||||
| 		log("\n"); | ||||
| 		log("    -discard-ffinit\n"); | ||||
| 		log("        discard FF init value instead of emitting an error\n"); | ||||
| 		log("\n"); | ||||
| 		log("    -retime\n"); | ||||
| 		log("        run 'abc' with '-dff -D 1' options\n"); | ||||
| 		log("\n"); | ||||
|  | @ -76,7 +79,7 @@ struct SynthSf2Pass : public ScriptPass | |||
| 	} | ||||
| 
 | ||||
| 	string top_opt, edif_file, vlog_file, json_file; | ||||
| 	bool flatten, retime, iobs, clkbuf; | ||||
| 	bool flatten, retime, iobs, clkbuf, discard_ffinit; | ||||
| 
 | ||||
| 	void clear_flags() override | ||||
| 	{ | ||||
|  | @ -88,6 +91,7 @@ struct SynthSf2Pass : public ScriptPass | |||
| 		retime = false; | ||||
| 		iobs = true; | ||||
| 		clkbuf = false; | ||||
| 		discard_ffinit = false; | ||||
| 	} | ||||
| 
 | ||||
| 	void execute(std::vector<std::string> args, RTLIL::Design *design) override | ||||
|  | @ -138,6 +142,10 @@ struct SynthSf2Pass : public ScriptPass | |||
| 				clkbuf = true; | ||||
| 				continue; | ||||
| 			} | ||||
| 			if (args[argidx] == "-discard-ffinit") { | ||||
| 				discard_ffinit = true; | ||||
| 				continue; | ||||
| 			} | ||||
| 			break; | ||||
| 		} | ||||
| 		extra_args(args, argidx, design); | ||||
|  | @ -171,6 +179,8 @@ struct SynthSf2Pass : public ScriptPass | |||
| 
 | ||||
| 		if (check_label("coarse")) | ||||
| 		{ | ||||
| 			if (discard_ffinit || help_mode) | ||||
| 				run("attrmap -remove init", "(only if -discard-ffinit)"); | ||||
| 			run("synth -run coarse"); | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue