aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/common/synth.cc
diff options
context:
space:
mode:
authorAndrew Zonenberg <azonenberg@drawersteak.com>2016-04-24 22:11:56 -0700
committerAndrew Zonenberg <azonenberg@drawersteak.com>2016-04-24 22:11:56 -0700
commitd57c85111f4136e5ae098aa42cd337f82dd4b57e (patch)
treea63703d5fabc07ec6db777d56bb388b2ac3c99a7 /techlibs/common/synth.cc
parent349d7172023e9ee38b8e25e3bd04e2dfd0af1e62 (diff)
parentb1d6f05fa2156017f50383d01d49342c8ec5e209 (diff)
downloadyosys-d57c85111f4136e5ae098aa42cd337f82dd4b57e.tar.gz
yosys-d57c85111f4136e5ae098aa42cd337f82dd4b57e.tar.bz2
yosys-d57c85111f4136e5ae098aa42cd337f82dd4b57e.zip
Merge https://github.com/cliffordwolf/yosys
Diffstat (limited to 'techlibs/common/synth.cc')
-rw-r--r--techlibs/common/synth.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/techlibs/common/synth.cc b/techlibs/common/synth.cc
index acfe888d9..859a6606f 100644
--- a/techlibs/common/synth.cc
+++ b/techlibs/common/synth.cc
@@ -41,6 +41,10 @@ struct SynthPass : public ScriptPass
log(" -top <module>\n");
log(" use the specified module as top module (default='top')\n");
log("\n");
+ log(" -flatten\n");
+ log(" flatten the design before synthesis. this will pass '-auto-top' to\n");
+ log(" 'hierarchy' if no top module is specified.\n");
+ log("\n");
log(" -encfile <file>\n");
log(" passed to 'fsm_recode' via 'fsm'\n");
log("\n");
@@ -68,8 +72,8 @@ struct SynthPass : public ScriptPass
log("\n");
}
- std::string top_module, fsm_opts, memory_opts;
- bool noalumacc, nofsm, noabc;
+ string top_module, fsm_opts, memory_opts;
+ bool flatten, noalumacc, nofsm, noabc;
virtual void clear_flags() YS_OVERRIDE
{
@@ -77,6 +81,7 @@ struct SynthPass : public ScriptPass
fsm_opts.clear();
memory_opts.clear();
+ flatten = false;
noalumacc = false;
nofsm = false;
noabc = false;
@@ -109,6 +114,10 @@ struct SynthPass : public ScriptPass
}
continue;
}
+ if (args[argidx] == "-flatten") {
+ flatten = true;
+ continue;
+ }
if (args[argidx] == "-nofsm") {
nofsm = true;
continue;
@@ -147,9 +156,12 @@ struct SynthPass : public ScriptPass
if (help_mode) {
run("hierarchy -check [-top <top>]");
} else {
- if (top_module.empty())
- run(stringf("hierarchy -check"));
- else
+ if (top_module.empty()) {
+ if (flatten)
+ run("hierarchy -check -auto-top");
+ else
+ run("hierarchy -check");
+ } else
run(stringf("hierarchy -check -top %s", top_module.c_str()));
}
}
@@ -157,6 +169,8 @@ struct SynthPass : public ScriptPass
if (check_label("coarse"))
{
run("proc");
+ if (help_mode || flatten)
+ run("flatten", "(if -flatten)");
run("opt_expr");
run("opt_clean");
run("check");