aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-22 20:47:08 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-22 20:47:08 +0100
commit3d81a74f66c2440ebde7efc64415d6c5510e94ee (patch)
tree3e3587bb54d970ac1fcd25a0e83cb9909a70e985
parent69c5ab150001ae0866aaaca6cbcdf38e0264a296 (diff)
downloadghdl-3d81a74f66c2440ebde7efc64415d6c5510e94ee.tar.gz
ghdl-3d81a74f66c2440ebde7efc64415d6c5510e94ee.tar.bz2
ghdl-3d81a74f66c2440ebde7efc64415d6c5510e94ee.zip
Add testcase for #473
-rw-r--r--testsuite/gna/issue473/repro.vhdl17
-rw-r--r--testsuite/gna/issue473/repro2.vhdl20
-rw-r--r--testsuite/gna/issue473/tbmem.vhdl27
-rwxr-xr-xtestsuite/gna/issue473/testsuite.sh11
4 files changed, 75 insertions, 0 deletions
diff --git a/testsuite/gna/issue473/repro.vhdl b/testsuite/gna/issue473/repro.vhdl
new file mode 100644
index 000000000..a4590b2a4
--- /dev/null
+++ b/testsuite/gna/issue473/repro.vhdl
@@ -0,0 +1,17 @@
+entity repro is
+end entity repro;
+
+architecture TB of repro is
+
+begin
+
+ DM: process
+ type t_ram is array(natural range <>) of bit_vector;
+ type p_ram is access t_ram;
+ variable myram : p_ram;
+ begin
+ myram := new t_ram(0 to 31)(15 downto 0);
+ wait;
+ end process DM;
+
+end architecture TB;
diff --git a/testsuite/gna/issue473/repro2.vhdl b/testsuite/gna/issue473/repro2.vhdl
new file mode 100644
index 000000000..6ab9c4bbd
--- /dev/null
+++ b/testsuite/gna/issue473/repro2.vhdl
@@ -0,0 +1,20 @@
+entity repro is
+end entity repro;
+
+architecture TB of repro is
+
+begin
+
+ DM: process
+ type t_ram is array(natural range <>) of bit_vector;
+ type p_ram is access t_ram;
+ variable myram : p_ram;
+ begin
+ myram := new t_ram(0 to 31)(15 downto 0);
+ for i in myram'range loop
+ myram(i) := (others => '0');
+ end loop;
+ wait;
+ end process DM;
+
+end architecture TB;
diff --git a/testsuite/gna/issue473/tbmem.vhdl b/testsuite/gna/issue473/tbmem.vhdl
new file mode 100644
index 000000000..a31a29520
--- /dev/null
+++ b/testsuite/gna/issue473/tbmem.vhdl
@@ -0,0 +1,27 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity tbmem is
+end entity tbmem;
+
+architecture TB of tbmem is
+
+begin
+
+ DM: process
+ type t_ram is array(natural range <>) of unsigned;
+ type p_ram is access t_ram;
+ variable myram : p_ram;
+ begin
+ myram := new t_ram(0 to 31)(15 downto 0);
+ for i in myram'range loop
+ myram(i) := TO_UNSIGNED(i, 16);
+ end loop;
+ for i in myram'range loop
+ report integer'image(i) & ": " & TO_HSTRING(myram(i));
+ end loop;
+ wait;
+ end process DM;
+
+end architecture TB;
diff --git a/testsuite/gna/issue473/testsuite.sh b/testsuite/gna/issue473/testsuite.sh
new file mode 100755
index 000000000..6a33b5970
--- /dev/null
+++ b/testsuite/gna/issue473/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze tbmem.vhdl
+elab_simulate tbmem
+
+clean
+
+echo "Test successful"