From 00e3aafd8df24a670e583e3429b6fdeb509735a4 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 25 Sep 2022 06:40:55 +0200 Subject: testsuite/gna: add a test for #2198 --- testsuite/gna/issue2198/moon.vhdl | 51 ++++++++++++++++++++++++++++++++++++ testsuite/gna/issue2198/testsuite.sh | 9 +++++++ 2 files changed, 60 insertions(+) create mode 100644 testsuite/gna/issue2198/moon.vhdl create mode 100755 testsuite/gna/issue2198/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/issue2198/moon.vhdl b/testsuite/gna/issue2198/moon.vhdl new file mode 100644 index 000000000..c1a435f82 --- /dev/null +++ b/testsuite/gna/issue2198/moon.vhdl @@ -0,0 +1,51 @@ +entity good is + port( + a,b,c : in bit; + d1,d2,d3 : out bit + ); +end good; + +architecture night of good is + begin + d1 <= (a and b) or c; + d2 <= (a or b) and c; + d3 <= (a and b and c) or (a and b) or c; + end; + +entity moon is +end moon; + +architecture night of moon is + component good + port( + a,b,c : in bit; + d1,d2,d3 : out bit + ); + end component; + + signal a0,b0,c0 : bit; + signal d0 : bit; + + begin + cow : night port map(a0, b0, c0, d0); + + process (a,b,c,d) is + begin + a <= '0'; b <= '0'; c <= '0'; + wait for 25 ns; + a <= '0'; b <= '0'; c <= '1'; + wait for 25 ns; + a <= '0'; b <= '1'; c <= '0'; + wait for 25 ns; + a <= '0'; b <= '1'; c <= '1'; + wait for 25 ns; + a <= '1'; b <= '0'; c <= '0'; + wait for 25 ns; + a <= '1'; b <= '0'; c <= '1'; + wait for 25 ns; + a <= '1'; b <= '1'; c <= '0'; + wait for 25 ns; + a <= '1'; b <= '1'; c <= '1'; + wait for 25 ns; + end process; + end; diff --git a/testsuite/gna/issue2198/testsuite.sh b/testsuite/gna/issue2198/testsuite.sh new file mode 100755 index 000000000..2533d0073 --- /dev/null +++ b/testsuite/gna/issue2198/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze_failure moon.vhdl + +clean + +echo "Test successful" -- cgit v1.2.3