aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-13 18:57:25 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-13 18:57:25 +0100
commit48507cf59e5490af0125e483ef77ad4d0dec4177 (patch)
treed7da9b8058a5504623bd4d1ed32978ce9290a97d /testsuite
parent48a142fc1625dc7ecb1602f3dbd46882e53d96a6 (diff)
downloadghdl-48507cf59e5490af0125e483ef77ad4d0dec4177.tar.gz
ghdl-48507cf59e5490af0125e483ef77ad4d0dec4177.tar.bz2
ghdl-48507cf59e5490af0125e483ef77ad4d0dec4177.zip
testsuite/synth: add a test for previous change.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/uassoc01/tb_uassoc03.vhdl23
-rwxr-xr-xtestsuite/synth/uassoc01/testsuite.sh2
-rw-r--r--testsuite/synth/uassoc01/uassoc03.vhdl39
3 files changed, 63 insertions, 1 deletions
diff --git a/testsuite/synth/uassoc01/tb_uassoc03.vhdl b/testsuite/synth/uassoc01/tb_uassoc03.vhdl
new file mode 100644
index 000000000..8c9733a64
--- /dev/null
+++ b/testsuite/synth/uassoc01/tb_uassoc03.vhdl
@@ -0,0 +1,23 @@
+entity tb_uassoc03 is
+end tb_uassoc03;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_uassoc03 is
+ signal i1 : std_logic_vector(3 downto 0);
+ signal i2 : std_logic_vector(7 downto 0);
+ signal o : std_logic_vector(3 downto 0);
+begin
+ dut: entity work.uassoc03
+ port map (i1, i2, o);
+
+ process
+ begin
+ i1 <= "1100";
+ i2 <= b"1010_1010";
+ wait for 1 ns;
+ assert o = "0110" severity failure;
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/synth/uassoc01/testsuite.sh b/testsuite/synth/uassoc01/testsuite.sh
index f9e7f9e51..d82ae495d 100755
--- a/testsuite/synth/uassoc01/testsuite.sh
+++ b/testsuite/synth/uassoc01/testsuite.sh
@@ -2,7 +2,7 @@
. ../../testenv.sh
-for t in uassoc01 uassoc02; do
+for t in uassoc01 uassoc02 uassoc03; do
analyze $t.vhdl tb_$t.vhdl
elab_simulate tb_$t
clean
diff --git a/testsuite/synth/uassoc01/uassoc03.vhdl b/testsuite/synth/uassoc01/uassoc03.vhdl
new file mode 100644
index 000000000..c91d8334d
--- /dev/null
+++ b/testsuite/synth/uassoc01/uassoc03.vhdl
@@ -0,0 +1,39 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity uassoc03_sub is
+ port (i : std_logic_vector;
+ o : out std_logic_vector);
+end uassoc03_sub;
+
+architecture behav of uassoc03_sub is
+begin
+ o <= not i;
+end behav;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity uassoc03 is
+ port (i1 : std_logic_vector(3 downto 0);
+ i2 : std_logic_vector(7 downto 0);
+ o : out std_logic_vector(3 downto 0));
+end uassoc03;
+
+architecture rtl of uassoc03 is
+ component uassoc03_sub is
+ port (i : std_logic_vector;
+ o : out std_logic_vector);
+ end component;
+
+ signal o1: std_logic_vector(3 downto 0);
+ signal o2: std_logic_vector(3 downto 0);
+begin
+ dut1: uassoc03_sub
+ port map (i => i1, o => o1);
+
+ dut2: uassoc03_sub
+ port map (i => i2 (3 downto 0), o => o2);
+
+ o <= o1 xor o2;
+end rtl;