yosys/tests/various/sformatf.ys

13 lines
237 B
Plaintext
Raw Normal View History

read_verilog <<EOT
module top;
localparam a = $sformatf("0x%x", 8'h5A);
localparam b = $sformatf("%d", 4'b011);
generate
if (a != "0x5a") $error("a incorrect!");
2020-11-29 02:57:07 -06:00
if (b != " 3") $error("b incorrect!");
endgenerate
endmodule
EOT