From bff6c33d71382f5374468c757fe187dbeab3a661 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 16 Nov 2021 08:01:04 +0100 Subject: testsuite/gna: add scripts to generate 1d/2d aggregates --- testsuite/gna/bug0125/gen.py | 33 --------------------------------- testsuite/gna/bug0125/gen1d.py | 30 ++++++++++++++++++++++++++++++ testsuite/gna/bug0125/gen2d.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 33 deletions(-) delete mode 100755 testsuite/gna/bug0125/gen.py create mode 100755 testsuite/gna/bug0125/gen1d.py create mode 100755 testsuite/gna/bug0125/gen2d.py (limited to 'testsuite') diff --git a/testsuite/gna/bug0125/gen.py b/testsuite/gna/bug0125/gen.py deleted file mode 100755 index c058f748b..000000000 --- a/testsuite/gna/bug0125/gen.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -# Generate a big aggregate - -import sys -import random - -out = sys.stdout - - -depth = 1024 -width = 6 - -out.write(""" -package repro is - type array2d is array(0 to {}, 0 to {}) of integer; - - constant cst : array2d := - ( -""".format(depth - 1, width - 1)) - -for i in range(depth): - if i != 0: - out.write(',\n') - out.write (' (') - for j in range(width): - if j != 0: - out.write(', ') - out.write('{}'.format(random.randint(0, 1<<31))) - out.write(')') -out.write(""" - ); -end repro; -""") 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<