Merge pull request #1166 from YosysHQ/eddie/synth_keepdc

Add "synth -keepdc" option
This commit is contained in:
Eddie Hung 2019-07-08 21:43:16 -07:00 committed by GitHub
commit 7f8c420cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -12,6 +12,7 @@ Yosys 0.9 .. Yosys 0.9-dev
- Added "synth_xilinx -abc9" (experimental) - Added "synth_xilinx -abc9" (experimental)
- Added "synth_ice40 -abc9" (experimental) - Added "synth_ice40 -abc9" (experimental)
- Added "synth -abc9" (experimental) - Added "synth -abc9" (experimental)
- Added "synth -keepdc"
- Added "script -scriptwire - Added "script -scriptwire

View File

@ -497,7 +497,7 @@ struct WreducePass : public Pass {
log(" flows that use the 'memory_memx' pass.\n"); log(" flows that use the 'memory_memx' pass.\n");
log("\n"); log("\n");
log(" -keepdc\n"); log(" -keepdc\n");
log(" Do not optimize explicit don't-care values.\n"); log(" Do not optimize explicit don't-care values on $mux cells.\n");
log("\n"); log("\n");
} }
void execute(std::vector<std::string> args, Design *design) YS_OVERRIDE void execute(std::vector<std::string> args, Design *design) YS_OVERRIDE

View File

@ -78,6 +78,9 @@ struct SynthPass : public ScriptPass
log(" -abc9\n"); log(" -abc9\n");
log(" use new ABC9 flow (EXPERIMENTAL)\n"); log(" use new ABC9 flow (EXPERIMENTAL)\n");
log("\n"); log("\n");
log(" -keepdc\n");
log(" do not optimize explicit don't-care values on $mux cells.\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");
help_script(); help_script();
@ -85,7 +88,7 @@ struct SynthPass : public ScriptPass
} }
string top_module, fsm_opts, memory_opts, abc; string top_module, fsm_opts, memory_opts, abc;
bool autotop, flatten, noalumacc, nofsm, noabc, noshare; bool autotop, flatten, noalumacc, nofsm, noabc, noshare, keepdc;
int lut; int lut;
void clear_flags() YS_OVERRIDE void clear_flags() YS_OVERRIDE
@ -102,6 +105,7 @@ struct SynthPass : public ScriptPass
noabc = false; noabc = false;
noshare = false; noshare = false;
abc = "abc"; abc = "abc";
keepdc = false;
} }
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
@ -167,6 +171,10 @@ struct SynthPass : public ScriptPass
abc = "abc9"; abc = "abc9";
continue; continue;
} }
if (args[argidx] == "-keepdc") {
keepdc = true;
continue;
}
break; break;
} }
extra_args(args, argidx, design); extra_args(args, argidx, design);
@ -211,7 +219,10 @@ struct SynthPass : public ScriptPass
run("opt_clean"); run("opt_clean");
run("check"); run("check");
run("opt"); run("opt");
run("wreduce"); if (help_mode)
run("wreduce [-keepdc]");
else
run("wreduce" + std::string(keepdc ? " -keepdc" : ""));
run("peepopt"); run("peepopt");
run("opt_clean"); run("opt_clean");
if (help_mode) if (help_mode)