From c1c4d8c86328fa378da5d8d306b2ec701768667a Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 11 Mar 2016 17:32:12 +0000 Subject: [PATCH] Fix bitmask merging in synthesis. A conditional clause that doesn't drive any bits of a particular nexus should not affect the bitmask generated for that nexus. The completely undriven case is handled by the enable signal. --- synth2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synth2.cc b/synth2.cc index b30b7576c..9dff45a0f 100644 --- a/synth2.cc +++ b/synth2.cc @@ -165,10 +165,10 @@ static void merge_sequential_masks(NetProc::mask_t&top_mask, NetProc::mask_t&sub static void merge_parallel_masks(NetProc::mask_t&top_mask, NetProc::mask_t&sub_mask) { - if (top_mask.size() == 0) + if (sub_mask.size() == 0) return; - if (sub_mask.size() == 0) { + if (top_mask.size() == 0) { top_mask = sub_mask; return; }