diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-04-20 05:10:08 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-14 20:06:54 +0000 |
commit | c658d9d59d98063fec463e17978a3e2f449f38de (patch) | |
tree | 76578d573975fc51051d076b6d2b98f751d3d7c2 | |
parent | f235f212ea242d765e38f4b317390657c1291f77 (diff) | |
download | yosys-c658d9d59d98063fec463e17978a3e2f449f38de.tar.gz yosys-c658d9d59d98063fec463e17978a3e2f449f38de.tar.bz2 yosys-c658d9d59d98063fec463e17978a3e2f449f38de.zip |
Build constant bits directly rather than constructing an object and copying its bits.
-rw-r--r-- | passes/techmap/techmap.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc index ab719cbaa..da53e8448 100644 --- a/passes/techmap/techmap.cc +++ b/passes/techmap/techmap.cc @@ -767,8 +767,11 @@ struct TechmapWorker if (tpl->avail_parameters.count(stringf("\\_TECHMAP_CONNMAP_%s_", log_id(conn.first))) != 0) { RTLIL::Const value; for (auto &bit : sigmap(conn.second)) { - RTLIL::Const chunk(unique_bit_id.at(bit), bits); - value.bits.insert(value.bits.end(), chunk.bits.begin(), chunk.bits.end()); + int val = unique_bit_id.at(bit); + for (int i = 0; i < bits; i++) { + value.bits.push_back((val & 1) != 0 ? State::S1 : State::S0); + val = val >> 1; + } } parameters[stringf("\\_TECHMAP_CONNMAP_%s_", log_id(conn.first))] = value; } |