Manual fixes for new cell connections API
authorClifford Wolf <clifford@clifford.at>
Sat, 26 Jul 2014 13:57:57 +0000 (15:57 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 26 Jul 2014 13:58:23 +0000 (15:58 +0200)
36 files changed:
backends/btor/btor.cc
backends/verilog/verilog_backend.cc
frontends/ast/genrtlil.cc
frontends/ilang/parser.y
kernel/rtlil.cc
passes/abc/abc.cc
passes/abc/blifparse.cc
passes/cmds/add.cc
passes/cmds/connect.cc
passes/cmds/connwrappers.cc
passes/cmds/scatter.cc
passes/cmds/show.cc
passes/cmds/splice.cc
passes/fsm/fsm_expand.cc
passes/fsm/fsm_extract.cc
passes/fsm/fsm_opt.cc
passes/hierarchy/hierarchy.cc
passes/hierarchy/submod.cc
passes/memory/memory_dff.cc
passes/memory/memory_share.cc
passes/opt/opt_clean.cc
passes/opt/opt_const.cc
passes/opt/opt_reduce.cc
passes/opt/opt_share.cc
passes/proc/proc_dff.cc
passes/proc/proc_mux.cc
passes/sat/expose.cc
passes/sat/freduce.cc
passes/sat/miter.cc
passes/sat/share.cc
passes/techmap/dfflibmap.cc
passes/techmap/extract.cc
passes/techmap/hilomap.cc
passes/techmap/iopadmap.cc
passes/techmap/simplemap.cc
passes/techmap/techmap.cc

index 0316f7ab8aedfd46f90da5c8b7853df44fecf48e..bbfbc0f9041d49b2594aced7753e94683b9b331b 100644 (file)
@@ -193,7 +193,7 @@ struct BtorDumper
                                                break;
                                        log(" -- found cell %s\n", cstr(cell_id));
                                        RTLIL::Cell* cell = module->cells.at(cell_id);
-                                       RTLIL::SigSpec* cell_output = get_cell_output(cell);
+                                       const RTLIL::SigSpec* cell_output = get_cell_output(cell);
                                        int cell_line = dump_cell(cell);                                
 
                                        if(dep_set.size()==1 && wire->width == cell_output->size())
@@ -796,9 +796,9 @@ struct BtorDumper
                }
        }
 
