diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-06 18:32:46 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-06 20:10:58 +0200 |
commit | 836edf21a42e2a7a0b085214817ae6b1d2699237 (patch) | |
tree | 9e971a4c694ac6063232080717f32b66034145a7 /testsuite | |
parent | b554bd141fa6588c99eaad567fd7f09357f03569 (diff) | |
download | ghdl-836edf21a42e2a7a0b085214817ae6b1d2699237.tar.gz ghdl-836edf21a42e2a7a0b085214817ae6b1d2699237.tar.bz2 ghdl-836edf21a42e2a7a0b085214817ae6b1d2699237.zip |
testsuite/synth: add test for #1197
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/synth/issue1197/generics_1.vhdl | 46 | ||||
-rwxr-xr-x | testsuite/synth/issue1197/testsuite.sh | 9 |
2 files changed, 55 insertions, 0 deletions
diff --git a/testsuite/synth/issue1197/generics_1.vhdl b/testsuite/synth/issue1197/generics_1.vhdl new file mode 100644 index 000000000..197e2656a --- /dev/null +++ b/testsuite/synth/issue1197/generics_1.vhdl @@ -0,0 +1,46 @@ +library IEEE; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_unsigned.all; + +entity addern is + generic( + width : integer := 8 + ); + port( + A, B : in std_logic_vector(width - 1 downto 0); + Y : out std_logic_vector(width - 1 downto 0) + ); +end addern; + +architecture bhv of addern is +begin + Y <= A + B; +end bhv; + +Library IEEE; +use IEEE.std_logic_1164.all; + +entity generics_1 is + port( + X, Y, Z : in std_logic_vector(12 downto 0); + A, B : in std_logic_vector(4 downto 0); + S : out std_logic_vector(17 downto 0)); +end generics_1; + +architecture bhv of generics_1 is + component addern + generic(width : integer := 8); + port( + A, B : in std_logic_vector(width - 1 downto 0); + Y : out std_logic_vector(width - 1 downto 0)); + end component; + for all : addern use entity work.addern(bhv); + + signal C1 : std_logic_vector(12 downto 0); + signal C2, C3 : std_logic_vector(17 downto 0); +begin + U1 : addern generic map(width => 13) port map(X, Y, C1); + C2 <= C1 & A; + C3 <= Z & B; + U2 : addern generic map(width => 18) port map(C2, C3, S); +end bhv; diff --git a/testsuite/synth/issue1197/testsuite.sh b/testsuite/synth/issue1197/testsuite.sh new file mode 100755 index 000000000..e8d483a35 --- /dev/null +++ b/testsuite/synth/issue1197/testsuite.sh @@ -0,0 +1,9 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=-fsynopsys +synth_analyze generics_1 +clean + +echo "Test successful" |