From dce847b2f3ab5257b41c2c12c2146ef400d56135 Mon Sep 17 00:00:00 2001 From: gatecat Date: Fri, 14 May 2021 21:13:43 +0100 Subject: mistral: Trim SDATA if SLOAD is low Signed-off-by: gatecat --- mistral/pack.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mistral') diff --git a/mistral/pack.cc b/mistral/pack.cc index f8c55cd1..e704160c 100644 --- a/mistral/pack.cc +++ b/mistral/pack.cc @@ -167,6 +167,15 @@ struct MistralPacker if (ci->type != id_MISTRAL_NOT && ci->type != id_GND && ci->type != id_VCC) process_inv_constants(cell.second); } + // Special case - SDATA can only be trimmed if SLOAD is low + for (auto cell : sorted(ctx->cells)) { + CellInfo *ci = cell.second; + if (ci->type != id_MISTRAL_FF) + continue; + if (ci->get_pin_state(id_SLOAD) != PIN_0) + continue; + disconnect_port(ctx, ci, id_SDATA); + } // Remove superfluous inverters and constant drivers trim_design(); } -- cgit v1.2.3