aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-whens/nested-whens.fir
blob: c81ca4853b99d07ea11e2f079f3ed17b988d3895 (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
33
34
; RUN: firrtl -i %s -o %s.flo -X flo -p c | tee %s.out | FileCheck %s
; CHECK: Expand Whens
circuit top :
   module top :
      input clk : Clock
      input reset : UInt<1>
      wire p : UInt
      wire q : UInt
      reg r : UInt, clk, reset
      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)

      onreset r := w
      when p :
        onreset r := x
        r := a
      when q :
        onreset 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