-       RTLIL::SigSpec* get_cell_output(RTLIL::Cell* cell)
+       const RTLIL::SigSpec* get_cell_output(RTLIL::Cell* cell)
        {
-               RTLIL::SigSpec *output_sig = nullptr;
+               const RTLIL::SigSpec *output_sig = nullptr;
                if (cell->type == "$memrd")
                {
                        output_sig = &cell->connections().at(RTLIL::IdString("\\DATA"));
@@ -835,7 +835,7 @@ struct BtorDumper
                for (auto it = module->cells.begin(); it != module->cells.end(); ++it)
                {
                        RTLIL::Cell *cell = it->second;
-                       RTLIL::SigSpec* output_sig = get_cell_output(cell);
+                       const RTLIL::SigSpec* output_sig = get_cell_output(cell);
                        if(output_sig==nullptr)
                                continue;
                        RTLIL::SigSpec s = sigmap(*output_sig);
index aa2f88fa42fdfdae154d4b39505147bb92f10267..6bef90e383bc101759eecfbbbedd4a401984c7d8 100644 (file)
@@ -223,7 +223,7 @@ void dump_sigchunk(FILE *f, const RTLIL::SigChunk &chunk, bool no_decimal = fals
        }
 }
 
-void dump_sigspec(FILE *f, RTLIL::SigSpec &sig)
+void dump_sigspec(FILE *f, const RTLIL::SigSpec &sig)
 {
        if (sig.is_chunk()) {
                dump_sigchunk(f, sig.as_chunk());
@@ -293,10 +293,10 @@ void dump_cell_expr_port(FILE *f, RTLIL::Cell *cell, std::string port, bool gen_
 {
        if (gen_signed && cell->parameters.count("\\" + port + "_SIGNED") > 0 && cell->parameters["\\" + port + "_SIGNED"].as_bool()) {
                fprintf(f, "$signed(");
-               dump_sigspec(f, cell->connections()["\\" + port]);
+               dump_sigspec(f, cell->get("\\" + port));
                fprintf(f, ")");
        } else
-               dump_sigspec(f, cell->connections()["\\" + port]);
+               dump_sigspec(f, cell->get("\\" + port));
 }
 
 std::string cellname(RTLIL::Cell *cell)
@@ -735,7 +735,7 @@ void dump_cell(FILE *f, std::string indent, RTLIL::Cell *cell)
        fprintf(f, "\n%s" ");\n", indent.c_str());
 }
 
-void dump_conn(FILE *f, std::string indent, RTLIL::SigSpec &left, RTLIL::SigSpec &right)
+void dump_conn(FILE *f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
 {
        fprintf(f, "%s" "assign ", indent.c_str());
        dump_sigspec(f, left);
index 861df3fde9008c8ff8877146396c756f67360c04..dba301f462682638b35819e3e0deb70623bf8cca 100644 (file)
@@ -1297,9 +1297,9 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
                                        if (child->str.size() == 0) {
                                                char buf[100];
                                                snprintf(buf, 100, "$%d", ++port_counter);
-                                               cell->connections()[buf] = sig;
+                                               cell->set(buf, sig);
                                        } else {
-                                               cell->connections()[child->str] = sig;
+                                               cell->set(child->str, sig);
                                        }
                                        continue;
                                }
index a7ce4bc7a01e6a1b21e8d2005f7b8138e709db59..952dd6a3a3c4d45454169928861fd9cdc78a26a7 100644 (file)
@@ -204,7 +204,7 @@ cell_body:
        cell_body TOK_CONNECT TOK_ID sigspec EOL {
                if (current_cell->connections().count($3) != 0)
                        rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of cell port %s.", $3).c_str());
-               current_cell->connections()[$3] = *$4;
+               current_cell->set($3, *$4);
                delete $4;
                free($3);
        } |
index 9781fa32b6baa8b59f7547d99b19ecb1d8b73662..ceb2b0f52c179339f67237b70e057ccb458b4bb9 100644 (file)
@@ -773,7 +773,7 @@ void RTLIL::Module::optimize()
 void RTLIL::Module::cloneInto(RTLIL::Module *new_mod) const
 {
        new_mod->name = name;
-       new_mod->connections() = connections_;
+       new_mod->connections_ = connections_;
        new_mod->attributes = attributes;
 
        for (auto &it : wires)
@@ -924,7 +924,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, RTLIL::IdString type)
 RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, const RTLIL::Cell *other)
 {
        RTLIL::Cell *cell = addCell(name, other->type);
-       cell->connections() = other->connections();
+       cell->connections_ = other->connections_;
        cell->parameters = other->parameters;
        cell->attributes = other->attributes;
        return cell;
@@ -1036,8 +1036,8 @@ DEF_METHOD(SafePmux, "$safe_pmux",  1)
                RTLIL::Cell *cell = new RTLIL::Cell;        \
                cell->name = name;                          \
                cell->type = _type;                         \
-               cell->connections()["\\" #_P1] = sig1;        \
-               cell->connections()["\\" #_P2] = sig2;        \
+               cell->set("\\" #_P1, sig1);                 \
+               cell->set("\\" #_P2, sig2);                 \
                add(cell);                                  \
                return cell;                                \
        } \
@@ -1051,9 +1051,9 @@ DEF_METHOD(SafePmux, "$safe_pmux",  1)
                RTLIL::Cell *cell = new RTLIL::Cell;        \
                cell->name = name;                          \
                cell->type = _type;                         \
-               cell->connections()["\\" #_P1] = sig1;        \
-               cell->connections()["\\" #_P2] = sig2;        \
-               cell->connections()["\\" #_P3] = sig3;        \
+               cell->set("\\" #_P1, sig1);                 \
+               cell->set("\\" #_P2, sig2);                 \
+               cell->set("\\" #_P3, sig3);                 \
                add(cell);                                  \
                return cell;                                \
        } \
@@ -1067,10 +1067,10 @@ DEF_METHOD(SafePmux, "$safe_pmux",  1)
                RTLIL::Cell *cell = new RTLIL::Cell;        \
                cell->name = name;                          \
                cell->type = _type;                         \
-               cell->connections()["\\" #_P1] = sig1;        \
-               cell->connections()["\\" #_P2] = sig2;        \
-               cell->connections()["\\" #_P3] = sig3;        \
-               cell->connections()["\\" #_P4] = sig4;        \
+               cell->set("\\" #_P1, sig1);                 \
+               cell->set("\\" #_P2, sig2);                 \
+               cell->set("\\" #_P3, sig3);                 \
+               cell->set("\\" #_P4, sig4);                 \
                add(cell);                                  \
                return cell;                                \
        } \
index c53c44503cda61fecb5414556a74d7bb4f23b0c0..4d9a6c136c3b46638c005d5b3f3963ed2b7c0e34 100644 (file)
@@ -785,7 +785,7 @@ static void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std
                                                assert(c.width == 1);
                                                newsig.append(module->wires[remap_name(c.wire->name)]);
                                        }
-                                       cell->connections()[conn.first] = newsig;
+                                       cell->set(conn.first, newsig);
                                }
                                design->select(module, cell);
                        }
index e5bfb98b481d95ddbc12172eff0decb401fd6390..45a9ac76596c1daece8813c89568ba2b98cbfb80 100644 (file)
@@ -148,7 +148,7 @@ RTLIL::Design *abc_parse_blif(FILE *f, std::string dff_name)
                                        *(q++) = 0;
                                        if (module->wires.count(RTLIL::escape_id(q)) == 0)
                                                module->addWire(RTLIL::escape_id(q));
-                                       cell->connections()[RTLIL::escape_id(p)] = module->wires.at(RTLIL::escape_id(q));
+                                       cell->set(RTLIL::escape_id(p), module->wires.at(RTLIL::escape_id(q)));
                                }
                                continue;
                        }
index 9004bf75bc6273dbb9fceaf1bb1a419f8bd409a5..1401193fd4ccc6c2ad3a918f55a85437b059559e 100644 (file)
@@ -78,7 +78,7 @@ static void add_wire(RTLIL::Design *design, RTLIL::Module *module, std::string n
                if (it.second->connections().count(name) > 0)
                        continue;
 
-               it.second->connections()[name] = wire;
+               it.second->set(name, wire);
                log("Added connection %s to cell %s.%s (%s).\n", name.c_str(), module->name.c_str(), it.first.c_str(), it.second->type.c_str());
        }
 }
index ffe7a5efac7d63de0873989e6b4fc9fcf5faf748..99a28d4a0b25fa8a5575c660280d39daa3a57b28 100644 (file)
@@ -30,11 +30,11 @@ static void unset_drivers(RTLIL::Design *design, RTLIL::Module *module, SigMap &
        RTLIL::Wire *dummy_wire = module->addWire(NEW_ID, sig.size());
 
        for (auto &it : module->cells)
-       for (auto &port : it.second->connections())
+       for (auto &port : it.second->connections_)
                if (ct.cell_output(it.second->type, port.first))
                        sigmap(port.second).replace(sig, dummy_wire, &port.second);
 
-       for (auto &conn : module->connections())
+       for (auto &conn : module->connections_)
                sigmap(conn.first).replace(sig, dummy_wire, &conn.first);
 }
 
@@ -176,7 +176,7 @@ struct ConnectPass : public Pass {
                        if (!RTLIL::SigSpec::parse_sel(sig, design, module, port_expr))
                                log_cmd_error("Failed to parse port expression `%s'.\n", port_expr.c_str());
 
-                       module->cells.at(RTLIL::escape_id(port_cell))->connections()[RTLIL::escape_id(port_port)] = sigmap(sig);
+                       module->cells.at(RTLIL::escape_id(port_cell))->set(RTLIL::escape_id(port_port), sigmap(sig));
                }
                else
                        log_cmd_error("Expected -set, -unset, or -port.\n");
index d7560ab1abc9ba141d4af4a0e5de54193c005f3b..9faeffafac09282ded8d5cd9c92e494784f4c07f 100644 (file)
@@ -109,7 +109,7 @@ struct ConnwrappersWorker
                        if (!design->selected(module, cell))
                                continue;
 
-                       for (auto &conn : cell->connections())
+                       for (auto &conn : cell->connections_)
                        {
                                std::vector<RTLIL::SigBit> sigbits = sigmap(conn.second).to_sigbit_vector();
                                RTLIL::SigSpec old_sig;
index 1a780466accd9cd09e12c24ddd11e60d183e9ad5..35ce0a1107bcde1724d75dbd3117d210a9cefaac 100644 (file)
@@ -49,7 +49,7 @@ struct ScatterPass : public Pass {
                                continue;
 
                        for (auto &c : mod_it.second->cells)
-                       for (auto &p : c.second->connections())
+                       for (auto &p : c.second->connections_)
                        {
                                RTLIL::Wire *wire = new RTLIL::Wire;
                                wire->name = NEW_ID;
index 441268ee97ef9e96a8fc06d2ebb97cef7a8be22c..d63d989722442bb8544c66375f0a517ed22acb70 100644 (file)
@@ -87,17 +87,17 @@ struct ShowWorker
                return defaultColor;
        }
 
-       std::string nextColor(RTLIL::SigSig &conn, std::string defaultColor)
+       std::string nextColor(const RTLIL::SigSig &conn, std::string defaultColor)
        {
                return nextColor(conn.first, nextColor(conn.second, defaultColor));
        }
 
-       std::string nextColor(RTLIL::SigSpec &sig)
+       std::string nextColor(const RTLIL::SigSpec &sig)
        {
                return nextColor(sig, nextColor());
        }
 
-       std::string nextColor(RTLIL::SigSig &conn)
+       std::string nextColor(const RTLIL::SigSig &conn)
        {
                return nextColor(conn, nextColor());
        }
index 94f8365bc4e159db8ae6ee700d9f0ae0beaf8fa4..8b7e04062f8ec2f7f869a5e9c1ad41e40f05a4dc 100644 (file)
@@ -182,7 +182,7 @@ struct SpliceWorker
                for (auto &it : module->cells) {
                        if (!sel_by_wire && !design->selected(module, it.second))
                                continue;
-                       for (auto &conn : it.second->connections())
+                       for (auto &conn : it.second->connections_)
                                if (ct.cell_input(it.second->type, conn.first)) {
                                        if (ports.size() > 0 && !ports.count(conn.first))
                                                continue;
index 126c4866a9bb1ad3bf1a6c4bfb32829bb57efe04..ed80d7c31550fb3342571d3aafa6b94fbf3088cd 100644 (file)
@@ -167,10 +167,14 @@ struct FsmExpand
                fsm_data.copy_from_cell(fsm_cell);
 
                fsm_data.num_inputs += input_sig.size();
-               fsm_cell->get("\\CTRL_IN").append(input_sig);
+               RTLIL::SigSpec new_ctrl_in = fsm_cell->get("\\CTRL_IN");
+               new_ctrl_in.append(input_sig);
+               fsm_cell->set("\\CTRL_IN", new_ctrl_in);
 
                fsm_data.num_outputs += output_sig.size();
-               fsm_cell->get("\\CTRL_OUT").append(output_sig);
+               RTLIL::SigSpec new_ctrl_out = fsm_cell->get("\\CTRL_OUT");
+               new_ctrl_out.append(output_sig);
+               fsm_cell->set("\\CTRL_OUT", new_ctrl_out);
 
                std::vector<FsmData::transition_t> new_transition_table;
                for (auto &tr : fsm_data.transition_table) {
index 3ded8aca71c0b9f47ca3e51c338fb85d6cf40bc1..e89bba89326010571a1321c32ac4732505181d51 100644 (file)
@@ -294,13 +294,13 @@ static void extract_fsm(RTLIL::Wire *wire)
        sig2driver.find(ctrl_out, cellport_list);
        for (auto &cellport : cellport_list) {
                RTLIL::Cell *cell = module->cells.at(cellport.first);
-               RTLIL::SigSpec port_sig = assign_map(cell->connections()[cellport.second]);
+               RTLIL::SigSpec port_sig = assign_map(cell->get(cellport.second));
                RTLIL::SigSpec unconn_sig = port_sig.extract(ctrl_out);
                RTLIL::Wire *unconn_wire = new RTLIL::Wire;
                unconn_wire->name = stringf("$fsm_unconnect$%s$%d", log_signal(unconn_sig), RTLIL::autoidx++);
                unconn_wire->width = unconn_sig.size();
                module->wires[unconn_wire->name] = unconn_wire;
-               port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections()[cellport.second]);
+               port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections_[cellport.second]);
        }
 }
 
index e82b53631982b2cbeda02c206d5fa95a838290c5..1441378a0b6ef3a86d0f6472335523aec463bdeb 100644 (file)
@@ -79,7 +79,9 @@ struct FsmOpt
                                        tmp.remove(i, 1);
                                        tr.ctrl_in = tmp.as_const();
                                }
-                               cell->get("\\CTRL_IN").remove(i, 1);
+                               RTLIL::SigSpec new_ctrl_in = cell->get("\\CTRL_IN");
+                               new_ctrl_in.remove(i, 1);
+                               cell->set("\\CTRL_IN", new_ctrl_in);
                                fsm_data.num_inputs--;
                        }
                }
@@ -94,7 +96,9 @@ struct FsmOpt
                        RTLIL::SigSpec sig = cell->get("\\CTRL_OUT").extract(i, 1);
                        if (signal_is_unused(sig)) {
                                log("  Removing unused output signal %s.\n", log_signal(sig));
-                               cell->get("\\CTRL_OUT").remove(i, 1);
+                               RTLIL::SigSpec new_ctrl_out = cell->get("\\CTRL_OUT");
+                               new_ctrl_out.remove(i, 1);
+                               cell->set("\\CTRL_OUT", new_ctrl_out);
                                for (auto &tr : fsm_data.transition_table) {
                                        RTLIL::SigSpec tmp(tr.ctrl_out);
                                        tmp.remove(i, 1);
@@ -108,7 +112,7 @@ struct FsmOpt
 
        void opt_alias_inputs()
        {
-               RTLIL::SigSpec &ctrl_in = cell->get("\\CTRL_IN");
+               RTLIL::SigSpec &ctrl_in = cell->connections_["\\CTRL_IN"];
 
                for (int i = 0; i < ctrl_in.size(); i++)
                for (int j = i+1; j < ctrl_in.size(); j++)
@@ -145,8 +149,8 @@ struct FsmOpt
 
        void opt_feedback_inputs()
        {
-               RTLIL::SigSpec &ctrl_in = cell->get("\\CTRL_IN");
-               RTLIL::SigSpec &ctrl_out = cell->get("\\CTRL_OUT");
+               RTLIL::SigSpec &ctrl_in = cell->connections_["\\CTRL_IN"];
+               RTLIL::SigSpec &ctrl_out = cell->connections_["\\CTRL_OUT"];
 
                for (int j = 0; j < ctrl_out.size(); j++)
                for (int i = 0; i < ctrl_in.size(); i++)
index 5937373fa55d4d6ac20cd2ae683c78f01be4e8df..76b667b86a4d88c6920d4c8a573fa247f3bd402c 100644 (file)
@@ -219,7 +219,7 @@ static bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool fla
 
                RTLIL::Module *mod = design->modules[cell->type];
 
-               for (auto &conn : cell->connections()) {
+               for (auto &conn : cell->connections_) {
                        int conn_size = conn.second.size();
                        std::string portname = conn.first;
                        if (portname.substr(0, 1) == "$") {
@@ -519,7 +519,7 @@ struct HierarchyPass : public Pass {
                                                        new_connections[pos_map.at(key)] = conn.second;
                                        } else
                                                new_connections[conn.first] = conn.second;
-                               cell->connections() = new_connections;
+                               cell->connections_ = new_connections;
                        }
                }
 
index d72ebb12787edc95d2f3994168a35b2356702592..ef4a9f16d5249690c0a22ce5a6072dec3132f64e 100644 (file)
@@ -65,7 +65,7 @@ struct SubmodWorker
                flag_found_something = true;
        }
 
-       void flag_signal(RTLIL::SigSpec &sig, bool create, bool set_int_driven, bool set_int_used, bool set_ext_driven, bool set_ext_used)
+       void flag_signal(const RTLIL::SigSpec &sig, bool create, bool set_int_driven, bool set_int_used, bool set_ext_driven, bool set_ext_used)
        {
                for (auto &c : sig.chunks())
                        if (c.wire != NULL)
@@ -163,7 +163,7 @@ struct SubmodWorker
 
                for (RTLIL::Cell *cell : submod.cells) {
                        RTLIL::Cell *new_cell = new_mod->addCell(cell->name, cell);
-                       for (auto &conn : new_cell->connections())
+                       for (auto &conn : new_cell->connections_)
                                for (auto &bit : conn.second)
                                        if (bit.wire != NULL) {
                                                assert(wire_flags.count(bit.wire) > 0);
@@ -180,7 +180,7 @@ struct SubmodWorker
                        RTLIL::Wire *old_wire = it.first;
                        RTLIL::Wire *new_wire = it.second.new_wire;
                        if (new_wire->port_id > 0)
-                               new_cell->connections()[new_wire->name] = RTLIL::SigSpec(old_wire);
+                               new_cell->set(new_wire->name, RTLIL::SigSpec(old_wire));
                }
        }
 
index 0513aa3d28efcad5bbe9440074b42929fbcb43d7..999c969b52737c257281e0fb65575acd85337a9d 100644 (file)
@@ -52,10 +52,10 @@ static bool find_sig_before_dff(RTLIL::Module *module, RTLIL::SigSpec &sig, RTLI
                                        continue;
                        }
 
-                       RTLIL::SigSpec q_norm = cell->connections()[after ? "\\D" : "\\Q"];
+                       RTLIL::SigSpec q_norm = cell->get(after ? "\\D" : "\\Q");
                        normalize_sig(module, q_norm);
 
-                       RTLIL::SigSpec d = q_norm.extract(bit, &cell->connections()[after ? "\\Q" : "\\D"]);
+                       RTLIL::SigSpec d = q_norm.extract(bit, &cell->get(after ? "\\Q" : "\\D"));
                        if (d.size() != 1)
                                continue;
 
@@ -127,8 +127,11 @@ static void disconnect_dff(RTLIL::Module *module, RTLIL::SigSpec sig)
 
        for (auto &cell_it : module->cells) {
                RTLIL::Cell *cell = cell_it.second;
-               if (cell->type == "$dff")
-                       cell->get("\\Q").replace(sig, newsig);
+               if (cell->type == "$dff") {
+                       RTLIL::SigSpec new_q = cell->get("\\Q");
+                       new_q.replace(sig, newsig);
+                       cell->set("\\Q", new_q);
+               }
        }
 }
 
index 8b4eb0d0e2637f2e926205243c1568861069a5bb..df1a2697a1ee03ca1873c98e66e9941023e71e09 100644 (file)
@@ -72,8 +72,11 @@ struct MemoryShareWorker
 
                for (int i = 0; i < int(sig_s.size()); i++)
                        if (state.count(sig_s[i]) && state.at(sig_s[i]) == true) {
-                               if (find_data_feedback(async_rd_bits, sig_b.at(bit_idx + i*sig_y.size()), state, conditions))
-                                       cell->get("\\B").replace(bit_idx + i*sig_y.size(), RTLIL::State::Sx);
+                               if (find_data_feedback(async_rd_bits, sig_b.at(bit_idx + i*sig_y.size()), state, conditions)) {
+                                       RTLIL::SigSpec new_b = cell->get("\\B");
+                                       new_b.replace(bit_idx + i*sig_y.size(), RTLIL::State::Sx);
+                                       cell->set("\\B", new_b);
+                               }
                                return false;
                        }
                                
@@ -86,16 +89,22 @@ struct MemoryShareWorker
                        std::map<RTLIL::SigBit, bool> new_state = state;
                        new_state[sig_s[i]] = true;
 
-                       if (find_data_feedback(async_rd_bits, sig_b.at(bit_idx + i*sig_y.size()), new_state, conditions))
-                               cell->get("\\B").replace(bit_idx + i*sig_y.size(), RTLIL::State::Sx);
+                       if (find_data_feedback(async_rd_bits, sig_b.at(bit_idx + i*sig_y.size()), new_state, conditions)) {
+                               RTLIL::SigSpec new_b = cell->get("\\B");
+                               new_b.replace(bit_idx + i*sig_y.size(), RTLIL::State::Sx);
+                               cell->set("\\B", new_b);
+                       }
                }
 
                std::map<RTLIL::SigBit, bool> new_state = state;
                for (int i = 0; i < int(sig_s.size()); i++)
                        new_state[sig_s[i]] = false;
 
-               if (find_data_feedback(async_rd_bits, sig_a.at(bit_idx), new_state, conditions))
-                       cell->get("\\A").replace(bit_idx, RTLIL::State::Sx);
+               if (find_data_feedback(async_rd_bits, sig_a.at(bit_idx), new_state, conditions)) {
+                       RTLIL::SigSpec new_a = cell->get("\\A");
+                       new_a.replace(bit_idx, RTLIL::State::Sx);
+                       cell->set("\\A", new_a);
+               }
 
                return false;
        }
@@ -239,7 +248,7 @@ struct MemoryShareWorker
 
                        if (created_conditions) {
                                log("    Added enable logic for %d different cases.\n", created_conditions);
-                               cell->get("\\EN") = cell_en;
+                               cell->set("\\EN", cell_en);
                        }
                }
        }
@@ -399,7 +408,7 @@ struct MemoryShareWorker
 
                                // Force this ports addr input to addr directly (skip don't care muxes)
 
-                               cell->get("\\ADDR") = addr;
+                               cell->set("\\ADDR", addr);
 
                                // If any of the ports between `last_i' and `i' write to the same address, this
                                // will have priority over whatever `last_i` wrote. So we need to revisit those
@@ -443,8 +452,8 @@ struct MemoryShareWorker
 
                                // Connect the new EN and DATA signals and remove the old write port.
 
-                               cell->get("\\EN") = merged_en;
-                               cell->get("\\DATA") = merged_data;
+                               cell->set("\\EN", merged_en);
+                               cell->set("\\DATA", merged_data);
 
                                module->remove(wr_ports[last_i]);
                                wr_ports[last_i] = NULL;
@@ -595,8 +604,8 @@ struct MemoryShareWorker
 
                        RTLIL::SigBit this_en_active = module->ReduceOr(NEW_ID, this_en);
 
-                       wr_ports[i]->get("\\ADDR") = module->Mux(NEW_ID, last_addr, this_addr, this_en_active);
-                       wr_ports[i]->get("\\DATA") = module->Mux(NEW_ID, last_data, this_data, this_en_active);
+                       wr_ports[i]->set("\\ADDR", module->Mux(NEW_ID, last_addr, this_addr, this_en_active));
+                       wr_ports[i]->set("\\DATA", module->Mux(NEW_ID, last_data, this_data, this_en_active));
 
                        std::map<std::pair<RTLIL::SigBit, RTLIL::SigBit>, int> groups_en;
                        RTLIL::SigSpec grouped_last_en, grouped_this_en, en;
@@ -614,7 +623,7 @@ struct MemoryShareWorker
                        }
 
                        module->addMux(NEW_ID, grouped_last_en, grouped_this_en, this_en_active, grouped_en);
-                       wr_ports[i]->get("\\EN") = en;
+                       wr_ports[i]->set("\\EN", en);
 
                        module->remove(wr_ports[i-1]);
                        wr_ports[i-1] = NULL;
index fa5d8f189ccf990c563e3d70ce1ff29c477dc22f..e279c02098e58e67882d38a9601bd502f144f150 100644 (file)
@@ -189,13 +189,13 @@ static void rmunused_module_signals(RTLIL::Module *module, bool purge_mode, bool
                }
        }
 
-       module->connections().clear();
+       module->connections_.clear();
 
        SigPool used_signals;
        SigPool used_signals_nodrivers;
        for (auto &it : module->cells) {
                RTLIL::Cell *cell = it.second;
-               for (auto &it2 : cell->connections()) {
+               for (auto &it2 : cell->connections_) {
                        assign_map.apply(it2.second);
                        used_signals.add(it2.second);
                        if (!ct.cell_output(cell->type, it2.first))
index 7f420ec340d7c8951fd61aca3bd35923ffda0baa..e52882316b1883d3a35e5c26513a63c56e154042 100644 (file)
@@ -73,7 +73,7 @@ static void replace_undriven(RTLIL::Design *design, RTLIL::Module *module)
 
 static void replace_cell(RTLIL::Module *module, RTLIL::Cell *cell, std::string info, std::string out_port, RTLIL::SigSpec out_val)
 {
-       RTLIL::SigSpec Y = cell->connections()[out_port];
+       RTLIL::SigSpec Y = cell->get(out_port);
        out_val.extend_u0(Y.size(), false);
 
        log("Replacing %s cell `%s' (%s) in module `%s' with constant driver `%s = %s'.\n",
@@ -240,7 +240,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                        cover("opt.opt_const.fine.$reduce_and");
                                        log("Replacing port A of %s cell `%s' in module `%s' with constant driver: %s -> %s\n",
                                                        cell->type.c_str(), cell->name.c_str(), module->name.c_str(), log_signal(sig_a), log_signal(new_a));
-                                       cell->get("\\A") = sig_a = new_a;
+                                       cell->set("\\A", sig_a = new_a);
                                        cell->parameters.at("\\A_WIDTH") = 1;
                                        OPT_DID_SOMETHING = true;
                                        did_something = true;
@@ -267,7 +267,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                        cover_list("opt.opt_const.fine.A", "$logic_not", "$logic_and", "$logic_or", "$reduce_or", "$reduce_bool", cell->type);
                                        log("Replacing port A of %s cell `%s' in module `%s' with constant driver: %s -> %s\n",
                                                        cell->type.c_str(), cell->name.c_str(), module->name.c_str(), log_signal(sig_a), log_signal(new_a));
-                                       cell->get("\\A") = sig_a = new_a;
+                                       cell->set("\\A", sig_a = new_a);
                                        cell->parameters.at("\\A_WIDTH") = 1;
                                        OPT_DID_SOMETHING = true;
                                        did_something = true;
@@ -294,7 +294,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                        cover_list("opt.opt_const.fine.B", "$logic_and", "$logic_or", cell->type);
                                        log("Replacing port B of %s cell `%s' in module `%s' with constant driver: %s -> %s\n",
                                                        cell->type.c_str(), cell->name.c_str(), module->name.c_str(), log_signal(sig_b), log_signal(new_b));
-                                       cell->get("\\B") = sig_b = new_b;
+                                       cell->set("\\B", sig_b = new_b);
                                        cell->parameters.at("\\B_WIDTH") = 1;
                                        OPT_DID_SOMETHING = true;
                                        did_something = true;
@@ -441,8 +441,8 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                cover("opt.opt_const.mux_to_inv");
                                cell->type = "$_INV_";
                                cell->set("\\A", input.extract(0, 1));
-                               cell->connections().erase("\\B");
-                               cell->connections().erase("\\S");
+                               cell->unset("\\B");
+                               cell->unset("\\S");
                                goto next_cell;
                        }
                        if (input.match("11 ")) ACTION_DO_Y(1);
@@ -510,7 +510,9 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
 
                        if (a.is_fully_const()) {
                                cover_list("opt.opt_const.eqneq.swapconst", "$eq", "$ne", cell->type);
-                               std::swap(cell->get("\\A"), cell->get("\\B"));
+                               RTLIL::SigSpec tmp = cell->get("\\A");
+                               cell->set("\\A", cell->get("\\B"));
+                               cell->set("\\B", tmp);
                        }
 
                        if (b.is_fully_const()) {
@@ -522,7 +524,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                        cell->type = "$not";
                                        cell->parameters.erase("\\B_WIDTH");
                                        cell->parameters.erase("\\B_SIGNED");
-                                       cell->connections().erase("\\B");
+                                       cell->unset("\\B");
                                }
                                goto next_cell;
                        }
@@ -585,13 +587,13 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                        cell->type.c_str(), cell->name.c_str(), module->name.c_str(), identity_wrt_a ? 'A' : 'B');
 
                                if (!identity_wrt_a) {
-                                       cell->get("\\A") = cell->get("\\B");
+                                       cell->set("\\A", cell->get("\\B"));
                                        cell->parameters.at("\\A_WIDTH") = cell->parameters.at("\\B_WIDTH");
                                        cell->parameters.at("\\A_SIGNED") = cell->parameters.at("\\B_SIGNED");
                                }
 
                                cell->type = identity_bu0 ? "$bu0" : "$pos";
-                               cell->connections().erase("\\B");
+                               cell->unset("\\B");
                                cell->parameters.erase("\\B_WIDTH");
                                cell->parameters.erase("\\B_SIGNED");
                                cell->check();
@@ -613,8 +615,8 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                                cell->get("\\A") == RTLIL::SigSpec(1, 1) && cell->get("\\B") == RTLIL::SigSpec(0, 1)) {
                        cover_list("opt.opt_const.mux_invert", "$mux", "$_MUX_", cell->type);
                        cell->set("\\A", cell->get("\\S"));
-                       cell->connections().erase("\\B");
-                       cell->connections().erase("\\S");
+                       cell->unset("\\B");
+                       cell->unset("\\S");
                        if (cell->type == "$mux") {
                                cell->parameters["\\A_WIDTH"] = cell->parameters["\\WIDTH"];
                                cell->parameters["\\Y_WIDTH"] = cell->parameters["\\WIDTH"];
@@ -631,7 +633,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                if (consume_x && mux_bool && (cell->type == "$mux" || cell->type == "$_MUX_") && cell->get("\\A") == RTLIL::SigSpec(0, 1)) {
                        cover_list("opt.opt_const.mux_and", "$mux", "$_MUX_", cell->type);
                        cell->set("\\A", cell->get("\\S"));
-                       cell->connections().erase("\\S");
+                       cell->unset("\\S");
                        if (cell->type == "$mux") {
                                cell->parameters["\\A_WIDTH"] = cell->parameters["\\WIDTH"];
                                cell->parameters["\\B_WIDTH"] = cell->parameters["\\WIDTH"];
@@ -650,7 +652,7 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                if (consume_x && mux_bool && (cell->type == "$mux" || cell->type == "$_MUX_") && cell->get("\\B") == RTLIL::SigSpec(1, 1)) {
                        cover_list("opt.opt_const.mux_or", "$mux", "$_MUX_", cell->type);
                        cell->set("\\B", cell->get("\\S"));
-                       cell->connections().erase("\\S");
+                       cell->unset("\\S");
                        if (cell->type == "$mux") {
                                cell->parameters["\\A_WIDTH"] = cell->parameters["\\WIDTH"];
                                cell->parameters["\\B_WIDTH"] = cell->parameters["\\WIDTH"];
@@ -701,9 +703,9 @@ static void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bo
                        }
                        if (cell->get("\\S").size() != new_s.size()) {
                                cover_list("opt.opt_const.mux_reduce", "$mux", "$pmux", cell->type);
-                               cell->get("\\A") = new_a;
-                               cell->get("\\B") = new_b;
-                               cell->get("\\S") = new_s;
+                               cell->set("\\A", new_a);
+                               cell->set("\\B", new_b);
+                               cell->set("\\S", new_s);
                                if (new_s.size() > 1) {
                                        cell->type = "$pmux";
                                        cell->parameters["\\S_WIDTH"] = new_s.size();
index 8c281b342db35bff9aa9cd3b72f1a1513e0591c6..1f8648c45e07efd20738c646ab8c38b78d29bcc4 100644 (file)
@@ -215,13 +215,19 @@ struct OptReduceWorker
                                        log_signal(cell->get("\\B")), log_signal(cell->get("\\Y")));
 
                        cell->set("\\A", RTLIL::SigSpec());
-                       for (auto &in_tuple : consolidated_in_tuples)
-                               cell->get("\\A").append(in_tuple.at(0));
+                       for (auto &in_tuple : consolidated_in_tuples) {
+                               RTLIL::SigSpec new_a = cell->get("\\A");
+                               new_a.append(in_tuple.at(0));
+                               cell->set("\\A", new_a);
+                       }
 
                        cell->set("\\B", RTLIL::SigSpec());
                        for (int i = 1; i <= cell->get("\\S").size(); i++)
-                               for (auto &in_tuple : consolidated_in_tuples)
-                                       cell->get("\\B").append(in_tuple.at(i));
+                               for (auto &in_tuple : consolidated_in_tuples) {
+                                       RTLIL::SigSpec new_b = cell->get("\\B");
+                                       new_b.append(in_tuple.at(i));
+                                       cell->set("\\B", new_b);
+                               }
 
                        cell->parameters["\\WIDTH"] = RTLIL::Const(new_sig_y.size());
                        cell->set("\\Y", new_sig_y);
index 8412f929fcccd97709c173705093a5e22ad75923..4f733a37369734d1fba12f4a4c4942ebda5071fc 100644 (file)
@@ -263,7 +263,7 @@ struct OptShareWorker
                                        log("  Cell `%s' is identical to cell `%s'.\n", cell->name.c_str(), sharemap[cell]->name.c_str());
                                        for (auto &it : cell->connections()) {
                                                if (ct.cell_output(cell->type, it.first)) {
-                                                       RTLIL::SigSpec other_sig = sharemap[cell]->connections()[it.first];
+                                                       RTLIL::SigSpec other_sig = sharemap[cell]->get(it.first);
                                                        log("    Redirecting output %s: %s = %s\n", it.first.c_str(),
                                                                        log_signal(it.second), log_signal(other_sig));
                                                        module->connect(RTLIL::SigSig(it.second, other_sig));
index 2e2d4701fc87f0adba8336f91664c78d83073782..cfd2eb7a7799aeb2eefd9630dc45d96ab48003c5 100644 (file)
@@ -160,15 +160,15 @@ static void gen_dffsr(RTLIL::Module *mod, RTLIL::SigSpec sig_in, RTLIL::SigSpec
 
        RTLIL::Cell *mux_sr_set = mod->addCell(NEW_ID, "$mux");
        mux_sr_set->parameters["\\WIDTH"] = RTLIL::Const(sig_in.size());
-       mux_sr_set->connections()[set_polarity ? "\\A" : "\\B"] = RTLIL::Const(0, sig_in.size());
-       mux_sr_set->connections()[set_polarity ? "\\B" : "\\A"] = sig_set;
+       mux_sr_set->set(set_polarity ? "\\A" : "\\B", RTLIL::Const(0, sig_in.size()));
+       mux_sr_set->set(set_polarity ? "\\B" : "\\A", sig_set);
        mux_sr_set->set("\\Y", sig_sr_set);
        mux_sr_set->set("\\S", set);
 
        RTLIL::Cell *mux_sr_clr = mod->addCell(NEW_ID, "$mux");
        mux_sr_clr->parameters["\\WIDTH"] = RTLIL::Const(sig_in.size());
-       mux_sr_clr->connections()[set_polarity ? "\\A" : "\\B"] = RTLIL::Const(0, sig_in.size());
-       mux_sr_clr->connections()[set_polarity ? "\\B" : "\\A"] = sig_set_inv;
+       mux_sr_clr->set(set_polarity ? "\\A" : "\\B", RTLIL::Const(0, sig_in.size()));
+       mux_sr_clr->set(set_polarity ? "\\B" : "\\A", sig_set_inv);
        mux_sr_clr->set("\\Y", sig_sr_clr);
        mux_sr_clr->set("\\S", set);
 
index 2ff755aefd7d404c80ee16c122b6a376759528d6..30e7b748ba8aa560a2111f57dd4bdfb58aff9905 100644 (file)
@@ -174,8 +174,15 @@ static void append_pmux(RTLIL::Module *mod, const RTLIL::SigSpec &signal, const
        RTLIL::SigSpec ctrl_sig = gen_cmp(mod, signal, compare, sw);
        assert(ctrl_sig.size() == 1);
        last_mux_cell->type = "$pmux";
-       last_mux_cell->get("\\S").append(ctrl_sig);
-       last_mux_cell->get("\\B").append(when_signal);
+
+       RTLIL::SigSpec new_s = last_mux_cell->get("\\S");
+       new_s.append(ctrl_sig);
+       last_mux_cell->set("\\S", new_s);
+
+       RTLIL::SigSpec new_b = last_mux_cell->get("\\B");
+       new_b.append(when_signal);
+       last_mux_cell->set("\\B", new_b);
+
        last_mux_cell->parameters["\\S_WIDTH"] = last_mux_cell->get("\\S").size();
 }
 
index 58dcf915ff371a8172e96993f7de92fe03686d0c..a84faf792a5e55865f81468ef310af733409f61b 100644 (file)
@@ -485,12 +485,12 @@ struct ExposePass : public Pass {
                                for (auto &it : module->cells) {
                                        if (!ct.cell_known(it.second->type))
                                                continue;
-                                       for (auto &conn : it.second->connections())
+                                       for (auto &conn : it.second->connections_)
                                                if (ct.cell_input(it.second->type, conn.first))
                                                        conn.second = out_to_in_map(sigmap(conn.second));
                                }
 
-                               for (auto &conn : module->connections())
+                               for (auto &conn : module->connections_)
                                        conn.second = out_to_in_map(sigmap(conn.second));
                        }
 
@@ -518,7 +518,7 @@ struct ExposePass : public Pass {
                                        for (auto &bit : cell_q_bits)
                                                if (wire_bits_set.count(bit))
                                                        bit = RTLIL::SigBit(wire_dummy_q, wire_dummy_q->width++);
-                                       cell->get("\\Q") = cell_q_bits;
+                                       cell->set("\\Q", cell_q_bits);
                                }
 
                                RTLIL::Wire *wire_q = new RTLIL::Wire;
index da9345855beb7e85fdb81bdad55cadd320a74a41..d5336ca01d7a0ba021f78bb794f114cff9a1be06 100644 (file)
@@ -708,7 +708,7 @@ struct FreduceWorker
 
                                RTLIL::Cell *drv = drivers.at(grp[i].bit).first;
                                RTLIL::Wire *dummy_wire = module->addWire(NEW_ID);
-                               for (auto &port : drv->connections())
+                               for (auto &port : drv->connections_)
                                        if (ct.cell_output(drv->type, port.first))
                                                sigmap(port.second).replace(grp[i].bit, dummy_wire, &port.second);
 
index 34355122a4cac0239ff7157eccbd55a549e9fa80..96aa10ba3f84ada78376ef3a43aea7d9b0cb67b1 100644 (file)
@@ -132,8 +132,8 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args,
                        w2->width = w1->width;
                        miter_module->add(w2);
 
-                       gold_cell->connections()[w1->name] = w2;
-                       gate_cell->connections()[w1->name] = w2;
+                       gold_cell->set(w1->name, w2);
+                       gate_cell->set(w1->name, w2);
                }
 
                if (w1->port_output)
@@ -150,8 +150,8 @@ static void create_miter_equiv(struct Pass *that, std::vector<std::string> args,
                        w2_gate->width = w1->width;
                        miter_module->add(w2_gate);
 
-                       gold_cell->connections()[w1->name] = w2_gold;
-                       gate_cell->connections()[w1->name] = w2_gate;
+                       gold_cell->set(w1->name, w2_gold);
+                       gate_cell->set(w1->name, w2_gate);
 
                        RTLIL::SigSpec this_condition;
 
index 13ef695e74d99195dd9b419c115c32cf3565f609..0ee5af1863bd2bc275ee59a96ed398bc09cc4470 100644 (file)
@@ -258,7 +258,9 @@ struct ShareWorker
                                RTLIL::Cell *unsigned_cell = c1->parameters.at("\\A_SIGNED").as_bool() ? c2 : c1;
                                if (unsigned_cell->get("\\A").to_sigbit_vector().back() != RTLIL::State::S0) {
                                        unsigned_cell->parameters.at("\\A_WIDTH") = unsigned_cell->parameters.at("\\A_WIDTH").as_int() + 1;
-                                       unsigned_cell->get("\\A").append_bit(RTLIL::State::S0);
+                                       RTLIL::SigSpec new_a = unsigned_cell->get("\\A");
+                                       new_a.append_bit(RTLIL::State::S0);
+                                       unsigned_cell->set("\\A", new_a);
                                }
                                unsigned_cell->parameters.at("\\A_SIGNED") = true;
                                unsigned_cell->check();
@@ -312,7 +314,10 @@ struct ShareWorker
 
                                if (score_flipped < score_unflipped)
                                {
-                                       std::swap(c2->get("\\A"), c2->get("\\B"));
+                                       RTLIL::SigSpec tmp = c2->get("\\A");
+                                       c2->set("\\A", c2->get("\\B"));
+                                       c2->set("\\B", tmp);
+
                                        std::swap(c2->parameters.at("\\A_WIDTH"), c2->parameters.at("\\B_WIDTH"));
                                        std::swap(c2->parameters.at("\\A_SIGNED"), c2->parameters.at("\\B_SIGNED"));
                                        modified_src_cells = true;
@@ -325,7 +330,9 @@ struct ShareWorker
                                RTLIL::Cell *unsigned_cell = c1->parameters.at("\\A_SIGNED").as_bool() ? c2 : c1;
                                if (unsigned_cell->get("\\A").to_sigbit_vector().back() != RTLIL::State::S0) {
                                        unsigned_cell->parameters.at("\\A_WIDTH") = unsigned_cell->parameters.at("\\A_WIDTH").as_int() + 1;
-                                       unsigned_cell->get("\\A").append_bit(RTLIL::State::S0);
+                                       RTLIL::SigSpec new_a = unsigned_cell->get("\\A");
+                                       new_a.append_bit(RTLIL::State::S0);
+                                       unsigned_cell->set("\\A", new_a);
                                }
                                unsigned_cell->parameters.at("\\A_SIGNED") = true;
                                modified_src_cells = true;
@@ -336,7 +343,9 @@ struct ShareWorker
                                RTLIL::Cell *unsigned_cell = c1->parameters.at("\\B_SIGNED").as_bool() ? c2 : c1;
                                if (unsigned_cell->get("\\B").to_sigbit_vector().back() != RTLIL::State::S0) {
                                        unsigned_cell->parameters.at("\\B_WIDTH") = unsigned_cell->parameters.at("\\B_WIDTH").as_int() + 1;
-                                       unsigned_cell->get("\\B").append_bit(RTLIL::State::S0);
+                                       RTLIL::SigSpec new_b = unsigned_cell->get("\\B");
+                                       new_b.append_bit(RTLIL::State::S0);
+                                       unsigned_cell->set("\\B", new_b);
                                }
                                unsigned_cell->parameters.at("\\B_SIGNED") = true;
                                modified_src_cells = true;
index 1dce39f69fdce70cb417d47d3e88032d0be54dca..eabc56bd2102f4977d451cfd1c2c556e00d1991c 100644 (file)
@@ -418,7 +418,7 @@ static void dfflibmap(RTLIL::Design *design, RTLIL::Module *module)
                        } else
                        if (port.second != 0)
                                log_abort();
-                       new_cell->connections()["\\" + port.first] = sig;
+                       new_cell->set("\\" + port.first, sig);
                }
 
                stats[stringf("  mapped %%d %s cells to %s cells.\n", cell_type.c_str(), new_cell->type.c_str())]++;
index 0d8f6ab0d2ace9b75577ba3ddae225b97a34fc3b..6439302cd34f242d5939f147a4142a843c521b0e 100644 (file)
@@ -305,7 +305,7 @@ namespace
                        if (wire->port_id > 0) {
                                for (int i = 0; i < wire->width; i++)
                                        sig2port.insert(sigmap(RTLIL::SigSpec(wire, i)), std::pair<std::string, int>(wire->name, i));
-                               cell->connections()[wire->name] = RTLIL::SigSpec(RTLIL::State::Sz, wire->width);
+                               cell->set(wire->name, RTLIL::SigSpec(RTLIL::State::Sz, wire->width));
                        }
                }
 
@@ -325,7 +325,9 @@ namespace
                                        for (int i = 0; i < sig.size(); i++)
                                        for (auto &port : sig2port.find(sig[i])) {
                                                RTLIL::SigSpec bitsig = haystack_cell->connections().at(mapping.portMapping[conn.first]).extract(i, 1);
-                                               cell->connections().at(port.first).replace(port.second, bitsig);
+                                               RTLIL::SigSpec new_sig = cell->get(port.first);
+                                               new_sig.replace(port.second, bitsig);
+                                               cell->set(port.first, new_sig);
                                        }
                                }
                        }
@@ -744,7 +746,7 @@ struct ExtractPass : public Pass {
                                                for (auto &chunk : chunks)
                                                        if (chunk.wire != NULL)
                                                                chunk.wire = newMod->wires.at(chunk.wire->name);
-                                               newCell->connections()[conn.first] = chunks;
+                                               newCell->set(conn.first, chunks);
                                        }
                                }
                        }
index 2e5dd7dca916dbc1c215931f7e78a41bdf574da6..3097778760ec9054d60b8da5cdf43593cd76b4b6 100644 (file)
@@ -35,7 +35,7 @@ void hilomap_worker(RTLIL::SigSpec &sig)
                        if (!singleton_mode || last_hi == RTLIL::State::Sm) {
                                last_hi = module->addWire(NEW_ID);
                                RTLIL::Cell *cell = module->addCell(NEW_ID, RTLIL::escape_id(hicell_celltype));
-                               cell->connections()[RTLIL::escape_id(hicell_portname)] = last_hi;
+                               cell->set(RTLIL::escape_id(hicell_portname), last_hi);
                        }
                        bit = last_hi;
                }
@@ -43,7 +43,7 @@ void hilomap_worker(RTLIL::SigSpec &sig)
                        if (!singleton_mode || last_lo == RTLIL::State::Sm) {
                                last_lo = module->addWire(NEW_ID);
                                RTLIL::Cell *cell = module->addCell(NEW_ID, RTLIL::escape_id(locell_celltype));
-                               cell->connections()[RTLIL::escape_id(locell_portname)] = last_lo;
+                               cell->set(RTLIL::escape_id(locell_portname), last_lo);
                        }
                        bit = last_lo;
                }
index 199fd602954ec99960c636ccc412e2e98f8c6480..114d28e2568e4532fb662a9f179f23aec59706cf 100644 (file)
@@ -177,9 +177,9 @@ struct IopadmapPass : public Pass {
                                        for (int i = 0; i < wire->width; i++)
                                        {
                                                RTLIL::Cell *cell = module->addCell(NEW_ID, RTLIL::escape_id(celltype));
-                                               cell->connections()[RTLIL::escape_id(portname)] = RTLIL::SigSpec(wire, i);
+                                               cell->set(RTLIL::escape_id(portname), RTLIL::SigSpec(wire, i));
                                                if (!portname2.empty())
-                                                       cell->connections()[RTLIL::escape_id(portname2)] = RTLIL::SigSpec(new_wire, i);
+                                                       cell->set(RTLIL::escape_id(portname2), RTLIL::SigSpec(new_wire, i));
                                                if (!widthparam.empty())
                                                        cell->parameters[RTLIL::escape_id(widthparam)] = RTLIL::Const(1);
                                                if (!nameparam.empty())
@@ -190,9 +190,9 @@ struct IopadmapPass : public Pass {
                                else
                                {
                                        RTLIL::Cell *cell = module->addCell(NEW_ID, RTLIL::escape_id(celltype));
-                                       cell->connections()[RTLIL::escape_id(portname)] = RTLIL::SigSpec(wire);
+                                       cell->set(RTLIL::escape_id(portname), RTLIL::SigSpec(wire));
                                        if (!portname2.empty())
-                                               cell->connections()[RTLIL::escape_id(portname2)] = RTLIL::SigSpec(new_wire);
+                                               cell->set(RTLIL::escape_id(portname2), RTLIL::SigSpec(new_wire));
                                        if (!widthparam.empty())
                                                cell->parameters[RTLIL::escape_id(widthparam)] = RTLIL::Const(wire->width);
                                        if (!nameparam.empty())
index f8851400fb16b33339752dc12ddc2839e939ff3a..355c07c840089f75cc90d981f9c339b9bbcdd678 100644 (file)
@@ -128,7 +128,7 @@ static void simplemap_reduce(RTLIL::Module *module, RTLIL::Cell *cell)
        if (cell->type == "$reduce_bool") gate_type = "$_OR_";
        log_assert(!gate_type.empty());
 
-       RTLIL::SigSpec *last_output = NULL;
+       RTLIL::Cell *last_output_cell = NULL;
 
        while (sig_a.size() > 1)
        {
@@ -145,7 +145,7 @@ static void simplemap_reduce(RTLIL::Module *module, RTLIL::Cell *cell)
                        gate->set("\\A", sig_a[i]);
                        gate->set("\\B", sig_a[i+1]);
                        gate->set("\\Y", sig_t[i/2]);
-                       last_output = &gate->get("\\Y");
+                       last_output_cell = gate;
                }
 
                sig_a = sig_t;
@@ -156,14 +156,14 @@ static void simplemap_reduce(RTLIL::Module *module, RTLIL::Cell *cell)
                RTLIL::Cell *gate = module->addCell(NEW_ID, "$_INV_");
                gate->set("\\A", sig_a);
                gate->set("\\Y", sig_t);
-               last_output = &gate->get("\\Y");
+               last_output_cell = gate;
                sig_a = sig_t;
        }
 
-       if (last_output == NULL) {
+       if (last_output_cell == NULL) {
                module->connect(RTLIL::SigSig(sig_y, sig_a));
        } else {
-               *last_output = sig_y;
+               last_output_cell->set("\\Y", sig_y);
        }
 }
 
index 4c8f925059a5312bab168c6770b0129c1995d5ab..9dcd6a45bd5807065345f63411b0043530b7a272 100644 (file)
@@ -195,7 +195,7 @@ struct TechmapWorker
                        if (!flatten_mode && c->type.substr(0, 2) == "\\$")
                                c->type = c->type.substr(1);
 
-                       for (auto &it2 : c->connections()) {
+                       for (auto &it2 : c->connections_) {
                                apply_prefix(cell->name, it2.second, module);
                                port_signal_map.apply(it2.second);
                        }