aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1231
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-16 19:46:56 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-16 20:40:21 +0200
commit3bff44b2a3bd094ef6b0f69f4548a32250d80d22 (patch)
treef37e30518adc06bb2953df46a7d9daa7b4250429 /testsuite/synth/issue1231
parentc35ee25d5465d5c3f542c5d2e4b1e490661c577e (diff)
downloadghdl-3bff44b2a3bd094ef6b0f69f4548a32250d80d22.tar.gz
ghdl-3bff44b2a3bd094ef6b0f69f4548a32250d80d22.tar.bz2
ghdl-3bff44b2a3bd094ef6b0f69f4548a32250d80d22.zip
testsuite/synth: add case from #1231
Diffstat (limited to 'testsuite/synth/issue1231')
-rwxr-xr-xtestsuite/synth/issue1231/testsuite.sh8
-rw-r--r--testsuite/synth/issue1231/top.vhdl60
-rw-r--r--testsuite/synth/issue1231/top2.vhdl16
-rw-r--r--testsuite/synth/issue1231/top3.vhdl16
4 files changed, 100 insertions, 0 deletions
diff --git a/testsuite/synth/issue1231/testsuite.sh b/testsuite/synth/issue1231/testsuite.sh
new file mode 100755
index 000000000..5dacb147c
--- /dev/null
+++ b/testsuite/synth/issue1231/testsuite.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth_failure top.vhdl -e
+synth_failure top3.vhdl -e
+
+echo "Test successful"
diff --git a/testsuite/synth/issue1231/top.vhdl b/testsuite/synth/issue1231/top.vhdl
new file mode 100644
index 000000000..5292ada0c
--- /dev/null
+++ b/testsuite/synth/issue1231/top.vhdl
@@ -0,0 +1,60 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity SINGLE_SRL is
+ generic (SRL_WIDTH : integer := 24);
+ port (
+ clk : in std_logic;
+ inp : in std_logic;
+ outp : out std_logic);
+end SINGLE_SRL;
+
+architecture beh of SINGLE_SRL is
+ signal shift_reg : std_logic_vector (SRL_WIDTH-1 downto 0);
+begin
+ assert SRL_WIDTH <= 17
+ report "The size of Shift Register exceeds the size of a single SRL"
+ severity FAILURE;
+
+ process (clk)
+ begin
+ if rising_edge(clk) then
+ shift_reg <= shift_reg (SRL_WIDTH-2 downto 0) & inp;
+ end if;
+ end process;
+
+ outp <= shift_reg(SRL_WIDTH-1);
+end beh;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity TOP is
+ port (
+ clk : in std_logic;
+ inp1, inp2 : in std_logic;
+ outp1, outp2 : out std_logic);
+end TOP;
+
+architecture beh of TOP is
+ component SINGLE_SRL is
+ generic (SRL_WIDTH : integer := 16);
+ port(
+ clk : in std_logic;
+ inp : in std_logic;
+ outp : out std_logic);
+ end component;
+begin
+ inst1: SINGLE_SRL
+ generic map (SRL_WIDTH => 13)
+ port map(
+ clk => clk,
+ inp => inp1,
+ outp => outp1 );
+ inst2: SINGLE_SRL
+ generic map (SRL_WIDTH => 18)
+ port map(
+ clk => clk,
+ inp => inp2,
+ outp => outp2 );
+end beh;
diff --git a/testsuite/synth/issue1231/top2.vhdl b/testsuite/synth/issue1231/top2.vhdl
new file mode 100644
index 000000000..9779c31d9
--- /dev/null
+++ b/testsuite/synth/issue1231/top2.vhdl
@@ -0,0 +1,16 @@
+
+entity top2 is
+ generic (
+ ok : boolean := false
+ );
+ port (
+ clk : in bit;
+ inp : in bit;
+ outp : out bit);
+end;
+
+architecture beh of top2 is
+begin
+ assert ok report "my assert message";
+ outp <= inp;
+end beh;
diff --git a/testsuite/synth/issue1231/top3.vhdl b/testsuite/synth/issue1231/top3.vhdl
new file mode 100644
index 000000000..356b95193
--- /dev/null
+++ b/testsuite/synth/issue1231/top3.vhdl
@@ -0,0 +1,16 @@
+
+entity top3 is
+ generic (
+ ok : boolean := false
+ );
+ port (
+ clk : in bit;
+ inp : in bit;
+ outp : out bit);
+end;
+
+architecture beh of top3 is
+begin
+ assert ok report "my assert message, value:" & bit'image(inp);
+ outp <= inp;
+end beh;