diff options
author | Zachary Snow <zach@zachjs.com> | 2022-02-22 16:57:08 +0100 |
---|---|---|
committer | Zachary Snow <zachary.j.snow@gmail.com> | 2022-04-05 14:43:48 -0600 |
commit | bf15dbd0f7cac8cfb572e137b9332016d0cc483d (patch) | |
tree | 091c9d597ba8be61fa1ffae67cce214f2433f272 /tests | |
parent | 957fdb328a2d9640ca4fb0787189eaded84efbd4 (diff) | |
download | yosys-bf15dbd0f7cac8cfb572e137b9332016d0cc483d.tar.gz yosys-bf15dbd0f7cac8cfb572e137b9332016d0cc483d.tar.bz2 yosys-bf15dbd0f7cac8cfb572e137b9332016d0cc483d.zip |
sv: fix always_comb auto nosync for nested and function blocks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/verilog/always_comb_nolatch_5.ys | 15 | ||||
-rw-r--r-- | tests/verilog/always_comb_nolatch_6.ys | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/verilog/always_comb_nolatch_5.ys b/tests/verilog/always_comb_nolatch_5.ys new file mode 100644 index 000000000..132878626 --- /dev/null +++ b/tests/verilog/always_comb_nolatch_5.ys @@ -0,0 +1,15 @@ +read_verilog -sv <<EOF +module top; +logic [4:0] x; +logic z; +assign z = 1'b1; +always_comb begin : foo + x = '0; + if (z) begin : bar + for (int i = 0; i < 5; i++) + x[i] = 1'b1; + end +end +endmodule +EOF +proc diff --git a/tests/verilog/always_comb_nolatch_6.ys b/tests/verilog/always_comb_nolatch_6.ys new file mode 100644 index 000000000..90ee78a68 --- /dev/null +++ b/tests/verilog/always_comb_nolatch_6.ys @@ -0,0 +1,15 @@ +read_verilog -sv <<EOF +module top(input wire x, y, output reg z); +function automatic f; + input inp; + for (int i = 0; i < 1; i++) + f = inp + 0; +endfunction +always_comb + if (y) + z = f(x); + else + z = 0; +endmodule +EOF +proc |