From 87ef826ad2669ea7d94fff7e8985f097363cc4ec Mon Sep 17 00:00:00 2001 From: Xiretza Date: Mon, 20 Jun 2022 11:43:29 +0200 Subject: [PATCH] fix: work around ghdl#2102 https://github.com/ghdl/ghdl/issues/2102 --- vhdl/splink.vhdl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vhdl/splink.vhdl b/vhdl/splink.vhdl index 6e98735..8ab676d 100644 --- a/vhdl/splink.vhdl +++ b/vhdl/splink.vhdl @@ -184,11 +184,16 @@ begin -- workaround for ghdl#2078 if reset = '0' and udp_valid = '1' and receive_state = DATA then - if input_bank = BANK_A then - strand_buffer_a(pixels_received)((active_strand+1) * BITS_PER_LED - 1 downto active_strand * BITS_PER_LED) := udp_data(23 downto 0); - else - strand_buffer_b(pixels_received)((active_strand+1) * BITS_PER_LED - 1 downto active_strand * BITS_PER_LED) := udp_data(23 downto 0); - end if; + -- workaround for ghdl#2102 + for i in 0 to NUM_STRANDS-1 loop + if i = active_strand then + if input_bank = BANK_A then + strand_buffer_a(pixels_received)((i+1) * BITS_PER_LED - 1 downto i * BITS_PER_LED) := udp_data(23 downto 0); + else + strand_buffer_b(pixels_received)((i+1) * BITS_PER_LED - 1 downto i * BITS_PER_LED) := udp_data(23 downto 0); + end if; + end if; + end loop; end if; end if; end process;