@@ -1566,6 +1566,8 @@ struct DesignEditRapidSilicon : public ScriptPass {
1566
1566
for (auto conn : cell->connections ()) {
1567
1567
IdString portName = conn.first ;
1568
1568
RTLIL::SigSpec actual = conn.second ;
1569
+ bool unset_port = true ;
1570
+ RTLIL::SigSpec sigspec;
1569
1571
if (actual.is_chunk ()) {
1570
1572
RTLIL::Wire *wire = actual.as_chunk ().wire ;
1571
1573
if (wire != NULL ) {
@@ -1585,19 +1587,6 @@ struct DesignEditRapidSilicon : public ScriptPass {
1585
1587
}
1586
1588
}
1587
1589
}
1588
- } else {
1589
- RTLIL::SigSpec const_sig = actual;
1590
- if (GetSize (const_sig) != 0 )
1591
- {
1592
- RTLIL::SigSig new_conn;
1593
- RTLIL::Wire *new_wire = original_mod->addWire (NEW_ID, GetSize (const_sig));
1594
- cell->unsetPort (portName);
1595
- cell->setPort (portName, new_wire);
1596
- new_conn.first = new_wire;
1597
- new_conn.second = const_sig;
1598
- original_mod->connect (new_conn);
1599
- process_wire (cell, portName, new_wire);
1600
- }
1601
1590
}
1602
1591
} else {
1603
1592
for (auto it = actual.chunks ().rbegin ();
@@ -1623,6 +1612,32 @@ struct DesignEditRapidSilicon : public ScriptPass {
1623
1612
}
1624
1613
}
1625
1614
}
1615
+ for (SigBit bit : conn.second )
1616
+ {
1617
+ // Route constant bits through fabric
1618
+ if (bit.wire == nullptr )
1619
+ {
1620
+ if (unset_port)
1621
+ {
1622
+ cell->unsetPort (portName);
1623
+ unset_port = false ;
1624
+ }
1625
+ RTLIL::SigSig new_conn;
1626
+ RTLIL::Wire *new_wire = original_mod->addWire (NEW_ID, 1 );
1627
+ new_conn.first = new_wire;
1628
+ new_conn.second = bit;
1629
+ original_mod->connect (new_conn);
1630
+ new_outs.insert (new_wire->name .str ());
1631
+ sigspec.append (new_wire);
1632
+ } else {
1633
+ sigspec.append (bit);
1634
+ }
1635
+ }
1636
+
1637
+ if (!unset_port)
1638
+ {
1639
+ cell->setPort (portName, sigspec);
1640
+ }
1626
1641
}
1627
1642
} else {
1628
1643
for (auto conn : cell->connections ()) {
0 commit comments