@@ -83,23 +83,16 @@ struct DesignEditRapidSilicon : public ScriptPass {
8383 std::vector<Cell *> remove_prims;
8484 std::vector<Cell *> remove_fab_prims; // TODO : change to unoredred set later
8585 std::vector<Cell *> remove_non_prims;
86- std::vector<Cell *> remove_wrapper_cells;
8786 std::unordered_set<Wire *> wires_interface;
8887 std::unordered_set<Wire *> del_ins;
8988 std::unordered_set<Wire *> del_outs;
90- std::unordered_set<Wire *> del_interface_wires;
91- std::unordered_set<Wire *> del_wrapper_wires;
9289 std::unordered_set<Wire *> del_unused;
9390 std::set<std::pair<Yosys::RTLIL::SigSpec, Yosys::RTLIL::SigSpec>> connections_to_remove;
9491 std::unordered_set<Wire *> orig_intermediate_wires;
95- std::unordered_set<Wire *> interface_intermediate_wires;
96- std::map<Yosys::RTLIL::SigBit, Yosys::RTLIL::SigBit> wrapper_conns;
9792 std::map<RTLIL::SigBit, std::vector<RTLIL::Wire *>> io_prim_conn, intf_prim_conn;
98- std::map<RTLIL::SigBit, RTLIL::SigBit> inout_conn_map;
9993 std::map<Yosys::RTLIL::SigBit, Yosys::RTLIL::SigBit> ifab_sig_map;
10094 std::map<RTLIL::SigBit, std::vector<RTLIL::SigBit>> ofab_sig_map, ofab_conns;
10195 pool<SigBit> prim_out_bits;
102- pool<SigBit> unused_prim_outs;
10396 pool<SigBit> used_bits;
10497 pool<SigBit> orig_ins, orig_outs, fab_outs, fab_ins;
10598
@@ -888,57 +881,6 @@ struct DesignEditRapidSilicon : public ScriptPass {
888881 }
889882 }
890883
891- void handle_inout_connection (Module* mod)
892- {
893- for (auto &conn : mod->connections ())
894- {
895- std::vector<RTLIL::SigBit> conn_lhs = conn.first .to_sigbit_vector ();
896- std::vector<RTLIL::SigBit> conn_rhs = conn.second .to_sigbit_vector ();
897- bool remove_conn = false ;
898- for (size_t i = 0 ; i < conn_lhs.size (); ++i)
899- {
900- if (conn_rhs[i].wire != nullptr )
901- if (conn_rhs[i].wire ->port_input && conn_rhs[i].wire ->port_output )
902- {
903- inout_conn_map[conn_lhs[i]] = conn_rhs[i];
904- remove_conn = true ;
905- }
906- }
907- if (remove_conn)
908- {
909- connections_to_remove.insert (conn);
910- }
911- }
912-
913- remove_extra_conns (mod);
914- connections_to_remove.clear ();
915-
916- for (auto cell : mod->cells ())
917- {
918- for (auto conn : cell->connections ())
919- {
920- IdString portName = conn.first ;
921- bool unset_port = true ;
922- RTLIL::SigSpec sigspec;
923- for (SigBit bit : conn.second )
924- {
925- if (inout_conn_map.count (bit) > 0 )
926- {
927- if (unset_port)
928- {
929- cell->unsetPort (portName);
930- unset_port = false ;
931- }
932- sigspec.append (inout_conn_map[bit]);
933- } else {
934- sigspec.append (bit);
935- }
936- }
937- if (!unset_port) cell->setPort (portName, sigspec);
938- }
939- }
940- }
941-
942884 void process_wire (Cell *cell, const IdString &portName, RTLIL::Wire *wire) {
943885 if (cell->input (portName)) {
944886 if (wire->port_input ) {
@@ -1126,71 +1068,7 @@ struct DesignEditRapidSilicon : public ScriptPass {
11261068 }
11271069 }
11281070
1129- void clean_flattened (Module *mod)
1130- {
1131- for (auto &conn : mod->connections ())
1132- {
1133- std::vector<RTLIL::SigBit> conn_lhs = conn.first .to_sigbit_vector ();
1134- std::vector<RTLIL::SigBit> conn_rhs = conn.second .to_sigbit_vector ();
1135- for (size_t i = 0 ; i < conn_lhs.size (); i++) {
1136- if (conn_lhs[i].wire != nullptr && conn_rhs[i].wire != nullptr )
1137- {
1138- wrapper_conns.insert (std::make_pair (conn_lhs[i], conn_rhs[i]));
1139- } else {
1140- std::cerr << " Unexpected behaviour from flatten pass" << std::endl;
1141- }
1142- }
1143- }
1144-
1145- for (auto cell : mod->cells ()) {
1146- string module_name = cell->type .str ();
1147- bool is_fabric_instance = (module_name.substr (0 , 8 ) == " \\ fabric_" ) ? true : false ;
1148- if (is_fabric_instance) continue ;
1149- for (auto conn : cell->connections ()) {
1150- IdString portName = conn.first ;
1151- bool unset_port = true ;
1152- RTLIL::SigSpec sigspec;
1153- for (SigBit bit : conn.second )
1154- {
1155- if (bit.wire != nullptr )
1156- {
1157- bool appended = false ;
1158- for (auto it = wrapper_conns.begin (); it != wrapper_conns.end (); ++it) {
1159- if (it->second == bit) {
1160- if (unset_port) {
1161- cell->unsetPort (portName);
1162- unset_port = false ;
1163- }
1164- sigspec.append (it->first );
1165- appended = true ;
1166- break ;
1167- } else if (it->first == bit) {
1168- if (unset_port) {
1169- cell->unsetPort (portName);
1170- unset_port = false ;
1171- }
1172- sigspec.append (it->second );
1173- appended = true ;
1174- break ;
1175- }
1176- }
1177- if (!appended) sigspec.append (bit);
1178- }
1179- else {
1180- sigspec.append (bit);
1181- }
1182- }
1183- if (!unset_port)
1184- {
1185- cell->setPort (portName, sigspec);
1186- }
1187- }
1188- }
1189-
1190- mod->connections_ .clear ();
1191- }
1192-
1193- void elapsed_time (time_point<high_resolution_clock> start,
1071+ void elapsed_time (time_point<high_resolution_clock> start,
11941072 time_point<high_resolution_clock> end)
11951073 {
11961074 auto duration = duration_cast<nanoseconds>(end - start);
0 commit comments