diff options
author | Ruben Undheim <ruben.undheim@gmail.com> | 2018-08-30 20:46:20 +0200 |
---|---|---|
committer | Ruben Undheim <ruben.undheim@gmail.com> | 2018-08-30 20:46:20 +0200 |
commit | 5033b51947a6ef02cb785b5622e993335efa750a (patch) | |
tree | 7bed18c526bd94917fa2f08e3df12209863698a1 /tests/simple | |
parent | fefe0fc0430f4f173a25e674708aa0f4f0854b31 (diff) |
New upstream version 0.7+20180830git0b7a184
Diffstat (limited to 'tests/simple')
-rw-r--r-- | tests/simple/arraycells.v | 2 | ||||
-rw-r--r-- | tests/simple/graphtest.v | 2 | ||||
-rw-r--r-- | tests/simple/hierdefparam.v | 23 | ||||
-rw-r--r-- | tests/simple/specify.v | 31 |
4 files changed, 56 insertions, 2 deletions
diff --git a/tests/simple/arraycells.v b/tests/simple/arraycells.v index 704ca3fd..fd85a119 100644 --- a/tests/simple/arraycells.v +++ b/tests/simple/arraycells.v @@ -2,7 +2,7 @@ module array_test001(a, b, c, y); input a; input [31:0] b, c; - input [31:0] y; + output [31:0] y; aoi12 p [31:0] (a, b, c, y); endmodule diff --git a/tests/simple/graphtest.v b/tests/simple/graphtest.v index 74788dbb..9b16b61c 100644 --- a/tests/simple/graphtest.v +++ b/tests/simple/graphtest.v @@ -25,7 +25,7 @@ assign Z[7:4] = {1'b0, B[2:0]}; // Concat of CV and PI connect to PO always @* begin if (A == 4'b1111) begin // All-Const at port (eq) X = B; - end + end else begin X = 4'b0000; // All-Const at port (mux) end diff --git a/tests/simple/hierdefparam.v b/tests/simple/hierdefparam.v new file mode 100644 index 00000000..ff92c38b --- /dev/null +++ b/tests/simple/hierdefparam.v @@ -0,0 +1,23 @@ +module hierdefparam_top(input [7:0] A, output [7:0] Y); + generate begin:foo + hierdefparam_a mod_a(.A(A), .Y(Y)); + end endgenerate + defparam foo.mod_a.bar[0].mod_b.addvalue = 42; + defparam foo.mod_a.bar[1].mod_b.addvalue = 43; +endmodule + +module hierdefparam_a(input [7:0] A, output [7:0] Y); + genvar i; + generate + for (i = 0; i < 2; i=i+1) begin:bar + wire [7:0] a, y; + hierdefparam_b mod_b(.A(a), .Y(y)); + end + endgenerate + assign bar[0].a = A, bar[1].a = bar[0].y, Y = bar[1].y; +endmodule + +module hierdefparam_b(input [7:0] A, output [7:0] Y); + parameter [7:0] addvalue = 44; + assign Y = A + addvalue; +endmodule diff --git a/tests/simple/specify.v b/tests/simple/specify.v new file mode 100644 index 00000000..f19418d9 --- /dev/null +++ b/tests/simple/specify.v @@ -0,0 +1,31 @@ +module test_specify; + +specparam a=1; + +specify +endspecify + +specify +(A => B) = ( 1 ) ; +(A- => B) = ( 1,2 ) ; +(A+ => B) = ( 1,2,3 ) ; +(A => B) = ( + 1.1, 2, 3, + 4, 5.5, 6.6 +) ; +(A => B) = ( + 1.1, 2, 3, + 4, 5.5, 6.6 , + 7.7, 8.8, 9, + 10.1, 11, 12 +) ; +specparam b=1; +specparam [1:2] asasa=1; +endspecify + +specify +specparam c=1:2:3; +endspecify + +endmodule + |