From 56587859d3596c4a42d5f28ae51898ee09cea2c1 Mon Sep 17 00:00:00 2001 From: gatecat Date: Mon, 18 Dec 2023 12:18:22 +0000 Subject: [PATCH] nexus: Improve error reporting for illegal carry chains Signed-off-by: gatecat --- nexus/pack.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nexus/pack.cc b/nexus/pack.cc index d5c7147e..dad3722a 100644 --- a/nexus/pack.cc +++ b/nexus/pack.cc @@ -1318,8 +1318,14 @@ struct NexusPacker CellInfo *ci = cell.second.get(); if (ci->type != id_CCU2) continue; - if (ci->getPort(id_CIN) != nullptr) + NetInfo *cin = ci->getPort(id_CIN); + if (cin) { + if (cin->driver.cell && cin->driver.cell->type != id_CCU2) { + log_error("CCU2 '%s' CIN net '%s' driven by non-CCU2 cell '%s'.\n", + ctx->nameOf(ci), ctx->nameOf(cin), ctx->nameOf(cin->driver.cell)); + } continue; + } roots.push_back(ci); } for (CellInfo *root : roots) {