From 8d53413036308d0a253881fc26e09f89f067b9ec Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 21 May 2020 21:44:57 +0200 Subject: testsuite/synth: add a test for #1332 --- testsuite/synth/issue1332/rom_constant.vhdl | 28 ++++++++++++++++++++++++++++ testsuite/synth/issue1332/testsuite.sh | 8 ++++++++ 2 files changed, 36 insertions(+) create mode 100644 testsuite/synth/issue1332/rom_constant.vhdl create mode 100755 testsuite/synth/issue1332/testsuite.sh (limited to 'testsuite/synth') diff --git a/testsuite/synth/issue1332/rom_constant.vhdl b/testsuite/synth/issue1332/rom_constant.vhdl new file mode 100644 index 000000000..2812aac3d --- /dev/null +++ b/testsuite/synth/issue1332/rom_constant.vhdl @@ -0,0 +1,28 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity rom_constant is + port ( + clk : in std_logic; + a : out std_logic_vector(7 downto 0) + ); +end rom_constant; + +architecture rtl of rom_constant is + constant C_IEND : std_logic_vector(12*8-1 downto 0) := (others => '1'); + signal index : integer := 0; +begin + process(clk) + begin + if rising_edge(clk) then + a <= C_IEND(index*8-1 downto (index-1)*8); + + if index < 12 then + index <= index + 1; + else + index <= 0; + end if; + end if; + end process; +end rtl; + diff --git a/testsuite/synth/issue1332/testsuite.sh b/testsuite/synth/issue1332/testsuite.sh new file mode 100755 index 000000000..c846c4bad --- /dev/null +++ b/testsuite/synth/issue1332/testsuite.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. ../../testenv.sh + +synth_analyze rom_constant +clean + +echo "Test successful" -- cgit v1.2.3