aboutsummaryrefslogtreecommitdiff
path: root/test/chisel3/Mul.fir
blob: ec991197aad4387fcf81e25d9a2fc04de1414bb9 (plain)
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
; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s
; CHECK: Done!

circuit Mul : 
  module Mul : 
    input x : UInt<2>
    output z : UInt<4>
    output a : UInt<4>
    input y : UInt<2>
    
    wire tbl : UInt<4>[16]
    tbl[0] := UInt<4>(0)
    tbl[1] := UInt<4>(0)
    tbl[2] := UInt<4>(0)
    tbl[3] := UInt<4>(0)
    tbl[4] := UInt<4>(0)
    tbl[5] := UInt<4>(1)
    tbl[6] := UInt<4>(2)
    tbl[7] := UInt<4>(3)
    tbl[8] := UInt<4>(0)
    tbl[9] := UInt<4>(2)
    tbl[10] := UInt<4>(4)
    tbl[11] := UInt<4>(6)
    tbl[12] := UInt<4>(0)
    tbl[13] := UInt<4>(3)
    tbl[14] := UInt<4>(6)
    tbl[15] := UInt<4>(9)
    node T_43 = shl(x, 2)
    node ad = bit-or(Pad(T_43,?), Pad(y,?))
    a := Pad(ad,?)
    accessor T_44 = tbl[ad]
    z := Pad(T_44,?)