From eef32195bd1afb4f029bf3039377e65f0beabac2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 11 Nov 2019 23:13:00 +0000 Subject: [PATCH 1/2] flowmap: don't break if that creates a k+2 (and larger) LUT either. Fixes #1405. --- passes/techmap/flowmap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/techmap/flowmap.cc b/passes/techmap/flowmap.cc index 5807178dd..96eee45db 100644 --- a/passes/techmap/flowmap.cc +++ b/passes/techmap/flowmap.cc @@ -1050,7 +1050,7 @@ struct FlowmapWorker auto cut_inputs = cut_lut_at_gate(lut, lut_gate); pool gate_inputs = cut_inputs.first, other_inputs = cut_inputs.second; - if (gate_inputs.empty() && (int)other_inputs.size() == order) + if (gate_inputs.empty() && (int)other_inputs.size() >= order) { if (debug_relax) log(" Breaking would result in a (k+1)-LUT.\n"); From c68722818a09ce541c380178ff17e548db9c897d Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 12 Nov 2019 00:15:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?flowmap:=20when=20doing=20mincut,=20ensure?= =?UTF-8?q?=20source=20is=20always=20in=20X,=20not=20X=CC=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1475. --- passes/techmap/flowmap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passes/techmap/flowmap.cc b/passes/techmap/flowmap.cc index 96eee45db..a2ad87f7d 100644 --- a/passes/techmap/flowmap.cc +++ b/passes/techmap/flowmap.cc @@ -394,7 +394,7 @@ struct FlowGraph pair, pool> edge_cut() { - pool x, xi; + pool x = {source}, xi; // X and X̅ in the paper NodePrime source_prime = {source, true}; pool visited; @@ -437,6 +437,7 @@ struct FlowGraph for (auto collapsed_node : collapsed[sink]) xi.insert(collapsed_node); + log_assert(x[source] && !xi[source]); log_assert(!x[sink] && xi[sink]); return {x, xi}; }