aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug0125/gen1d.py
blob: 265a7f494fc02976f8e6552d69be37105a812266 (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
#!/usr/bin/env python3
# Generate a big aggregate

import sys
import random

out = sys.stdout


depth = 1024
width = 24

out.write("""
package repro is
  type array2d is array(0 to {}) of bit_vector({} downto 0);

  constant cst : array2d :=
  (
""".format(depth - 1, width - 1))

fmt = 'b"{{:0{}b}}"'.format(width)

for i in range(depth):
    if i != 0:
        out.write(',\n')
    out.write ('   ' + fmt.format(random.randint(0, 1<<width)));
out.write("""
   );
end repro;
""")