Download chips/yosys/tests/proc/bug6434.ys from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 860 Bytes
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/proc/bug6434.ys
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/tests/proc/bug6434.ys
-
curl -L -o bug6434.ys https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/proc/bug6434.ys
860 Bytes
| # https://github.com/YosysHQ/yosys/issues/6434 | |
| # no latch for an unused loop variable | |
| read_verilog <<EOT | |
| module top(input ena, input [2:0] idx, output reg [7:0] out); | |
| always @* begin : blk | |
| integer i; | |
| if (ena) | |
| for (i = 0; i < 8; i = i + 1) | |
| out[i] = i > idx; | |
| else | |
| out = 0; | |
| end | |
| endmodule | |
| EOT | |
| design -save read | |
| logger -expect-no-warnings | |
| proc -latches error | |
| logger -check-expected | |
| select -assert-none t:$dlatch t:$adlatch | |
| check -assert | |
| # synth_ice40 defaults to -latches error | |
| design -load read | |
| logger -expect-no-warnings | |
| synth_ice40 | |
| logger -check-expected | |
| design -reset | |
| # latch value read later in the same process is reported | |
| read_verilog <<EOT | |
| module top(input en, d, output reg out); | |
| reg y; | |
| always @* begin | |
| if (en) y = d; | |
| out = y; | |
| end | |
| endmodule | |
| EOT | |
| logger -expect warning "Latch inferred for signal" 1 | |
| proc -latches warn | |
| logger -check-expected | |