aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/common/synth.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-07-11 11:40:55 +0200
committerClifford Wolf <clifford@clifford.at>2016-07-11 11:40:55 +0200
commitcdb58f68ab180deea6d13caa131aa0ea62cb2a8a (patch)
tree516f9c19a3eab3d67b1ff5a42e785bb28739f125 /techlibs/common/synth.cc
parenta72fb85dc2195a4519a8f360bd5f0846ef8d26a4 (diff)
downloadyosys-cdb58f68ab180deea6d13caa131aa0ea62cb2a8a.tar.gz
yosys-cdb58f68ab180deea6d13caa131aa0ea62cb2a8a.tar.bz2
yosys-cdb58f68ab180deea6d13caa131aa0ea62cb2a8a.zip
Added "prep -auto-top" and "synth -auto-top"
Diffstat (limited to 'techlibs/common/synth.cc')
-rw-r--r--techlibs/common/synth.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/techlibs/common/synth.cc b/techlibs/common/synth.cc
index 859a6606f..11ebe5339 100644
--- a/techlibs/common/synth.cc
+++ b/techlibs/common/synth.cc
@@ -41,6 +41,9 @@ struct SynthPass : public ScriptPass
log(" -top <module>\n");
log(" use the specified module as top module (default='top')\n");
log("\n");
+ log(" -auto-top\n");
+ log(" automatically determine the top of the design hierarchy\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");
@@ -73,7 +76,7 @@ struct SynthPass : public ScriptPass
}
string top_module, fsm_opts, memory_opts;
- bool flatten, noalumacc, nofsm, noabc;
+ bool autotop, flatten, noalumacc, nofsm, noabc;
virtual void clear_flags() YS_OVERRIDE
{
@@ -81,6 +84,7 @@ struct SynthPass : public ScriptPass
fsm_opts.clear();
memory_opts.clear();
+ autotop = false;
flatten = false;
noalumacc = false;
nofsm = false;
@@ -114,6 +118,10 @@ struct SynthPass : public ScriptPass
}
continue;
}
+ if (args[argidx] == "-auto-top") {
+ autotop = true;
+ continue;
+ }
if (args[argidx] == "-flatten") {
flatten = true;
continue;
@@ -154,10 +162,10 @@ struct SynthPass : public ScriptPass
if (check_label("begin"))
{
if (help_mode) {
- run("hierarchy -check [-top <top>]");
+ run("hierarchy -check [-top <top> | -auto-top]");
} else {
if (top_module.empty()) {
- if (flatten)
+ if (flatten || autotop)
run("hierarchy -check -auto-top");
else
run("hierarchy -check");