aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tristan.gingold@cern.ch>2021-11-18 08:43:20 +0100
committerTristan Gingold <tristan.gingold@cern.ch>2022-08-31 08:40:43 +0200
commit4543751a773c770e444ab3c6acc586f6a9b4a510 (patch)
tree293517bf735dccef51f6b9f8f511235060f322ef
parent7117817dbe7edebc9ba63a9810eb775c90b6ece6 (diff)
downloadyosys-4543751a773c770e444ab3c6acc586f6a9b4a510.tar.gz
yosys-4543751a773c770e444ab3c6acc586f6a9b4a510.tar.bz2
yosys-4543751a773c770e444ab3c6acc586f6a9b4a510.zip
synth_sf2: add -discard-ffinit option to discard ff initial value
sf2 ff have no initial values, but some IP cores use initial values. In order to use those cores on sf2, it is required to discard the initial value (to be carefully used).
-rw-r--r--techlibs/sf2/synth_sf2.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/techlibs/sf2/synth_sf2.cc b/techlibs/sf2/synth_sf2.cc
index f78b4f012..fcc0a5e23 100644
--- a/techlibs/sf2/synth_sf2.cc
+++ b/techlibs/sf2/synth_sf2.cc
@@ -66,6 +66,9 @@ struct SynthSf2Pass : public ScriptPass
log(" -clkbuf\n");
log(" insert direct PAD->global_net buffers\n");
log("\n");
+ log(" -discard-ffinit\n");
+ log(" discard FF init value instead of emitting an error\n");
+ log("\n");
log(" -retime\n");
log(" run 'abc' with '-dff -D 1' options\n");
log("\n");
@@ -76,7 +79,7 @@ struct SynthSf2Pass : public ScriptPass
}
string top_opt, edif_file, vlog_file, json_file;
- bool flatten, retime, iobs, clkbuf;
+ bool flatten, retime, iobs, clkbuf, discard_ffinit;
void clear_flags() override
{
@@ -88,6 +91,7 @@ struct SynthSf2Pass : public ScriptPass
retime = false;
iobs = true;
clkbuf = false;
+ discard_ffinit = false;
}
void execute(std::vector<std::string> args, RTLIL::Design *design) override
@@ -138,6 +142,10 @@ struct SynthSf2Pass : public ScriptPass
clkbuf = true;
continue;
}
+ if (args[argidx] == "-discard-ffinit") {
+ discard_ffinit = true;
+ continue;
+ }
break;
}
extra_args(args, argidx, design);
@@ -171,6 +179,8 @@ struct SynthSf2Pass : public ScriptPass
if (check_label("coarse"))
{
+ if (discard_ffinit || help_mode)
+ run("attrmap -remove init", "(only if -discard-ffinit)");
run("synth -run coarse");
}