diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-11-13 06:10:17 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-11-13 06:10:17 +0100 |
commit | 8ed4b88145fffe220cd9839d93a76ea23caf56d9 (patch) | |
tree | 6b0b4b3f3037202804748c89a10a2655c1346f6d /testsuite/gna/issue456/gen_hex.py | |
parent | 8313646e4f770b90e62eab238e5a0a0c4425262e (diff) | |
download | ghdl-8ed4b88145fffe220cd9839d93a76ea23caf56d9.tar.gz ghdl-8ed4b88145fffe220cd9839d93a76ea23caf56d9.tar.bz2 ghdl-8ed4b88145fffe220cd9839d93a76ea23caf56d9.zip |
Add testcase for #456.
Diffstat (limited to 'testsuite/gna/issue456/gen_hex.py')
-rw-r--r-- | testsuite/gna/issue456/gen_hex.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/gna/issue456/gen_hex.py b/testsuite/gna/issue456/gen_hex.py new file mode 100644 index 000000000..28d08819f --- /dev/null +++ b/testsuite/gna/issue456/gen_hex.py @@ -0,0 +1,23 @@ +import sys +import random + +n=1024 +if len(sys.argv) > 1: + n = int(sys.argv[1]) + +sys.stdout.write("library ieee;\n") +sys.stdout.write("use ieee.std_logic_1164.all;\n") +sys.stdout.write("\n") +sys.stdout.write("package data_pkg is\n") +sys.stdout.write(" type word_vector is array (natural range <>) of\n") +sys.stdout.write(" std_logic_vector(31 downto 0);\n") +sys.stdout.write("\n") +sys.stdout.write(" constant data : word_vector := (\n") +for i in range(n): + sys.stdout.write(" ") + for j in range(4): + sys.stdout.write('x"{:08x}", '.format(random.getrandbits(32))) + sys.stdout.write("\n") +sys.stdout.write(' x"{:08x}"\n'.format(random.getrandbits(32))) +sys.stdout.write(" );\n") +sys.stdout.write("end data_pkg;\n") |