3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

flatten, techmap: don't canonicalize tpl driven bits via sigmap.

For connection `assign a = b;`, `sigmap(a)` returns `b`. This is
exactly the opposite of the desired canonicalization for driven bits.
Consider the following code:

    module foo(inout a, b);
      assign a = b;
    endmodule
    module bar(output c);
      foo f(c, 1'b0);
    endmodule

Before this commit, the inout ports would be swapped after flattening
(and cause a crash while attempting to drive a constant value).

This issue was introduced in 9f772eb9.

Fixes #2183.
This commit is contained in:
whitequark 2020-08-26 16:20:32 +00:00
parent 08a226c9e7
commit 9f0892159e
3 changed files with 17 additions and 9 deletions

11
tests/techmap/bug2183.ys Normal file
View file

@ -0,0 +1,11 @@
read_verilog <<EOT
module foo(inout a, b);
assign a = b;
endmodule
module bar(output c);
foo f(c, 1'b0);
endmodule
EOT
hierarchy -auto-top
flatten