diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-09-25 06:40:55 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-09-25 11:43:30 +0200 |
commit | 00e3aafd8df24a670e583e3429b6fdeb509735a4 (patch) | |
tree | 58c2f742f6c8ba91daf7cacd8be48dec518ca656 | |
parent | 0213ad6ff1d00457ae26aea87d629d7e61fcb109 (diff) | |
download | ghdl-00e3aafd8df24a670e583e3429b6fdeb509735a4.tar.gz ghdl-00e3aafd8df24a670e583e3429b6fdeb509735a4.tar.bz2 ghdl-00e3aafd8df24a670e583e3429b6fdeb509735a4.zip |
testsuite/gna: add a test for #2198
-rw-r--r-- | testsuite/gna/issue2198/moon.vhdl | 51 | ||||
-rwxr-xr-x | testsuite/gna/issue2198/testsuite.sh | 9 |
2 files changed, 60 insertions, 0 deletions
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" |