-
Notifications
You must be signed in to change notification settings - Fork 0
/
pythpipedis.tlv
40 lines (32 loc) · 1.39 KB
/
pythpipedis.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
\m5_TLV_version 1d: tl-x.org
\m5
// =================================================
// Welcome! New to Makerchip? Try the "Learn" menu.
// =================================================
//use(m5-1.0) /// uncomment to use M5 macro library.
\SV
// Macro providing required top-level module definition, random
// stimulus support, and Verilator config.
m5_makerchip_module // (Expanded in Nav-TLV pane.)
\TLV
|calc
@1
$reset = *reset;
$valid = $reset ? 1 : (>>1$num + 1);
$val1[31:0] = $reset ? 1 : (>>2$out[31:0]);
$val2[31:0] = $rand2[3:0];
$op[1:0] = $rand3[1:0];
$sum[31:0] = $val1[31:0] + $val2[31:0];
$diff[31:0] = $val1[31:0] - $val2[31:0];
$prod[31:0] = $val1[31:0] * $val2[31:0];
$quot[31:0] = $val1[31:0] / $val2[31:0];
@2
$out[31:0] = ($reset || (! $valid)) ? 32'b0 : ($op[1:0]==2'b00) ? $sum[31:0] :
($op[1:0]==2'b01) ? $diff[31:0] :
($op[1:0]==2'b10) ? $prod[31:0] :
$quot[31:0];
// Assert these to end simulation (before Makerchip cycle limit).
*passed = *cyc_cnt > 40;
*failed = 1'b0;
\SV
endmodule