mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	Rename -minmuxf to -widemux
This commit is contained in:
		
							parent
							
								
									184cfacfb5
								
							
						
					
					
						commit
						177c26ca35
					
				
					 1 changed files with 23 additions and 23 deletions
				
			
		|  | @ -73,7 +73,7 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 		log("    -nosrl\n"); | 		log("    -nosrl\n"); | ||||||
| 		log("        disable inference of shift registers\n"); | 		log("        disable inference of shift registers\n"); | ||||||
| 		log("\n"); | 		log("\n"); | ||||||
| 		log("    -minmuxf <int>\n"); | 		log("    -widemux <int>\n"); | ||||||
| 		log("        enable inference of hard multiplexer resources (MuxFx) for muxes at or\n"); | 		log("        enable inference of hard multiplexer resources (MuxFx) for muxes at or\n"); | ||||||
| 		log("        above this number of inputs (minimum value 5).\n"); | 		log("        above this number of inputs (minimum value 5).\n"); | ||||||
| 		log("        default: 0 (no inference)\n"); | 		log("        default: 0 (no inference)\n"); | ||||||
|  | @ -100,7 +100,7 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 
 | 
 | ||||||
| 	std::string top_opt, edif_file, blif_file, abc, arch; | 	std::string top_opt, edif_file, blif_file, abc, arch; | ||||||
| 	bool flatten, retime, vpr, nocarry, nobram, nodram, nosrl; | 	bool flatten, retime, vpr, nocarry, nobram, nodram, nosrl; | ||||||
| 	int minmuxf; | 	int widemux; | ||||||
| 
 | 
 | ||||||
