mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Added "prep -auto-top" and "synth -auto-top"
This commit is contained in:
		
							parent
							
								
									a72fb85dc2
								
							
						
					
					
						commit
						cdb58f68ab
					
				
					 2 changed files with 23 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -42,6 +42,9 @@ struct PrepPass : public ScriptPass
 | 
			
		|||
		log("    -top <module>\n");
 | 
			
		||||
		log("        use the specified module as top module (default='top')\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("    -auto-top\n");
 | 
			
		||||
		log("        automatically determine the top of the design hierarchy\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("    -flatten\n");
 | 
			
		||||
		log("        flatten the design before synthesis. this will pass '-auto-top' to\n");
 | 
			
		||||
		log("        'hierarchy' if no top module is specified.\n");
 | 
			
		||||
| 
						 | 
				
			
			@ -65,12 +68,14 @@ struct PrepPass : public ScriptPass
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	string top_module, fsm_opts, memory_opts;
 | 
			
		||||
	bool flatten, ifxmode;
 | 
			
		||||
	bool autotop, flatten, ifxmode;
 | 
			
		||||
 | 
			
		||||
	virtual void clear_flags() YS_OVERRIDE
 | 
			
		||||
	{
 | 
			
		||||
		top_module.clear();
 | 
			
		||||
		memory_opts.clear();
 | 
			
		||||
 | 
			
		||||
		autotop = false;
 | 
			
		||||
		flatten = false;
 | 
			
		||||
		ifxmode = false;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -97,6 +102,10 @@ struct PrepPass : public ScriptPass
 | 
			
		|||
				}
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (args[argidx] == "-auto-top") {
 | 
			
		||||
				autotop = true;
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (args[argidx] == "-flatten") {
 | 
			
		||||
				flatten = true;
 | 
			
		||||
				continue;
 | 
			
		||||
| 
						 | 
				
			
			@ -130,10 +139,10 @@ struct PrepPass : public ScriptPass
 | 
			
		|||
		if (check_label("begin"))
 | 
			
		||||
		{
 | 
			
		||||
			if (help_mode) {
 | 
			
		||||
				run("hierarchy -check [-top <top>]");
 | 
			
		||||
				run("hierarchy -check [-top <top> | -auto-top]");
 | 
			
		||||
			} else {
 | 
			
		||||
				if (top_module.empty()) {
 | 
			
		||||
					if (flatten)
 | 
			
		||||
					if (flatten || autotop)
 | 
			
		||||
						run("hierarchy -check -auto-top");
 | 
			
		||||
					else
 | 
			
		||||
						run("hierarchy -check");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,6 +41,9 @@ struct SynthPass : public ScriptPass
 | 
			
		|||
		log("    -top <module>\n");
 | 
			
		||||
		log("        use the specified module as top module (default='top')\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("    -auto-top\n");
 | 
			
		||||
		log("        automatically determine the top of the design hierarchy\n");
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("    -flatten\n");
 | 
			
		||||
		log("        flatten the design before synthesis. this will pass '-auto-top' to\n");
 | 
			
		||||
		log("        'hierarchy' if no top module is specified.\n");
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +76,7 @@ struct SynthPass : public ScriptPass
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	string top_module, fsm_opts, memory_opts;
 | 
			
		||||
	bool flatten, noalumacc, nofsm, noabc;
 | 
			
		||||
	bool autotop, flatten, noalumacc, nofsm, noabc;
 | 
			
		||||
 | 
			
		||||
	virtual void clear_flags() YS_OVERRIDE
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +84,7 @@ struct SynthPass : public ScriptPass
 | 
			
		|||
		fsm_opts.clear();
 | 
			
		||||
		memory_opts.clear();
 | 
			
		||||
 | 
			
		||||
		autotop = false;
 | 
			
		||||
		flatten = false;
 | 
			
		||||
		noalumacc = false;
 | 
			
		||||
		nofsm = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -114,6 +118,10 @@ struct SynthPass : public ScriptPass
 | 
			
		|||
				}
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (args[argidx] == "-auto-top") {
 | 
			
		||||
				autotop = true;
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			if (args[argidx] == "-flatten") {
 | 
			
		||||
				flatten = true;
 | 
			
		||||
				continue;
 | 
			
		||||
| 
						 | 
				
			
			@ -154,10 +162,10 @@ struct SynthPass : public ScriptPass
 | 
			
		|||
		if (check_label("begin"))
 | 
			
		||||
		{
 | 
			
		||||
			if (help_mode) {
 | 
			
		||||
				run("hierarchy -check [-top <top>]");
 | 
			
		||||
				run("hierarchy -check [-top <top> | -auto-top]");
 | 
			
		||||
			} else {
 | 
			
		||||
				if (top_module.empty()) {
 | 
			
		||||
					if (flatten)
 | 
			
		||||
					if (flatten || autotop)
 | 
			
		||||
						run("hierarchy -check -auto-top");
 | 
			
		||||
					else
 | 
			
		||||
						run("hierarchy -check");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue