Tests: Check equality of complex types.

This commit is contained in:
Wilson Snyder 2023-05-26 18:01:11 -04:00
parent 519792d02b
commit cfce92645f
4 changed files with 20 additions and 0 deletions

View File

@ -14,6 +14,7 @@ module t (/*AUTOARG*/
input clk;
logic [3:0] foo [1:0];
logic [3:0] fooe [1:0];
initial begin
foo[0] = 4'b0101;
foo[1] = 4'b0011;
@ -24,6 +25,10 @@ module t (/*AUTOARG*/
`checkh(foo.sum, 4'b1000);
`checkh(foo.product, 4'b1111);
fooe[0] = 4'b0101;
fooe[1] = 4'b0011;
if (foo != fooe) $stop;
$write("*-* All Finished *-*\n");
$finish;
end

View File

@ -139,6 +139,11 @@ module t (/*AUTOARG*/);
i = qe.xor();
`checkh(i, 32'b0);
q = '{10:1, 11:2};
qe = '{10:1, 11:2};
`checkh(q == qe, 1'b1);
`checkh(q != qe, 1'b0);
$write("*-* All Finished *-*\n");
$finish;
end

View File

@ -165,6 +165,11 @@ module t (/*AUTOARG*/);
`checkh(qi.size, 1);
`checkh(qi[0], 2);
d = '{1, 2};
de = '{1, 2};
`checkh(d == de, 1'b1);
`checkh(d != de, 1'b0);
$write("*-* All Finished *-*\n");
$finish;
end

View File

@ -188,6 +188,11 @@ module t (/*AUTOARG*/);
i = qe.xor;
`checkh(i, 32'b0);
q = '{1, 2};
qe = '{1, 2};
`checkh(q == qe, 1'b1);
`checkh(q != qe, 1'b0);
$write("*-* All Finished *-*\n");
$finish;
end