aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-whens/nested-whens.fir
blob: 0a45dac180578fa84f15a69dcadb97e99600107b (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.v -X verilog -p c 2>&1 | 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: r <= mux(reset, mux(q, y, mux(p, x, w)), z)
; CHECK: Finished Expand Whens