| 	void clear_flags() YS_OVERRIDE | 	void clear_flags() YS_OVERRIDE | ||||||
| 	{ | 	{ | ||||||
|  | @ -116,7 +116,7 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 		nodram = false; | 		nodram = false; | ||||||
| 		nosrl = false; | 		nosrl = false; | ||||||
| 		arch = "xc7"; | 		arch = "xc7"; | ||||||
| 		minmuxf = 0; | 		widemux = 0; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE | 	void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE | ||||||
|  | @ -179,8 +179,8 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 				nosrl = true; | 				nosrl = true; | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
| 			if (args[argidx] == "-minmuxf" && argidx+1 < args.size()) { | 			if (args[argidx] == "-widemux" && argidx+1 < args.size()) { | ||||||
| 				minmuxf = atoi(args[++argidx].c_str()); | 				widemux = atoi(args[++argidx].c_str()); | ||||||
| 				continue; | 				continue; | ||||||
| 			} | 			} | ||||||
| 			if (args[argidx] == "-abc9") { | 			if (args[argidx] == "-abc9") { | ||||||
|  | @ -194,8 +194,8 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 		if (arch != "xcup" && arch != "xcu" && arch != "xc7" && arch != "xc6s") | 		if (arch != "xcup" && arch != "xcu" && arch != "xc7" && arch != "xc6s") | ||||||
| 			log_cmd_error("Invalid Xilinx -arch setting: %s\n", arch.c_str()); | 			log_cmd_error("Invalid Xilinx -arch setting: %s\n", arch.c_str()); | ||||||
| 
 | 
 | ||||||
| 		if (minmuxf != 0 && minmuxf < 5) | 		if (widemux != 0 && widemux < 5) | ||||||
| 			log_cmd_error("-minmuxf value must be 0 or >= 5.\n"); | 			log_cmd_error("-widemux value must be 0 or >= 5.\n"); | ||||||
| 
 | 
 | ||||||
| 		if (!design->full_selection()) | 		if (!design->full_selection()) | ||||||
| 			log_cmd_error("This command only operates on fully selected designs!\n"); | 			log_cmd_error("This command only operates on fully selected designs!\n"); | ||||||
|  | @ -233,9 +233,9 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 			run("check"); | 			run("check"); | ||||||
| 			run("opt"); | 			run("opt"); | ||||||
| 			if (help_mode) | 			if (help_mode) | ||||||
| 				run("wreduce [c:* t:$mux %d]", "(selection for '-minmuxf' only)"); | 				run("wreduce [c:* t:$mux %d]", "(selection for '-widemux' only)"); | ||||||
| 			else | 			else | ||||||
| 				run("wreduce" + std::string(minmuxf > 0 ? " c:* t:$mux %d" : "")); | 				run("wreduce" + std::string(widemux > 0 ? " c:* t:$mux %d" : "")); | ||||||
| 			run("peepopt"); | 			run("peepopt"); | ||||||
| 			run("opt_clean"); | 			run("opt_clean"); | ||||||
| 			run("alumacc"); | 			run("alumacc"); | ||||||
|  | @ -246,15 +246,15 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 			run("memory -nomap"); | 			run("memory -nomap"); | ||||||
| 			run("opt_clean"); | 			run("opt_clean"); | ||||||
| 
 | 
 | ||||||
| 			if (minmuxf > 0 || help_mode) | 			if (widemux > 0 || help_mode) | ||||||
| 				run("muxpack", "    ('-minmuxf' only)"); | 				run("muxpack", "    ('-widemux' only)"); | ||||||
| 
 | 
 | ||||||
| 			// shregmap -tech xilinx can cope with $shiftx and $mux
 | 			// shregmap -tech xilinx can cope with $shiftx and $mux
 | ||||||
| 			//   cells for identifying variable-length shift registers,
 | 			//   cells for identifying variable-length shift registers,
 | ||||||
| 			//   so attempt to convert $pmux-es to the former
 | 			//   so attempt to convert $pmux-es to the former
 | ||||||
| 			// Also: wide multiplexer inference benefits from this too
 | 			// Also: wide multiplexer inference benefits from this too
 | ||||||
| 			if (!(nosrl && minmuxf == 0) || help_mode) | 			if (!(nosrl && widemux == 0) || help_mode) | ||||||
| 				run("pmux2shiftx", "(skip if '-nosrl' and '-minmuxf' < 5)"); | 				run("pmux2shiftx", "(skip if '-nosrl' and '-widemux' < 5)"); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (check_label("bram", "(skip if '-nobram')")) { | 		if (check_label("bram", "(skip if '-nobram')")) { | ||||||
|  | @ -272,15 +272,15 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if (check_label("fine")) { | 		if (check_label("fine")) { | ||||||
| 			run("opt -fast"); | 			run("opt -fast -full"); | ||||||
| 			run("memory_map"); | 			run("memory_map"); | ||||||
| 			run("dffsr2dff"); | 			run("dffsr2dff"); | ||||||
| 			run("dff2dffe"); | 			run("dff2dffe"); | ||||||
| 			if (minmuxf > 0 || help_mode) { | 			if (widemux > 0 || help_mode) { | ||||||
| 				run("simplemap t:$mux", "                        ('-minmuxf' only)"); | 				run("simplemap t:$mux", "                        ('-widemux' only)"); | ||||||
| 				if (minmuxf > 0 || help_mode) { | 				if (widemux > 0 || help_mode) { | ||||||
| 					std::string muxcover_args = " -dmux=0"; | 					std::string muxcover_args = " -dmux=0"; | ||||||
| 					switch (minmuxf) { | 					switch (widemux) { | ||||||
| 						// NB: Cost of mux2 is 100; mux8 should cost between 3 and 4
 | 						// NB: Cost of mux2 is 100; mux8 should cost between 3 and 4
 | ||||||
| 						//     of those so that 4:1 muxes and below are implemented
 | 						//     of those so that 4:1 muxes and below are implemented
 | ||||||
| 						//     out of mux2s
 | 						//     out of mux2s
 | ||||||
|  | @ -297,7 +297,7 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 						case 15: muxcover_args += " -mux16=1350"; break; | 						case 15: muxcover_args += " -mux16=1350"; break; | ||||||
| 						default: muxcover_args += " -mux16=1450"; break; | 						default: muxcover_args += " -mux16=1450"; break; | ||||||
| 					} | 					} | ||||||
| 					run("muxcover " + muxcover_args, "('-minmuxf' only)"); | 					run("muxcover " + muxcover_args, "('-widemux' only)"); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			run("opt -full"); | 			run("opt -full"); | ||||||
|  | @ -313,8 +313,8 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 			std::string techmap_args = " -map +/techmap.v"; | 			std::string techmap_args = " -map +/techmap.v"; | ||||||
| 			if (help_mode) | 			if (help_mode) | ||||||
| 				techmap_args += " [-map +/xilinx/mux_map.v]"; | 				techmap_args += " [-map +/xilinx/mux_map.v]"; | ||||||
| 			else if (minmuxf > 0) | 			else if (widemux > 0) | ||||||
| 				techmap_args += stringf(" -D MIN_MUX_INPUTS=%d -map +/xilinx/mux_map.v", minmuxf); | 				techmap_args += stringf(" -D MIN_MUX_INPUTS=%d -map +/xilinx/mux_map.v", widemux); | ||||||
| 			if (help_mode) | 			if (help_mode) | ||||||
| 				techmap_args += " [-map +/xilinx/arith_map.v]"; | 				techmap_args += " [-map +/xilinx/arith_map.v]"; | ||||||
| 			else if (!nocarry) { | 			else if (!nocarry) { | ||||||
|  | @ -330,8 +330,8 @@ struct SynthXilinxPass : public ScriptPass | ||||||
| 
 | 
 | ||||||
| 		if (check_label("map_cells")) { | 		if (check_label("map_cells")) { | ||||||
| 			std::string techmap_args = "-map +/techmap.v -D _ABC -map +/xilinx/cells_map.v"; | 			std::string techmap_args = "-map +/techmap.v -D _ABC -map +/xilinx/cells_map.v"; | ||||||
| 			if (minmuxf > 0) | 			if (widemux > 0) | ||||||
| 				techmap_args += stringf(" -D MIN_MUX_INPUTS=%d", minmuxf); | 				techmap_args += stringf(" -D MIN_MUX_INPUTS=%d", widemux); | ||||||
| 			run("techmap " + techmap_args); | 			run("techmap " + techmap_args); | ||||||
| 			run("clean"); | 			run("clean"); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue