From e7c32e484339a664c0d0db4077a89820b3850610 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Wed, 11 Mar 2015 08:19:34 +0000
Subject: [PATCH] Use natural init values instead of integer to avoid issues
 with TO_UINT() and limited 32 bit VHDL integer range. Adjust v_sosi.data by
 -g_pkt_len instead of -1 to have first data with value g_data_init.

---
 libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd b/libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
index f7ac7bf079..cbaeb5aa50 100644
--- a/libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
+++ b/libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
@@ -48,10 +48,10 @@ ENTITY dp_stream_stimuli IS
     -- initializations
     g_sync_period    : NATURAL := 10;
     g_sync_offset    : NATURAL := 7;
-    g_data_init      : INTEGER := -1;
+    g_data_init      : NATURAL := 0;
     g_bsn_init       : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0) := X"0000000000000000";  -- X"0877665544332211"
     g_err_init       : NATURAL := 247;
-    g_channel_init   : INTEGER := 5;  -- fixed
+    g_channel_init   : NATURAL := 5;  -- fixed
     -- specific
     g_in_dat_w       : NATURAL := 32;
     g_nof_repeat     : NATURAL := 5;
@@ -117,7 +117,7 @@ BEGIN
     -- Adjust initial sosi field values by -1 to compensate for auto increment
     v_sosi.bsn     := INCR_UVEC(g_bsn_init,                    -1);
     v_sosi.channel := INCR_UVEC(TO_DP_CHANNEL(g_channel_init), -1);
-    v_sosi.data    := INCR_UVEC(TO_DP_DATA(g_data_init),       -1);
+    v_sosi.data    := INCR_UVEC(TO_DP_DATA(g_data_init),       -g_pkt_len);
     v_sosi.err     := INCR_UVEC(TO_DP_ERROR(g_err_init),       -1);
     
     i_src_out <= c_dp_sosi_rst;
-- 
GitLab