1
0
mirror of synced 2026-05-05 07:35:21 +00:00

Merge pull request #1647 from YosysHQ/dave/sprintf

ast: Add support for $sformatf system function
This commit is contained in:
David Shah
2020-02-02 14:53:46 +00:00
committed by GitHub
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