Skip to content

Commit 2542810

Browse files
authored
Merge pull request #814 from os-fpga/bug/EDA-3307/multi_bit_consts
Adding support for multi-bit constants in IO primitives' port connections
2 parents 1a5dc93 + 93e9e16 commit 2542810

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ set(VERSION_MINOR 0)
1717

1818

1919

20-
set(VERSION_PATCH 379)
20+
set(VERSION_PATCH 380)
2121

2222

2323

design_edit/src/rs_design_edit.cc

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,8 @@ struct DesignEditRapidSilicon : public ScriptPass {
15661566
for (auto conn : cell->connections()) {
15671567
IdString portName = conn.first;
15681568
RTLIL::SigSpec actual = conn.second;
1569+
bool unset_port = true;
1570+
RTLIL::SigSpec sigspec;
15691571
if (actual.is_chunk()) {
15701572
RTLIL::Wire *wire = actual.as_chunk().wire;
15711573
if (wire != NULL) {
@@ -1585,19 +1587,6 @@ struct DesignEditRapidSilicon : public ScriptPass {
15851587
}
15861588
}
15871589
}
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-
}
16011590
}
16021591
} else {
16031592
for (auto it = actual.chunks().rbegin();
@@ -1623,6 +1612,32 @@ struct DesignEditRapidSilicon : public ScriptPass {
16231612
}
16241613
}
16251614
}
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+
}
16261641
}
16271642
} else {
16281643
for (auto conn : cell->connections()) {

0 commit comments

Comments
 (0)