aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs
diff options
context:
space:
mode:
authorTaoBi22 <beahealy22@gmail.com>2022-09-28 12:42:27 +0100
committermyrtle <gatecat@ds0.me>2022-11-17 13:34:58 +0100
commit2b07e01ea400e2a1964d3698b3f1509685f565a2 (patch)
tree314165e158d937a9d69ff4dc60a0531e59557505 /techlibs
parentdf5617856781aca9a09a647f72817c076e5e55fe (diff)
downloadyosys-2b07e01ea400e2a1964d3698b3f1509685f565a2.tar.gz
yosys-2b07e01ea400e2a1964d3698b3f1509685f565a2.tar.bz2
yosys-2b07e01ea400e2a1964d3698b3f1509685f565a2.zip
Replace synth call with components, reintroduce flags and correct vpr flag implementation
Diffstat (limited to 'techlibs')
-rw-r--r--techlibs/fabulous/synth_fabulous.cc80
1 files changed, 76 insertions, 4 deletions
diff --git a/techlibs/fabulous/synth_fabulous.cc b/techlibs/fabulous/synth_fabulous.cc
index 17c67a636..3b36a5bf6 100644
--- a/techlibs/fabulous/synth_fabulous.cc
+++ b/techlibs/fabulous/synth_fabulous.cc
@@ -47,22 +47,46 @@ struct SynthPass : public ScriptPass
log(" -lut <k>\n");
log(" perform synthesis for a k-LUT architecture (default 4).\n");
log("\n");
+ log(" -vpr\n");
+ log(" perform synthesis for the FABulous VPR flow (using slightly different techmapping).\n");
+ log("\n");
log(" -plib <primitive_library.v>\n");
log(" use the specified Verilog file as a primitive library.\n");
log("\n");
+ log(" -encfile <file>\n");
+ log(" passed to 'fsm_recode' via 'fsm'\n");
+ log("\n");
+ log(" -nofsm\n");
+ log(" do not run FSM optimization\n");
+ log("\n");
+ log(" -noalumacc\n");
+ log(" do not run 'alumacc' pass. i.e. keep arithmetic operators in\n");
+ log(" their direct form ($add, $sub, etc.).\n");
+ log("\n");
+ log(" -nordff\n");
+ log(" passed to 'memory'. prohibits merging of FFs into memory read ports\n");
+ log("\n");
+ log(" -noshare\n");
+ log(" do not run SAT-based resource sharing\n");
+ log("\n");
log(" -run <from_label>[:<to_label>]\n");
log(" only run the commands between the labels (see below). an empty\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("\n");
+ log(" -no-rw-check\n");
+ log(" marks all recognized read ports as \"return don't-care value on\n");
+ log(" read/write collision\" (same result as setting the no_rw_check\n");
+ log(" attribute on all memories).\n");
+ log("\n");
log("\n");
log("The following commands are executed by this synthesis command:\n");
help_script();
log("\n");
}
- string top_module, plib;
- bool autotop, forvpr;
+ string top_module, plib, fsm_opts, memory_opts;
+ bool autotop, forvpr, noalumacc, nofsm, noshare;
int lut;
void clear_flags() override
@@ -72,6 +96,9 @@ struct SynthPass : public ScriptPass
autotop = false;
lut = 4;
forvpr = false;
+ noalumacc = false;
+ nofsm = false;
+ noshare = false;
}
// TODO: bring back relevant flags to carry through to synth call
@@ -114,6 +141,26 @@ struct SynthPass : public ScriptPass
plib = args[++argidx];
continue;
}
+ if (args[argidx] == "-nofsm") {
+ nofsm = true;
+ continue;
+ }
+ if (args[argidx] == "-noalumacc") {
+ noalumacc = true;
+ continue;
+ }
+ if (args[argidx] == "-nordff") {
+ memory_opts += " -nordff";
+ continue;
+ }
+ if (args[argidx] == "-noshare") {
+ noshare = true;
+ continue;
+ }
+ if (args[argidx] == "-no-rw-check") {
+ memory_opts += " -no-rw-check";
+ continue;
+ }
break;
}
extra_args(args, argidx, design);
@@ -147,7 +194,32 @@ struct SynthPass : public ScriptPass
run("proc");
run("tribuf -logic");
run("deminout");
- run("synth -run coarse");
+
+ // synth pass
+ run("proc");
+ run("opt_expr");
+ run("opt_clean");
+ run("check");
+ run("opt -nodffe -nosdff");
+ if (!nofsm)
+ run("fsm" + fsm_opts, " (unless -nofsm)");
+ run("opt");
+ run("wreduce");
+ run("peepopt");
+ run("opt_clean");
+ if (help_mode)
+ run("techmap -map +/cmp2lut.v -map +/cmp2lcu.v", " (if -lut)");
+ else if (lut)
+ run(stringf("techmap -map +/cmp2lut.v -map +/cmp2lcu.v -D LUT_WIDTH=%d", lut));
+ if (!noalumacc)
+ run("alumacc", " (unless -noalumacc)");
+ if (!noshare)
+ run("share", " (unless -noshare)");
+ run("opt");
+ run("memory -nomap" + memory_opts);
+ run("opt_clean");
+
+
run("memory_map");
run("opt -full");
run("techmap -map +/techmap.v");
@@ -156,7 +228,7 @@ struct SynthPass : public ScriptPass
run("techmap -map +/fabulous/latches_map.v");
run("abc -lut $LUT_K -dress");
run("clean");
- if (forvpr)
+ if (!forvpr)
run("techmap -D LUT_K=$LUT_K -map +/fabulous/cells_map.v");
run("clean");
run("hierarchy -check");