aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2166/repro2.vhdl
blob: 9c587a9325213a052259ceda75b9c119d25dcd22 (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
entity repro2 is
end;

architecture behav of repro2 is
  function id(v : natural) return natural is
  begin
    return v;
  end id;

  function InitMemoryBaseType(Size : integer) return integer_vector is
  begin
    return (1 to Size => 0);
  end InitMemoryBaseType;

  subtype MemoryBaseType is integer_vector ;
  type MemBlockType      is array (integer range <>) of MemoryBaseType ;
  type MemBlockPtrType   is access MemBlockType ;
  type MemArrayType      is array (integer range <>) of MemBlockPtrType ;
  type MemArrayPtrType   is access MemArrayType ;

begin
  process
    variable MemArr : MemArrayPtrType;
    variable BlockWidth : natural;
  begin
    BlockWidth := 4;
    MemArr := new MemArrayType (0 to 7);
    MemArr(0) := new MemBlockType (0 to BlockWidth - 1)(0 to 31);
    MemArr(0)(0 to BlockWidth-1) :=
      (0 to BlockWidth-1 => InitMemoryBaseType(32)) ;
    wait;
  end process;
end;