From 0a840dd88334c382314db3aafc2f1da2a1969df2 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 31 Dec 2018 16:34:27 +0100 Subject: [PATCH] Fix handling of (* keep *) wires in wreduce Signed-off-by: Clifford Wolf --- passes/opt/wreduce.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/passes/opt/wreduce.cc b/passes/opt/wreduce.cc index 0164f58d6..8063b86a6 100644 --- a/passes/opt/wreduce.cc +++ b/passes/opt/wreduce.cc @@ -235,8 +235,11 @@ struct WreduceWorker } else { while (GetSize(sig) > 0) { - auto info = mi.query(sig[GetSize(sig)-1]); + auto bit = sig[GetSize(sig)-1]; + if (keep_bits.count(bit)) + break; + auto info = mi.query(bit); if (info->is_output || GetSize(info->ports) > 1) break; -- 2.30.2