Build constant bits directly rather than constructing an object and copying its bits.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 20 Apr 2020 05:10:08 +0000 (05:10 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Thu, 14 May 2020 20:06:54 +0000 (20:06 +0000)
passes/techmap/techmap.cc

index ab719cbaab349c823f9cad9e58ff0ed3d2fee6c3..da53e84482ae10fd4b8845bb740515b2e5177f06 100644 (file)
@@ -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;
                                                }