aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue2279
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-12-22 08:09:08 +0100
committerTristan Gingold <tgingold@free.fr>2022-12-22 08:09:08 +0100
commitf05bbd02f16d3368e9c171a7f42a08f26219262d (patch)
treeb997a17b4678eaa63e5d9adcaba62cfade8a6040 /testsuite/synth/issue2279
parent236f7eddef51acba2718eeda8431a1a68c7e231e (diff)
downloadghdl-f05bbd02f16d3368e9c171a7f42a08f26219262d.tar.gz
ghdl-f05bbd02f16d3368e9c171a7f42a08f26219262d.tar.bz2
ghdl-f05bbd02f16d3368e9c171a7f42a08f26219262d.zip
testsuite/synth: add a test for #2279
Diffstat (limited to 'testsuite/synth/issue2279')
-rw-r--r--testsuite/synth/issue2279/aggr1.vhdl17
-rw-r--r--testsuite/synth/issue2279/ent.vhdl18
-rw-r--r--testsuite/synth/issue2279/tb_aggr1.vhdl29
-rwxr-xr-xtestsuite/synth/issue2279/testsuite.sh11
4 files changed, 75 insertions, 0 deletions
diff --git a/testsuite/synth/issue2279/aggr1.vhdl b/testsuite/synth/issue2279/aggr1.vhdl
new file mode 100644
index 000000000..13a224d55
--- /dev/null
+++ b/testsuite/synth/issue2279/aggr1.vhdl
@@ -0,0 +1,17 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity aggr1 is
+ generic(
+ DATA_WIDTH : integer := 8
+ );
+ port (a : out std_logic_vector(DATA_WIDTH-1 downto 0);
+ b : out std_logic;
+ c : std_logic_vector(DATA_WIDTH+1-1 downto 0));
+end;
+
+architecture arch of aggr1 is
+begin
+ (a, b) <= c;
+end;
+
diff --git a/testsuite/synth/issue2279/ent.vhdl b/testsuite/synth/issue2279/ent.vhdl
new file mode 100644
index 000000000..6c33c60d3
--- /dev/null
+++ b/testsuite/synth/issue2279/ent.vhdl
@@ -0,0 +1,18 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity ent is
+ generic(
+ DATA_WIDTH : integer := 8
+ );
+end;
+
+architecture arch of ent is
+ signal a : std_logic_vector(DATA_WIDTH-1 downto 0);
+ signal b : std_logic;
+ signal c : std_logic_vector(DATA_WIDTH+1-1 downto 0);
+begin
+ (a, b) <= c;
+end;
+
diff --git a/testsuite/synth/issue2279/tb_aggr1.vhdl b/testsuite/synth/issue2279/tb_aggr1.vhdl
new file mode 100644
index 000000000..60ba4c559
--- /dev/null
+++ b/testsuite/synth/issue2279/tb_aggr1.vhdl
@@ -0,0 +1,29 @@
+entity tb_aggr1 is
+end tb_aggr1;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_aggr1 is
+ signal a : std_logic_vector(7 downto 0);
+ signal b : std_logic;
+ signal c : std_logic_vector(8 downto 0);
+begin
+ dut: entity work.aggr1
+ port map (a, b, c);
+
+ process
+ begin
+ c <= b"1_1100_0011";
+ wait for 1 ns;
+ assert a = x"e1" severity failure;
+ assert b = '1' severity failure;
+
+ c <= b"0_1100_0100";
+ wait for 1 ns;
+ assert a = x"62" severity failure;
+ assert b = '0' severity failure;
+
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/synth/issue2279/testsuite.sh b/testsuite/synth/issue2279/testsuite.sh
new file mode 100755
index 000000000..74c928a61
--- /dev/null
+++ b/testsuite/synth/issue2279/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+
+synth_only ent
+
+synth_tb aggr1
+
+echo "Test successful"