3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 00:55:32 +00:00

ast: Add support for $sformatf system function

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2020-01-19 21:15:51 +00:00
parent b7be6cfd65
commit 22c967e35e
3 changed files with 122 additions and 93 deletions

12
tests/various/sformatf.ys Normal file
View file

@ -0,0 +1,12 @@
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