aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-02-02 14:53:46 +0000
committerGitHub <noreply@github.com>2020-02-02 14:53:46 +0000
commit9f5613100b360beb60608df1296ee81dc185e56c (patch)
tree177ca44cab76a864c3a1b89ea5b1eeaa64f750ba /tests/various
parent1055b6b1dd7e4a557b33f6dc4bb14b09dcd582dc (diff)
parent22c967e35e23d0688081818f49a11f0ec0853bb1 (diff)
downloadyosys-9f5613100b360beb60608df1296ee81dc185e56c.tar.gz
yosys-9f5613100b360beb60608df1296ee81dc185e56c.tar.bz2
yosys-9f5613100b360beb60608df1296ee81dc185e56c.zip
Merge pull request #1647 from YosysHQ/dave/sprintf
ast: Add support for $sformatf system function
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/sformatf.ys12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/various/sformatf.ys b/tests/various/sformatf.ys
new file mode 100644
index 000000000..66d6b0dbe
--- /dev/null
+++ b/tests/various/sformatf.ys
@@ -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