-
Notifications
You must be signed in to change notification settings - Fork 7
/
router_order_checker.tlv
48 lines (39 loc) · 1.23 KB
/
router_order_checker.tlv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
\m4_TLV_version 1d: tl-x.org
\SV
m4_makerchip_module
// To relax Verilator compiler checking:
/* verilator lint_off UNOPTFLAT */
/* verilator lint_off WIDTH */
\TLV
m4_checks_on
$reset = *reset;
// [Ring uarch here.]
// Checker
m4_check(['
/node[7:0]
// Count transactions at the input for each destination.
|in
/trans
?$valid
@1
/out_node[7:0]
$to_me = |in$reset || /trans$dest == #out_node;
?$to_me
$Cnt[31:0] <= $reset ? 0 : $Cnt + 1;
// Count transactions at the output for each source.
|out
/trans
?$valid
@1
/in_node[7:0]
$from_me = |out$reset || /trans$src == #in_node;
?$from_me
$OutCnt[31:0] <= |out$reset ? 0 : $OutCnt + 1;
// Compare output transaction's count with expected count.
$error = $Cnt != /in_node[$src]$OutCnt;
']
// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule