diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-11-07 07:56:27 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-11-07 07:56:27 +0100 |
commit | ccee381c7e7a028e61ebfb03dc8e80047a1d6b54 (patch) | |
tree | 7aa61ab842f8cb85ed203c9334e8f73ead410601 /testsuite/gna | |
parent | 1481610635b8e575c7b2560ada5e60f1f0a36636 (diff) | |
download | ghdl-ccee381c7e7a028e61ebfb03dc8e80047a1d6b54.tar.gz ghdl-ccee381c7e7a028e61ebfb03dc8e80047a1d6b54.tar.bz2 ghdl-ccee381c7e7a028e61ebfb03dc8e80047a1d6b54.zip |
testsuite/gna: add a test for previous commit
Diffstat (limited to 'testsuite/gna')
-rw-r--r-- | testsuite/gna/bug0134/test_logic.vhdl | 42 | ||||
-rwxr-xr-x | testsuite/gna/bug0134/testsuite.sh | 10 |
2 files changed, 52 insertions, 0 deletions
diff --git a/testsuite/gna/bug0134/test_logic.vhdl b/testsuite/gna/bug0134/test_logic.vhdl new file mode 100644 index 000000000..2f8a45e0f --- /dev/null +++ b/testsuite/gna/bug0134/test_logic.vhdl @@ -0,0 +1,42 @@ +entity test_logic is + port( + a, b, c, d : in bit; + g : out bit + ); +end test_logic; + +architecture structure of test_logic is + -- function "not" (i: bit) return bit is + -- begin + -- if i = '1' then + -- return '0'; + -- else + -- return '1'; + -- end if; + -- end function "not"; + component AND1 + port(s, t : in bit; + u : out bit + ); + end component; + component OR1 + port(x, y, z : in bit; + n : out bit + ); + end component; + signal e, k, h : bit; +begin + x1: AND1 port map(s => "not"(a), + t => "not"(d), + u => e); + x2: AND1 port map(s => "not"(b), + t => "not"(d), + u => k); + x3: AND1 port map(s => a, + t => d, + u => h); + x4: OR1 port map(x => e, + y => k, + z => h, + n => g); +end structure; diff --git a/testsuite/gna/bug0134/testsuite.sh b/testsuite/gna/bug0134/testsuite.sh new file mode 100755 index 000000000..e2ee40cdf --- /dev/null +++ b/testsuite/gna/bug0134/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze test_logic.vhdl +elab_simulate test_logic + +clean + +echo "Test successful" |