3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-06 17:44:09 +00:00
yosys/tests/various/sformatf.ys
David Shah 22c967e35e ast: Add support for $sformatf system function
Signed-off-by: David Shah <dave@ds0.me>
2020-01-19 21:20:17 +00:00

13 lines
236 B
Plaintext

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!");
if (b != "3") $error("b incorrect!");
endgenerate
endmodule
EOT