YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.49k stars 893 forks source link

`write_verilog` does not replace bwmux instances #4751

Open 7FM opened 3 hours ago

7FM commented 3 hours ago

Version

0.46

On which OS did this happen?

Linux

Reproduction Steps

Read in CVA6 via the yosys-slang plugin and try to write it out again into a single verilog file... Not so easy to reproduce, I guess.

Expected Behavior

write_verilog should output code without internal cells.

Actual Behavior

The exported verilog code still contains bwmux cells. I have to manually run bwmuxmap before write_verilog to remove all internal cells.

povik commented 2 hours ago

Small reproducer:

read_slang <<EOF
module top;
reg x, b;
reg [2:0] a;
reg [2:0] out;
always_comb begin
    out = a;
    out[x] = b;
end
endmodule
EOF
write_verilog netlist.v
povik commented 2 hours ago

Just to make clear it is a write_verilog bug, there's this part in its documentation:

    -noexpr
        without this option all internal cells are converted to Verilog
        expressions.