aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue973
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-10-08 20:24:42 +0200
committerTristan Gingold <tgingold@free.fr>2019-10-08 20:24:42 +0200
commit7678d2865436245e081a0a070a784d321442f513 (patch)
treec9e5f3bdc986dfb17ee68193139497caca06ff58 /testsuite/synth/issue973
parent9fc6a1b3e2b83dbed76f6792e72034f1bcb056ef (diff)
downloadghdl-7678d2865436245e081a0a070a784d321442f513.tar.gz
ghdl-7678d2865436245e081a0a070a784d321442f513.tar.bz2
ghdl-7678d2865436245e081a0a070a784d321442f513.zip
testsuite/syn: add testcase for #973
Diffstat (limited to 'testsuite/synth/issue973')
-rw-r--r--testsuite/synth/issue973/ent.vhdl16
-rw-r--r--testsuite/synth/issue973/tb_ent.vhdl22
-rwxr-xr-xtestsuite/synth/issue973/testsuite.sh16
3 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/synth/issue973/ent.vhdl b/testsuite/synth/issue973/ent.vhdl
new file mode 100644
index 000000000..796ab83ff
--- /dev/null
+++ b/testsuite/synth/issue973/ent.vhdl
@@ -0,0 +1,16 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity ent is
+ port (
+ i : in std_logic_vector(7 downto 0);
+ o : out std_logic_vector(3 downto 0)
+ );
+end;
+
+architecture a of ent is
+ alias high_nibble : std_logic_vector(3 downto 0) is i(7 downto 4);
+begin
+ o <= high_nibble;
+end;
+
diff --git a/testsuite/synth/issue973/tb_ent.vhdl b/testsuite/synth/issue973/tb_ent.vhdl
new file mode 100644
index 000000000..328d48180
--- /dev/null
+++ b/testsuite/synth/issue973/tb_ent.vhdl
@@ -0,0 +1,22 @@
+entity tb_ent is
+end tb_ent;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_ent is
+ signal i : std_logic_vector (7 downto 0);
+ signal o : std_logic_vector (3 downto 0);
+begin
+ dut: entity work.ent
+ port map (i, o);
+
+ process
+ begin
+ i <= x"b6";
+ wait for 1 ns;
+ assert o = x"b" severity failure;
+
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/synth/issue973/testsuite.sh b/testsuite/synth/issue973/testsuite.sh
new file mode 100755
index 000000000..e30a741e0
--- /dev/null
+++ b/testsuite/synth/issue973/testsuite.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for t in ent; do
+ analyze $t.vhdl tb_$t.vhdl
+ elab_simulate tb_$t
+ clean
+
+ synth $t.vhdl -e $t > syn_$t.vhdl
+ analyze syn_$t.vhdl tb_$t.vhdl
+ elab_simulate tb_$t --ieee-asserts=disable-at-0
+ clean
+done
+
+echo "Test successful"