aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/ice40/synth_ice40.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-05-05 06:49:36 -0700
committerGitHub <noreply@github.com>2020-05-05 06:49:36 -0700
commit5fa06e4894f13d82cf847f8d7b078c5b46a01737 (patch)
tree03167c4eff66112816defadc9bda3a766cab587d /techlibs/ice40/synth_ice40.cc
parent7a62ee57b4953a01637086d409a99b9779a7d6c9 (diff)
parente6b55e8b38d98e28ee53f7b470cef1bcc3b399f3 (diff)
downloadyosys-5fa06e4894f13d82cf847f8d7b078c5b46a01737.tar.gz
yosys-5fa06e4894f13d82cf847f8d7b078c5b46a01737.tar.bz2
yosys-5fa06e4894f13d82cf847f8d7b078c5b46a01737.zip
Merge pull request #2026 from YosysHQ/eddie/scratchpad_abc9_W
synth_ice40/ecp5/xilinx: allow abc9.W to be overridden via scratchpad
Diffstat (limited to 'techlibs/ice40/synth_ice40.cc')
-rw-r--r--techlibs/ice40/synth_ice40.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/techlibs/ice40/synth_ice40.cc b/techlibs/ice40/synth_ice40.cc
index 9724b7dd5..2b211572d 100644
--- a/techlibs/ice40/synth_ice40.cc
+++ b/techlibs/ice40/synth_ice40.cc
@@ -29,6 +29,13 @@ struct SynthIce40Pass : public ScriptPass
{
SynthIce40Pass() : ScriptPass("synth_ice40", "synthesis for iCE40 FPGAs") { }
+ void on_register() YS_OVERRIDE
+ {
+ RTLIL::constpad["synth_ice40.abc9.hx.W"] = "250";
+ RTLIL::constpad["synth_ice40.abc9.lp.W"] = "400";
+ RTLIL::constpad["synth_ice40.abc9.u.W"] = "750";
+ }
+
void help() YS_OVERRIDE
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
@@ -373,14 +380,15 @@ struct SynthIce40Pass : public ScriptPass
if (!noabc) {
if (abc9) {
run("read_verilog " + define + " -icells -lib -specify +/abc9_model.v +/ice40/abc9_model.v");
- int wire_delay;
- if (device_opt == "lp")
- wire_delay = 400;
- else if (device_opt == "u")
- wire_delay = 750;
- else
- wire_delay = 250;
- run(stringf("abc9 -W %d", wire_delay));
+ std::string abc9_opts;
+ std::string k = "synth_ice40.abc9.W";
+ if (active_design && active_design->scratchpad.count(k))
+ abc9_opts += stringf(" -W %s", active_design->scratchpad_get_string(k).c_str());
+ else {
+ k = stringf("synth_ice40.abc9.%s.W", device_opt.c_str());
+ abc9_opts += stringf(" -W %s", RTLIL::constpad.at(k).c_str());
+ }
+ run("abc9 " + abc9_opts);
}
else
run("abc -dress -lut 4", "(skip if -noabc)");