From d3fe9465f3efc30daf54926d6b3d2743b5fb3e51 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 12 Dec 2018 16:50:46 +0000 Subject: [PATCH 1/2] deminout: Don't demote constant-driven inouts to inputs Signed-off-by: David Shah --- passes/techmap/deminout.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passes/techmap/deminout.cc b/passes/techmap/deminout.cc index 9f0c7bf67..0cc3df2af 100644 --- a/passes/techmap/deminout.cc +++ b/passes/techmap/deminout.cc @@ -113,7 +113,8 @@ struct DeminoutPass : public Pass { { if (bits_numports[bit] > 1 || bits_inout.count(bit)) new_input = true, new_output = true; - + if (bit == State::S0 || bit == State::S1) + new_output = true; if (bits_written.count(bit)) { new_output = true; if (bits_tribuf.count(bit)) From 4c5944716834e42f5ff5ddaf9a4ef748f8cc2af7 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 12 Dec 2018 17:17:36 +0000 Subject: [PATCH 2/2] deminout: Consider $tribuf cells Signed-off-by: David Shah --- passes/techmap/deminout.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passes/techmap/deminout.cc b/passes/techmap/deminout.cc index 0cc3df2af..47d0ff416 100644 --- a/passes/techmap/deminout.cc +++ b/passes/techmap/deminout.cc @@ -83,9 +83,9 @@ struct DeminoutPass : public Pass { for (auto bit : sigmap(conn.second)) bits_used.insert(bit); - if (conn.first == "\\Y" && cell->type.in("$mux", "$pmux", "$_MUX_", "$_TBUF_")) + if (conn.first == "\\Y" && cell->type.in("$mux", "$pmux", "$_MUX_", "$_TBUF_", "$tribuf")) { - bool tribuf = (cell->type == "$_TBUF_"); + bool tribuf = (cell->type == "$_TBUF_" || cell->type == "$tribuf"); if (!tribuf) { for (auto &c : cell->connections()) {