From b34dde4a816690a4f0daa2994452033c4172dfb8 Mon Sep 17 00:00:00 2001 From: "Ille, Ondrej, Ing" Date: Fri, 13 Jul 2018 16:48:59 +0200 Subject: [PATCH] Added more explicit type-cast --- src/CAN_Core/core_top.vhd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/CAN_Core/core_top.vhd b/src/CAN_Core/core_top.vhd index eccb4d1e..d281f403 100644 --- a/src/CAN_Core/core_top.vhd +++ b/src/CAN_Core/core_top.vhd @@ -1125,14 +1125,19 @@ begin if (drv_set_rx_ctr = '1') then rx_counter <= drv_set_ctr_val; - elsif(rec_valid='1')then - rx_counter <= std_logic_vector(unsigned(rx_counter) + 1); + elsif (rec_valid = '1') then + rx_counter <= std_logic_vector(unsigned( + to_integer(unsigned(rx_counter)) + 1, + rx_counter'length)); + end if; if (drv_set_tx_ctr = '1') then tx_counter <= drv_set_ctr_val; elsif (tran_valid = '1') then - tx_counter <= std_logic_vector(unsigned(tx_counter) + 1); + tx_counter <= std_logic_vector(unsigned( + to_integer(unsigned(tx_counter)) + 1, + tx_counter'length)); end if; end if; -- GitLab