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
49
50
51
52
53
|
; RUN: firrtl -i %s -o %s.flo -X flo -p c | tee %s.out | FileCheck %s
;CHECK: Done!
circuit SIntOps :
module SIntOps :
input a : SInt<16>
input b : SInt<16>
output addout : SInt<16>
output subout : SInt<16>
output timesout : SInt<16>
output divout : SInt<16>
output modout : SInt<16>
output lshiftout : SInt<16>
output rshiftout : SInt<16>
output lessout : UInt<1>
output greatout : UInt<1>
output eqout : UInt<1>
output noteqout : UInt<1>
output lesseqout : UInt<1>
output greateqout : UInt<1>
output negout : SInt<16>
node ub = as-UInt(b)
node T_38 = add-wrap(a, b)
addout := T_38
node T_39 = sub-wrap(a, b)
subout := T_39
node T_40 = mul(a, b)
node T_41 = bits(T_40, 15, 0)
timesout := T_41
node T_42 = mul(a, b)
node T_43 = bits(T_42, 15, 0)
divout := T_43
modout := UInt<1>(0)
node T_44 = shl(a, 12)
node T_45 = bits(T_44, 15, 0)
lshiftout := T_45
node T_46 = shr(a, 8)
rshiftout := T_46
node T_47 = lt(a, b)
lessout := T_47
node T_48 = gt(a, b)
greatout := T_48
node T_49 = eq(a, b)
eqout := T_49
node T_50 = neq(a, b)
noteqout := T_50
node T_51 = leq(a, b)
lesseqout := T_51
node T_52 = geq(a, b)
greateqout := T_52
node T_53 = sub-wrap(SInt<1>(0), a)
negout := T_53
|