aboutsummaryrefslogtreecommitdiff
path: root/test/passes/expand-accessors/accessor-vec.fir
blob: 8b4b7eb886d4fc5c939d8e593f4bd9ccd6e81da1 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
; RUN: firrtl -i %s -o %s.v -X verilog -p c 2>&1 | tee %s.out | FileCheck %s

circuit top :
   module top :
      wire m : UInt<32>[2][2][2]
      wire a : UInt<32>[2][2]
      wire b : UInt<32>[2]
      wire c : UInt<32>
      wire i : UInt
      wire j : UInt
      m[0][0][0] <= UInt(1)
      m[1][0][0] <= UInt(1)
      m[0][1][0] <= UInt(1)
      m[1][1][0] <= UInt(1)
      m[0][0][1] <= UInt(1)
      m[1][0][1] <= UInt(1)
      m[0][1][1] <= UInt(1)
      m[1][1][1] <= UInt(1)
      i <= UInt(1)
      a <= m[i]
      b <= a[i]
      c <= b[i]
      j <= c

      wire x : UInt<32>[2][2]
      wire y : UInt<32>[2]
      wire z : UInt<32>
      x[0][0] <= UInt(1)
      x[1][0] <= UInt(1)
      x[0][1] <= UInt(1)
      x[1][1] <= UInt(1)
      y[0] <= UInt(1)
      y[1] <= UInt(1)
      m[i] <= x
      x[i] <= y
      y[i] <= z
      z <= j

      wire p : {n : UInt<32>[2]}
      p.n[0] <= UInt(1)
      p.n[1] <= UInt(1)
      wire q : UInt<32>
      p.n[i] <= q
      q <= j

      wire r : {m : UInt<32>}[2]
      r[0].m <= UInt(1)
      r[1].m <= UInt(1)
      wire s : { m : UInt<32>}
      s <= r[i] 
      j <= s.m

; CHECK: Done!