mirror of https://github.com/YosysHQ/yosys.git
synth: Introduce `-inject` for amending techmap
This commit is contained in:
parent
d77b792156
commit
ba07cba6ce
|
@ -88,6 +88,10 @@ struct SynthPass : public ScriptPass {
|
|||
log(" read/write collision\" (same result as setting the no_rw_check\n");
|
||||
log(" attribute on all memories).\n");
|
||||
log("\n");
|
||||
log(" -inject filename\n");
|
||||
log(" inject rules from the given file to complement the default\n");
|
||||
log(" mapping library in the `techmap` step. this option can be\n");
|
||||
log(" repeated.\n");
|
||||
log("\n");
|
||||
log("The following commands are executed by this synthesis command:\n");
|
||||
help_script();
|
||||
|
@ -96,8 +100,8 @@ struct SynthPass : public ScriptPass {
|
|||
|
||||
string top_module, fsm_opts, memory_opts, abc;
|
||||
bool autotop, flatten, noalumacc, nofsm, noabc, noshare, flowmap, booth;
|
||||
|
||||
int lut;
|
||||
std::vector<std::string> techmap_inject;
|
||||
|
||||
void clear_flags() override
|
||||
{
|
||||
|
@ -115,6 +119,7 @@ struct SynthPass : public ScriptPass {
|
|||
flowmap = false;
|
||||
booth = false;
|
||||
abc = "abc";
|
||||
techmap_inject.clear();
|
||||
}
|
||||
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) override
|
||||
|
@ -192,6 +197,10 @@ struct SynthPass : public ScriptPass {
|
|||
memory_opts += " -no-rw-check";
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-inject" && argidx + 1 < args.size()) {
|
||||
techmap_inject.push_back(args[++argidx]);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
extra_args(args, argidx, design);
|
||||
|
@ -261,7 +270,17 @@ struct SynthPass : public ScriptPass {
|
|||
run("opt -fast -full");
|
||||
run("memory_map");
|
||||
run("opt -full");
|
||||
run("techmap");
|
||||
if (help_mode) {
|
||||
run("techmap", " (unless -inject)");
|
||||
run("techmap -map +/techmap.v -map <inject>", " (if -inject)");
|
||||
} else {
|
||||
std::string techmap_opts;
|
||||
if (!techmap_inject.empty())
|
||||
techmap_opts += " -map +/techmap.v";
|
||||
for (auto fn : techmap_inject)
|
||||
techmap_opts += stringf(" -map %s", fn.c_str());
|
||||
run("techmap" + techmap_opts);
|
||||
}
|
||||
if (help_mode) {
|
||||
run("techmap -map +/gate2lut.v", "(if -noabc and -lut)");
|
||||
run("clean; opt_lut", " (if -noabc and -lut)");
|
||||
|
|
Loading…
Reference in New Issue