aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/ice40/synth_ice40.cc
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2019-02-21 11:23:00 -0800
committerEddie Hung <eddieh@ece.ubc.ca>2019-02-21 11:23:00 -0800
commita8803a1519ce9191c43cd9a0f09d6c3ae99666e9 (patch)
tree88dcf42e2eb5121441fa95ea9146bc8b217b0160 /techlibs/ice40/synth_ice40.cc
parent5994382a20a0b7e890d22d032eecb39b61e0b3ce (diff)
parentd55790909c3b4244889d092c8eae630c7efd1aee (diff)
downloadyosys-a8803a1519ce9191c43cd9a0f09d6c3ae99666e9.tar.gz
yosys-a8803a1519ce9191c43cd9a0f09d6c3ae99666e9.tar.bz2
yosys-a8803a1519ce9191c43cd9a0f09d6c3ae99666e9.zip
Merge remote-tracking branch 'origin/master' into xaig
Diffstat (limited to 'techlibs/ice40/synth_ice40.cc')
-rw-r--r--techlibs/ice40/synth_ice40.cc31
1 files changed, 28 insertions, 3 deletions
diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc
index f77ea7f80..a13a81246 100644
--- a/techlibs/ice40/synth_ice40.cc
+++ b/techlibs/ice40/synth_ice40.cc
@@ -79,6 +79,9 @@ struct SynthIce40Pass : public ScriptPass
log(" -nobram\n");
log(" do not use SB_RAM40_4K* cells in output netlist\n");
log("\n");
+ log(" -dsp\n");
+ log(" use iCE40 UltraPlus DSP cells for large arithmetic\n");
+ log("\n");
log(" -noabc\n");
log(" use built-in Yosys LUT techmapping instead of abc\n");
log("\n");
@@ -98,8 +101,9 @@ struct SynthIce40Pass : public ScriptPass
log("\n");
}
+
string top_opt, blif_file, edif_file, json_file, abc;
- bool nocarry, nodffe, nobram, flatten, retime, relut, noabc, abc2, vpr;
+ bool nocarry, nodffe, nobram, dsp, flatten, retime, relut, noabc, abc2, vpr;
int min_ce_use;
void clear_flags() YS_OVERRIDE
@@ -112,6 +116,7 @@ struct SynthIce40Pass : public ScriptPass
nodffe = false;
min_ce_use = -1;
nobram = false;
+ dsp = false;
flatten = true;
retime = false;
relut = false;
@@ -185,6 +190,10 @@ struct SynthIce40Pass : public ScriptPass
nobram = true;
continue;
}
+ if (args[argidx] == "-dsp") {
+ dsp = true;
+ continue;
+ }
if (args[argidx] == "-noabc") {
noabc = true;
continue;
@@ -222,11 +231,11 @@ struct SynthIce40Pass : public ScriptPass
{
run("read_verilog -lib +/ice40/cells_sim.v");
run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
+ run("proc");
}
if (flatten && check_label("flatten", "(unless -noflatten)"))
{
- run("proc");
run("flatten");
run("tribuf -logic");
run("deminout");
@@ -234,7 +243,23 @@ struct SynthIce40Pass : public ScriptPass
if (check_label("coarse"))
{
- run("synth -lut 4 -run coarse");
+ run("opt_expr");
+ run("opt_clean");
+ run("check");
+ run("opt");
+ run("wreduce");
+ run("share");
+ run("techmap -map +/cmp2lut.v -D LUT_WIDTH=4");
+ run("opt_expr");
+ run("opt_clean");
+ if (help_mode || dsp)
+ run("ice40_dsp", "(if -dsp)");
+ run("alumacc");
+ run("opt");
+ run("fsm");
+ run("opt -fast");
+ run("memory -nomap");
+ run("opt_clean");
}
if (!nobram && check_label("bram", "(skip if -nobram)"))