projects
/
gram.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec9759b
)
Use assertions in simsoc testbench
author
Jean THOMAS
<git0@pub.jeanthomas.me>
Thu, 16 Jul 2020 13:36:00 +0000
(15:36 +0200)
committer
Jean THOMAS
<git0@pub.jeanthomas.me>
Thu, 16 Jul 2020 13:36:00 +0000
(15:36 +0200)
gram/simulation/simsoctb.v
patch
|
blob
|
history
diff --git
a/gram/simulation/simsoctb.v
b/gram/simulation/simsoctb.v
index 2c9d15dc12ffa9ad44763a7961a5466f318ee506..cd3b4338343679798bcd065a31144c8de07a5557 100644
(file)
--- a/
gram/simulation/simsoctb.v
+++ b/
gram/simulation/simsoctb.v
@@
-183,7
+183,7
@@
module simsoctb;
#2000;
wishbone_read(32'h10000000 >> 2, tmp);
- #2000;
+ #2000
assert_equal_32(tmp, 32'hFACECA8C)
;
// Write
wishbone_write(32'h10000000 >> 2, 32'h12345678);
@@
-265,4
+265,17
@@
module simsoctb;
#50;
end
endtask
+
+ task assert_equal_32;
+ input [31:0] inA;
+ input [31:0] inB;
+
+ begin
+ if (inA != inB)
+ begin
+ $display("%m at %t: Assertion failed (32-bit) equality: %08x != %08x", $time, inA, inB);
+ $finish;
+ end
+ end
+ endtask
endmodule