diff --git a/libraries/dsp/st/tb/vhdl/tb_st_histogram.vhd b/libraries/dsp/st/tb/vhdl/tb_st_histogram.vhd index df823cd06f2fc0025c70e5b58473168a15b0858a..3f991dcef2467eeb7570104710502edaf993d0a5 100644 --- a/libraries/dsp/st/tb/vhdl/tb_st_histogram.vhd +++ b/libraries/dsp/st/tb/vhdl/tb_st_histogram.vhd @@ -90,6 +90,7 @@ architecture tb of tb_st_histogram is constant c_nof_levels_per_bin : natural := (2**g_data_w) / g_nof_bins; -- e.g. 2 values per bin if g_data_w=9 (512 levels) and g_nof_bins=256 constant c_ram_dat_w : natural := ceil_log2(g_nof_data_per_sync + 1); constant c_ram_adr_w : natural := ceil_log2(g_nof_bins); + constant c_sum_delta : natural := largest(g_nof_data_per_sync / 100, 1); -- 1 % margin --------------------------------------------------------------------------- -- Clocks and resets @@ -342,6 +343,9 @@ begin if i > 0 then -- Skip sync 0 (histogram still all zeros) assert sum_of_bins = g_nof_data_per_sync report "Sum of bins not equal to g_nof_data_per_sync (expected " & integer'image(g_nof_data_per_sync) & ", actual " & integer'image(sum_of_bins) & ")" + severity WARNING; -- Delta caused by block RAM mixed_port_feed_through_mode = DONT_CARE and wr and rd access at same address + assert almost_equal(sum_of_bins, g_nof_data_per_sync, c_sum_delta) + report "Sum of bins not within g_nof_data_per_sync +- c_sum_delta (expected " & integer'image(g_nof_data_per_sync) & ", actual " & integer'image(sum_of_bins) & ")" severity ERROR; end if; end loop;