aboutsummaryrefslogtreecommitdiffstats
path: root/backends/ilang/ilang_backend.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-21 15:15:18 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-21 15:15:18 +0200
commit4147b55c233013dd861172f13d0b9669598d234c (patch)
treee28ea6e5e9a1f73a9890ef4e08ab9d174dd181bc /backends/ilang/ilang_backend.cc
parente035f1d886b30329c1c061894146a5c6f92b4f7a (diff)
downloadyosys-4147b55c233013dd861172f13d0b9669598d234c.tar.gz
yosys-4147b55c233013dd861172f13d0b9669598d234c.tar.bz2
yosys-4147b55c233013dd861172f13d0b9669598d234c.zip
Added "autoidx" statement to ilang file format
Diffstat (limited to 'backends/ilang/ilang_backend.cc')
-rw-r--r--backends/ilang/ilang_backend.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/backends/ilang/ilang_backend.cc b/backends/ilang/ilang_backend.cc
index b3d96b28e..eaad78695 100644
--- a/backends/ilang/ilang_backend.cc
+++ b/backends/ilang/ilang_backend.cc
@@ -335,15 +335,26 @@ void ILANG_BACKEND::dump_module(FILE *f, std::string indent, const RTLIL::Module
void ILANG_BACKEND::dump_design(FILE *f, const RTLIL::Design *design, bool only_selected, bool flag_m, bool flag_n)
{
+ int init_autoidx = RTLIL::autoidx;
+
if (!flag_m) {
int count_selected_mods = 0;
- for (auto it = design->modules.begin(); it != design->modules.end(); it++)
+ for (auto it = design->modules.begin(); it != design->modules.end(); it++) {
+ if (design->selected_whole_module(it->first))
+ flag_m = true;
if (design->selected(it->second))
count_selected_mods++;
+ }
if (count_selected_mods > 1)
flag_m = true;
}
+ if (!only_selected || flag_m) {
+ if (only_selected)
+ fprintf(f, "\n");
+ fprintf(f, "autoidx %d\n", RTLIL::autoidx);
+ }
+
for (auto it = design->modules.begin(); it != design->modules.end(); it++) {
if (!only_selected || design->selected(it->second)) {
if (only_selected)
@@ -351,6 +362,8 @@ void ILANG_BACKEND::dump_design(FILE *f, const RTLIL::Design *design, bool only_
dump_module(f, "", it->second, design, only_selected, flag_m, flag_n);
}
}
+
+ log_assert(init_autoidx == RTLIL::autoidx);
}
struct IlangBackend : public Backend {