aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-whens/nested-whens.fir
blob: 4d23a5491814c508c85aacb099d8716d6db1d3d4 (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 flo -p c | tee %s.out | FileCheck %s
; CHECK: Expand Whens
circuit top :
   module top :
      wire p : UInt
      wire q : UInt
      reg r : UInt
      wire a : UInt
      wire b : UInt
      wire x : UInt
      wire y : UInt
      wire z : UInt
      wire w : UInt
      p := UInt(1)
      q := UInt(1)
      a := UInt(1)
      b := UInt(1)
      x := UInt(1)
      y := UInt(1)
      z := UInt(1)
      w := UInt(1)

      on-reset r := w
      when p :
        on-reset r := x
        r := a
      when q :
        on-reset r := y
        r := b
      r := z
; CHECK: when UInt(1) : r := mux(reset, mux(q, y, mux(p, x, w)), z)
; CHECK: Finished Expand Whens