diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-11-16 08:01:04 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-11-16 08:01:04 +0100 |
commit | bff6c33d71382f5374468c757fe187dbeab3a661 (patch) | |
tree | 8b8b0f16a72b9938b7df152725a0bc2e9a8e714e /testsuite | |
parent | 876aab6114851f85e172afd502a43f4bcf1cef7b (diff) | |
download | ghdl-bff6c33d71382f5374468c757fe187dbeab3a661.tar.gz ghdl-bff6c33d71382f5374468c757fe187dbeab3a661.tar.bz2 ghdl-bff6c33d71382f5374468c757fe187dbeab3a661.zip |
testsuite/gna: add scripts to generate 1d/2d aggregates
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/gna/bug0125/gen1d.py | 30 | ||||
-rwxr-xr-x | testsuite/gna/bug0125/gen2d.py (renamed from testsuite/gna/bug0125/gen.py) | 0 |
2 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; +""") diff --git a/testsuite/gna/bug0125/gen.py b/testsuite/gna/bug0125/gen2d.py index c058f748b..c058f748b 100755 --- a/testsuite/gna/bug0125/gen.py +++ b/testsuite/gna/bug0125/gen2d.py |