aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <mwk@0x04.net>2020-03-30 15:02:24 +0200
committerMarcin Koƛcielnicki <mwk@0x04.net>2020-03-30 15:04:31 +0200
commitf68985f997865acefef63c3cb15074ebe2882869 (patch)
tree7fde6ea79ffb62d853ef05c45bbda897aab934ce
parent1dbc70172830c57cda22e4bc82d2db57a2067203 (diff)
downloadyosys-f68985f997865acefef63c3cb15074ebe2882869.tar.gz
yosys-f68985f997865acefef63c3cb15074ebe2882869.tar.bz2
yosys-f68985f997865acefef63c3cb15074ebe2882869.zip
deminout: prevent any constant assignment from demoting to input
Before this patch, ``` module top(inout io); assign io = 1'bx; endmodule ``` would have the `io` pin demoted to input (same happens for `1'bz`, but not for `1'b0` or `1'b1`), resulting in check failures later on. Part of fix for #1841.
-rw-r--r--passes/techmap/deminout.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/passes/techmap/deminout.cc b/passes/techmap/deminout.cc
index 35d43b106..a7dce9c81 100644
--- a/passes/techmap/deminout.cc
+++ b/passes/techmap/deminout.cc
@@ -113,7 +113,7 @@ 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)
+ if (!bit.wire)
new_output = true;
if (bits_written.count(bit)) {
new_output = true;