aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorclairexen <claire@symbioticeda.com>2020-08-18 17:22:20 +0200
committerGitHub <noreply@github.com>2020-08-18 17:22:20 +0200
commit5ee9349647cd2a77befb47c8c338a2afe9c2d0a8 (patch)
tree07640f7494e45823fd1200d8d96c6bac69fe36b7 /tests/various
parent3cb3978ff4f8c917908d03eca6f07c57da52c0dc (diff)
parentf285f7b76916420b5d55a83d53a371ebe257cfb2 (diff)
downloadyosys-5ee9349647cd2a77befb47c8c338a2afe9c2d0a8.tar.gz
yosys-5ee9349647cd2a77befb47c8c338a2afe9c2d0a8.tar.bz2
yosys-5ee9349647cd2a77befb47c8c338a2afe9c2d0a8.zip
Merge pull request #2281 from zachjs/const-real
Allow reals as constant function parameters
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/const_func.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/various/const_func.v b/tests/various/const_func.v
index 76cdc385d..541e63b19 100644
--- a/tests/various/const_func.v
+++ b/tests/various/const_func.v
@@ -53,6 +53,15 @@ module top(out);
c1, c2, c3, c4,
d1, d2, d3, d4};
+ function signed [31:0] negate;
+ input integer inp;
+ negate = ~inp;
+ endfunction
+ parameter W = 10;
+ parameter X = 3;
+ localparam signed Y = $floor(W / X);
+ localparam signed Z = negate($floor(W / X));
+
// `define VERIFY
`ifdef VERIFY
assert property (a1 == 0);
@@ -71,5 +80,8 @@ module top(out);
assert property (d2 == 0);
assert property (d3 == 1);
assert property (d4 == 1);
+
+ assert property (Y == 3);
+ assert property (Z == ~3);
`endif
endmodule