From fde681623c6582bc56860af16212d1b14dd9c021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 11 Mar 2025 10:33:00 +0100 Subject: [PATCH] ql_dsp: Improve cascading detection --- techlibs/quicklogic/ql_dsp.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/techlibs/quicklogic/ql_dsp.cc b/techlibs/quicklogic/ql_dsp.cc index e84bd8905..8b53dffcb 100644 --- a/techlibs/quicklogic/ql_dsp.cc +++ b/techlibs/quicklogic/ql_dsp.cc @@ -55,7 +55,11 @@ bool promote(Module *m, Cell *cell) { widen_output(ID(b_cout_o), 18); widen_output(ID(z_cout_o), 50); - if (cell->hasPort(ID(a_cin_i)) || cell->hasPort(ID(b_cin_i)) || cell->hasPort(ID(z_cin_i))) { + auto uses_port = [&](IdString port_name) { + return cell->hasPort(port_name) && !cell->getPort(port_name).is_fully_undef(); + }; + + if (uses_port(ID(a_cin_i)) || uses_port(ID(b_cin_i)) || uses_port(ID(z_cin_i))) { log_error("Cannot promote %s (type %s) with cascading paths\n", log_id(cell), log_id(cell->type)); }