diff options
author | whitequark <whitequark@whitequark.org> | 2020-06-08 19:18:11 +0000 |
---|---|---|
committer | whitequark <whitequark@whitequark.org> | 2020-06-08 20:19:41 +0000 |
commit | 8d821dbbdb3ba68d4cd0fdb0d5857e77725275b9 (patch) | |
tree | 243d9a0362caaa56a08bb2d2e51b8a904da1b55d /passes/techmap | |
parent | e558905598617c901607a93e902d57f9a88f6da0 (diff) | |
download | yosys-8d821dbbdb3ba68d4cd0fdb0d5857e77725275b9.tar.gz yosys-8d821dbbdb3ba68d4cd0fdb0d5857e77725275b9.tar.bz2 yosys-8d821dbbdb3ba68d4cd0fdb0d5857e77725275b9.zip |
flatten: only prepend $flatten once per wire.
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/flatten.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/passes/techmap/flatten.cc b/passes/techmap/flatten.cc index 669159167..e913b3059 100644 --- a/passes/techmap/flatten.cc +++ b/passes/techmap/flatten.cc @@ -32,8 +32,12 @@ IdString concat_name(RTLIL::Cell *cell, IdString object_name) { if (object_name[0] == '\\') return stringf("%s.%s", cell->name.c_str(), object_name.c_str() + 1); - else - return stringf("$flatten%s.%s", cell->name.c_str(), object_name.c_str()); + else { + std::string object_name_str = object_name.str(); + if (object_name_str.substr(0, 8) == "$flatten") + object_name_str.erase(0, 8); + return stringf("$flatten%s.%s", cell->name.c_str(), object_name_str.c_str()); + } } template<class T> |