aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-whens/one-when.fir
blob: 53616b0e2fd0547a52cd1143d0e067b3ceaf85d4 (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
35
36
; 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>
      cmem m : UInt<1>[2], clk
      wire i : UInt<1>
      wire p : UInt<1>
      wire j : UInt<1>
      j <= UInt(1)
      reg r : UInt<1>, clk, reset

      p <= j
      when p :
        onreset r <= i
        infer accessor a = m[i] 
        i <= a
        infer accessor b = m[i]
        b <= i
      else :
        infer accessor c = m[i]
        i <= c
        infer accessor d = m[i] 
        d <= i
      infer accessor e = m[i]
      when p :
        p <= i
        when e :
           p <= p
           onreset r <= p
           r <= p
        

; CHECK: Finished Expand Whens