aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1166
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-23 06:50:05 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-23 06:50:05 +0100
commit406323c01cd9263016a118106ea5a7c8e9cbe8ae (patch)
tree41c1a64549f4fe0cdcb6a68a8230fa1838b1c9a1 /testsuite/synth/issue1166
parente1e293701bb457af7bffc2e18a890cf552599144 (diff)
downloadghdl-406323c01cd9263016a118106ea5a7c8e9cbe8ae.tar.gz
ghdl-406323c01cd9263016a118106ea5a7c8e9cbe8ae.tar.bz2
ghdl-406323c01cd9263016a118106ea5a7c8e9cbe8ae.zip
testsuite/synth: add a test for #1166
Diffstat (limited to 'testsuite/synth/issue1166')
-rw-r--r--testsuite/synth/issue1166/ent.vhdl24
-rw-r--r--testsuite/synth/issue1166/tb_ent.vhdl45
-rwxr-xr-xtestsuite/synth/issue1166/testsuite.sh9
3 files changed, 78 insertions, 0 deletions
diff --git a/testsuite/synth/issue1166/ent.vhdl b/testsuite/synth/issue1166/ent.vhdl
new file mode 100644
index 000000000..8f2f1b514
--- /dev/null
+++ b/testsuite/synth/issue1166/ent.vhdl
@@ -0,0 +1,24 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity ent is
+ port (
+ a : inout std_logic;
+ enable : in std_logic;
+ d_in : in std_logic;
+ d_out : out std_logic
+ );
+end;
+
+architecture a of ent is
+begin
+ process(all)
+ begin
+ if enable then
+ a <= d_in;
+ else
+ a <= 'Z';
+ end if;
+ end process;
+ d_out <= a;
+end;
diff --git a/testsuite/synth/issue1166/tb_ent.vhdl b/testsuite/synth/issue1166/tb_ent.vhdl
new file mode 100644
index 000000000..016f6b685
--- /dev/null
+++ b/testsuite/synth/issue1166/tb_ent.vhdl
@@ -0,0 +1,45 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity tb_ent is
+end;
+
+architecture a of tb_ent is
+ signal a, enable, d_in, d_out : std_logic;
+begin
+ uut: entity work.ent
+ port map (
+ a => a,
+ enable => enable,
+ d_in => d_in,
+ d_out => d_out
+ );
+
+ process
+ begin
+ a <= '0';
+ enable <= '0';
+
+ wait for 10 ns;
+ assert d_out = '0';
+
+ a <= '1';
+
+ wait for 10 ns;
+ assert d_out = '1' severity failure;
+
+ enable <= '1';
+ a <= 'Z';
+ d_in <= '0';
+
+ wait for 10 ns;
+ assert a = '0' severity failure;
+
+ d_in <= '1';
+
+ wait for 10 ns;
+ assert a = '1' severity failure;
+
+ wait;
+ end process;
+end;
diff --git a/testsuite/synth/issue1166/testsuite.sh b/testsuite/synth/issue1166/testsuite.sh
new file mode 100755
index 000000000..047bcf9bb
--- /dev/null
+++ b/testsuite/synth/issue1166/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+
+synth_tb ent
+
+echo "Test successful"