mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Added synth_xilinx -retime -flatten
This commit is contained in:
		
							parent
							
								
									8658eed52a
								
							
						
					
					
						commit
						279a18c9a3
					
				
					 1 changed files with 28 additions and 2 deletions
				
			
		| 
						 | 
					@ -58,12 +58,22 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
		log("        from label is synonymous to 'begin', and empty to label is\n");
 | 
							log("        from label is synonymous to 'begin', and empty to label is\n");
 | 
				
			||||||
		log("        synonymous to the end of the command list.\n");
 | 
							log("        synonymous to the end of the command list.\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
 | 
							log("    -flatten\n");
 | 
				
			||||||
 | 
							log("        flatten design before synthesis\n");
 | 
				
			||||||
 | 
							log("\n");
 | 
				
			||||||
 | 
							log("    -retime\n");
 | 
				
			||||||
 | 
							log("        run 'abc' with -dff option\n");
 | 
				
			||||||
 | 
							log("\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
		log("The following commands are executed by this synthesis command:\n");
 | 
							log("The following commands are executed by this synthesis command:\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
		log("    begin:\n");
 | 
							log("    begin:\n");
 | 
				
			||||||
		log("        hierarchy -check -top <top>\n");
 | 
							log("        hierarchy -check -top <top>\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
 | 
							log("    flatten:     (only if -flatten)\n");
 | 
				
			||||||
 | 
							log("        proc\n");
 | 
				
			||||||
 | 
							log("        flatten\n");
 | 
				
			||||||
 | 
							log("\n");
 | 
				
			||||||
		log("    coarse:\n");
 | 
							log("    coarse:\n");
 | 
				
			||||||
		log("        synth -run coarse\n");
 | 
							log("        synth -run coarse\n");
 | 
				
			||||||
		log("        dff2dffe\n");
 | 
							log("        dff2dffe\n");
 | 
				
			||||||
| 
						 | 
					@ -80,7 +90,7 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
		log("        opt -fast\n");
 | 
							log("        opt -fast\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
		log("    map_luts:\n");
 | 
							log("    map_luts:\n");
 | 
				
			||||||
		log("        abc -lut 6:8\n");
 | 
							log("        abc -lut 5:8 [-dff]\n");
 | 
				
			||||||
		log("        clean\n");
 | 
							log("        clean\n");
 | 
				
			||||||
		log("\n");
 | 
							log("\n");
 | 
				
			||||||
		log("    map_cells:\n");
 | 
							log("    map_cells:\n");
 | 
				
			||||||
| 
						 | 
					@ -97,6 +107,8 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
		std::string arch_name = "spartan6";
 | 
							std::string arch_name = "spartan6";
 | 
				
			||||||
		std::string edif_file;
 | 
							std::string edif_file;
 | 
				
			||||||
		std::string run_from, run_to;
 | 
							std::string run_from, run_to;
 | 
				
			||||||
 | 
							bool flatten = false;
 | 
				
			||||||
 | 
							bool retime = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		size_t argidx;
 | 
							size_t argidx;
 | 
				
			||||||
		for (argidx = 1; argidx < args.size(); argidx++)
 | 
							for (argidx = 1; argidx < args.size(); argidx++)
 | 
				
			||||||
| 
						 | 
					@ -117,6 +129,14 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
				run_to = args[argidx].substr(pos+1);
 | 
									run_to = args[argidx].substr(pos+1);
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								if (args[argidx] == "-flatten") {
 | 
				
			||||||
 | 
									flatten = true;
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (args[argidx] == "-retime") {
 | 
				
			||||||
 | 
									retime = true;
 | 
				
			||||||
 | 
									continue;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		extra_args(args, argidx, design);
 | 
							extra_args(args, argidx, design);
 | 
				
			||||||
| 
						 | 
					@ -134,6 +154,12 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
			Pass::call(design, stringf("hierarchy -check -top %s", top_module.c_str()));
 | 
								Pass::call(design, stringf("hierarchy -check -top %s", top_module.c_str()));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (flatten && check_label(active, run_from, run_to, "flatten"))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								Pass::call(design, "proc");
 | 
				
			||||||
 | 
								Pass::call(design, "flatten");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (check_label(active, run_from, run_to, "coarse"))
 | 
							if (check_label(active, run_from, run_to, "coarse"))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			Pass::call(design, "synth -run coarse");
 | 
								Pass::call(design, "synth -run coarse");
 | 
				
			||||||
| 
						 | 
					@ -157,7 +183,7 @@ struct SynthXilinxPass : public Pass {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (check_label(active, run_from, run_to, "map_luts"))
 | 
							if (check_label(active, run_from, run_to, "map_luts"))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			Pass::call(design, "abc -lut 6:8");
 | 
								Pass::call(design, "abc -lut 5:8" + string(retime ? " -dff" : ""));
 | 
				
			||||||
			Pass::call(design, "clean");
 | 
								Pass::call(design, "clean");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue