aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1364
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-09 18:37:47 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-09 18:37:47 +0200
commit288764bb1dfe19c83e119d89009e1d9a47f682b7 (patch)
tree2c288885e243b5362818953aa08601999d76945a /testsuite/gna/issue1364
parente31bcb1872d12c81c928580b055dbe0c9daff3ec (diff)
downloadghdl-288764bb1dfe19c83e119d89009e1d9a47f682b7.tar.gz
ghdl-288764bb1dfe19c83e119d89009e1d9a47f682b7.tar.bz2
ghdl-288764bb1dfe19c83e119d89009e1d9a47f682b7.zip
testsuite/gna: add a test from #1364
Diffstat (limited to 'testsuite/gna/issue1364')
-rw-r--r--testsuite/gna/issue1364/mwe.vhdl38
-rwxr-xr-xtestsuite/gna/issue1364/testsuite.sh9
2 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/gna/issue1364/mwe.vhdl b/testsuite/gna/issue1364/mwe.vhdl
new file mode 100644
index 000000000..9657e98b5
--- /dev/null
+++ b/testsuite/gna/issue1364/mwe.vhdl
@@ -0,0 +1,38 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity mwe is
+ port(
+ n_rst_i : in std_logic;
+ clk_i : in std_logic
+ );
+end entity mwe;
+
+architecture arch of mwe is
+
+-- I declare a new type which is an array of buses
+type my_new_type is array(natural range <>) of std_logic_vector(31 downto 0);
+
+-- Then I declare a constant of that new type
+constant constant_of_my_new_type : my_new_type (0 to 7) := ((others=>(others => '0')));
+
+signal signal_of_my_new_type : my_new_type (0 to 7);
+
+begin
+
+process(clk_i)
+begin
+
+ -- if Reset low then signal_of_my_new_type = constant_of_my_new_type
+ -- else, signal_of_my_new_type is filled with one at the next clock rising edge
+
+ if n_rst_i = '0' then
+ signal_of_my_new_type <= constant_of_my_new_type;
+ elsif rising_edge(clk_i) then
+ signal_of_my_new_type <= ((others=>(others => '1')));
+ end if;
+
+end process;
+
+end architecture;
diff --git a/testsuite/gna/issue1364/testsuite.sh b/testsuite/gna/issue1364/testsuite.sh
new file mode 100755
index 000000000..141fb1837
--- /dev/null
+++ b/testsuite/gna/issue1364/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure mwe.vhdl
+
+clean
+
+echo "Test successful"