aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1080/repro3.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/synth/issue1080/repro3.vhdl')
-rw-r--r--testsuite/synth/issue1080/repro3.vhdl33
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/synth/issue1080/repro3.vhdl b/testsuite/synth/issue1080/repro3.vhdl
new file mode 100644
index 000000000..252f705c8
--- /dev/null
+++ b/testsuite/synth/issue1080/repro3.vhdl
@@ -0,0 +1,33 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity repro3 is
+ port (
+ clk : std_logic;
+ led : out std_logic);
+end;
+
+architecture behav of repro3 is
+ constant LOOKUP_LEN : integer := 6;
+ constant LOOKUP_TABLE : unsigned(LOOKUP_LEN*8-1 downto 0) :=
+ x"010205" & x"060708";
+
+ signal brt : unsigned(7 downto 0) := (others => '0');
+
+begin
+ led <= brt (0);
+ lookup_p : process(Clk)
+ variable idx : integer range 0 to LOOKUP_LEN-1 := LOOKUP_LEN-1;
+ begin
+ if rising_edge(Clk) then
+ brt <= lookup_table(8*idx+7 downto 8*idx);
+
+ if idx /= 0 then
+ idx := idx - 1;
+ else
+ idx := LOOKUP_LEN-1;
+ end if;
+ end if;
+ end process;
+end behav;