Skip to content

Commit

Permalink
ecp5: Improve packer robustness to FF dangling M input
Browse files Browse the repository at this point in the history
Signed-off-by: gatecat <gatecat@ds0.me>
  • Loading branch information
gatecat committed Sep 2, 2023
1 parent a9a9251 commit 79c6840
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ecp5/pack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ class Ecp5Packer
CellInfo *ci = cell.second.get();
if (is_ff(ctx, ci)) {
NetInfo *di = ci->getPort(id_DI);
NetInfo *m = ci->getPort(id_M);
if (ci->ports.count(id_M) && (!m || !m->driver.cell)) {
// M input is floating. Remove it, so renamePort doesn't hit trouble
ci->disconnectPort(id_M);
ci->ports.erase(id_M);
}
if (di->driver.cell != nullptr && di->driver.cell->type == id_TRELLIS_COMB && di->driver.port == id_F) {
CellInfo *comb = di->driver.cell;
if (comb->cluster != ClusterId()) {
Expand Down

0 comments on commit 79c6840

Please sign in to comment.