aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug0125/gen1d.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/bug0125/gen1d.py')
-rwxr-xr-xtestsuite/gna/bug0125/gen1d.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/gna/bug0125/gen1d.py b/testsuite/gna/bug0125/gen1d.py
new file mode 100755
index 000000000..265a7f494
--- /dev/null
+++ b/testsuite/gna/bug0125/gen1d.py
@@ -0,0 +1,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;
+""")