Skip to content
Snippets Groups Projects
Commit 03ad8145 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Improve logging.

parent 5d52637d
No related branches found
No related tags found
1 merge request!288Resolve L2SDP-836
...@@ -45,8 +45,9 @@ USE work.tb_eth_tester_pkg.ALL; ...@@ -45,8 +45,9 @@ USE work.tb_eth_tester_pkg.ALL;
ENTITY tb_eth_tester IS ENTITY tb_eth_tester IS
GENERIC ( GENERIC (
g_tb_index : NATURAL := 0; -- use to incremental delay logging from tb instances in tb_tb
g_tb_str : STRING := ""; -- use to distinguish logging from tb instances in tb_tb g_tb_str : STRING := ""; -- use to distinguish logging from tb instances in tb_tb
g_nof_streams : NATURAL := 1; g_nof_streams : NATURAL := 2;
-- t_diag_block_gen_integer = -- t_diag_block_gen_integer =
-- sl: enable -- sl: enable
...@@ -220,6 +221,10 @@ BEGIN ...@@ -220,6 +221,10 @@ BEGIN
proc_common_wait_some_cycles(st_clk, c_sync_period_max); proc_common_wait_some_cycles(st_clk, c_sync_period_max);
stimuli_end <= '1'; stimuli_end <= '1';
-- Dealy logging between different tb instances
proc_common_wait_some_cycles(st_clk, g_tb_index * 100);
print_str(""); -- log empty line between tb results
------------------------------------------------------------------------- -------------------------------------------------------------------------
-- Verification: Total nof Tx packets = total nof Rx packets -- Verification: Total nof Tx packets = total nof Rx packets
------------------------------------------------------------------------- -------------------------------------------------------------------------
...@@ -230,46 +235,21 @@ BEGIN ...@@ -230,46 +235,21 @@ BEGIN
proc_mem_mm_bus_rd(v_offset + 0, mm_clk, reg_strobe_total_count_tx_cipo, reg_strobe_total_count_tx_copi); proc_mem_mm_bus_rd(v_offset + 0, mm_clk, reg_strobe_total_count_tx_cipo, reg_strobe_total_count_tx_copi);
proc_mem_mm_bus_rd_latency(1, mm_clk); proc_mem_mm_bus_rd_latency(1, mm_clk);
tx_total_count_nof_packets_arr(I) <= TO_UINT(reg_strobe_total_count_tx_cipo.rddata(c_word_w-1 DOWNTO 0)); tx_total_count_nof_packets_arr(I) <= TO_UINT(reg_strobe_total_count_tx_cipo.rddata(c_word_w-1 DOWNTO 0));
proc_common_wait_some_cycles(mm_clk, 1);
ASSERT tx_total_count_nof_packets_arr(I) = exp_total_count_nof_packets_arr(I) REPORT g_tb_str &
"Wrong Tx total nof packets count(" & NATURAL'IMAGE(I) &
"), Tx count = " & NATURAL'IMAGE(tx_total_count_nof_packets_arr(I)) &
" /= " & NATURAL'IMAGE(exp_total_count_nof_packets_arr(I)) &
" = Expected count" SEVERITY ERROR;
-- Rx total nof packets -- Rx total nof packets
proc_mem_mm_bus_rd(v_offset + 0, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi); proc_mem_mm_bus_rd(v_offset + 0, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi);
proc_mem_mm_bus_rd_latency(1, mm_clk); proc_mem_mm_bus_rd_latency(1, mm_clk);
rx_total_count_nof_packets_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0)); rx_total_count_nof_packets_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0));
proc_common_wait_some_cycles(mm_clk, 1);
ASSERT rx_total_count_nof_packets_arr(I) = exp_total_count_nof_packets_arr(I) REPORT g_tb_str &
"Wrong Rx total nof packets count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_packets_arr(I)) &
" /= " & NATURAL'IMAGE(exp_total_count_nof_packets_arr(I)) &
" = Expected count" SEVERITY ERROR;
-- Rx total nof valids -- Rx total nof valids
proc_mem_mm_bus_rd(v_offset + 2, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi); proc_mem_mm_bus_rd(v_offset + 2, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi);
proc_mem_mm_bus_rd_latency(1, mm_clk); proc_mem_mm_bus_rd_latency(1, mm_clk);
rx_total_count_nof_valids_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0)); rx_total_count_nof_valids_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0));
proc_common_wait_some_cycles(mm_clk, 1);
ASSERT rx_total_count_nof_valids_arr(I) = rx_exp_total_count_nof_valids_arr(I) REPORT g_tb_str &
"Wrong Rx total nof valids count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_valids_arr(I)) &
" /= " & NATURAL'IMAGE(rx_exp_total_count_nof_valids_arr(I)) &
" = Expected count" SEVERITY ERROR;
-- Rx total nof corrupted -- Rx total nof corrupted
proc_mem_mm_bus_rd(v_offset + 4, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi); proc_mem_mm_bus_rd(v_offset + 4, mm_clk, reg_strobe_total_count_rx_cipo, reg_strobe_total_count_rx_copi);
proc_mem_mm_bus_rd_latency(1, mm_clk); proc_mem_mm_bus_rd_latency(1, mm_clk);
rx_total_count_nof_corrupted_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0)); rx_total_count_nof_corrupted_arr(I) <= TO_UINT(reg_strobe_total_count_rx_cipo.rddata(c_word_w-1 DOWNTO 0));
proc_common_wait_some_cycles(mm_clk, 1); proc_common_wait_some_cycles(mm_clk, 1);
ASSERT rx_total_count_nof_corrupted_arr(I) = rx_exp_total_count_nof_corrupted_arr(I) REPORT g_tb_str &
"Wrong Rx total nof corrupted count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_corrupted_arr(I)) &
" /= " & NATURAL'IMAGE(rx_exp_total_count_nof_corrupted_arr(I)) &
" = Expected count" SEVERITY ERROR;
-- Print logging
print_str(g_tb_str & print_str(g_tb_str &
"Tx total counts monitor(" & NATURAL'IMAGE(I) & ") :" & "Tx total counts monitor(" & NATURAL'IMAGE(I) & ") :" &
" nof_packets = " & NATURAL'IMAGE(tx_total_count_nof_packets_arr(I))); " nof_packets = " & NATURAL'IMAGE(tx_total_count_nof_packets_arr(I)));
...@@ -280,6 +260,30 @@ BEGIN ...@@ -280,6 +260,30 @@ BEGIN
", nof_valids = " & NATURAL'IMAGE(rx_total_count_nof_valids_arr(I)) & ", nof_valids = " & NATURAL'IMAGE(rx_total_count_nof_valids_arr(I)) &
", nof_corrupted = " & NATURAL'IMAGE(rx_total_count_nof_corrupted_arr(I))); ", nof_corrupted = " & NATURAL'IMAGE(rx_total_count_nof_corrupted_arr(I)));
-- Verify, only log when wrong
ASSERT tx_total_count_nof_packets_arr(I) = exp_total_count_nof_packets_arr(I) REPORT g_tb_str &
"Wrong Tx total nof packets count(" & NATURAL'IMAGE(I) &
"), Tx count = " & NATURAL'IMAGE(tx_total_count_nof_packets_arr(I)) &
" /= " & NATURAL'IMAGE(exp_total_count_nof_packets_arr(I)) &
" = Expected count" SEVERITY ERROR;
ASSERT rx_total_count_nof_packets_arr(I) = exp_total_count_nof_packets_arr(I) REPORT g_tb_str &
"Wrong Rx total nof packets count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_packets_arr(I)) &
" /= " & NATURAL'IMAGE(exp_total_count_nof_packets_arr(I)) &
" = Expected count" SEVERITY ERROR;
ASSERT rx_total_count_nof_valids_arr(I) = rx_exp_total_count_nof_valids_arr(I) REPORT g_tb_str &
"Wrong Rx total nof valids count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_valids_arr(I)) &
" /= " & NATURAL'IMAGE(rx_exp_total_count_nof_valids_arr(I)) &
" = Expected count" SEVERITY ERROR;
ASSERT rx_total_count_nof_corrupted_arr(I) = rx_exp_total_count_nof_corrupted_arr(I) REPORT g_tb_str &
"Wrong Rx total nof corrupted count(" & NATURAL'IMAGE(I) &
"), Rx count = " & NATURAL'IMAGE(rx_total_count_nof_corrupted_arr(I)) &
" /= " & NATURAL'IMAGE(rx_exp_total_count_nof_corrupted_arr(I)) &
" = Expected count" SEVERITY ERROR;
END LOOP; END LOOP;
------------------------------------------------------------------------- -------------------------------------------------------------------------
...@@ -312,6 +316,7 @@ BEGIN ...@@ -312,6 +316,7 @@ BEGIN
rx_mon_latency_arr(I) <= TO_UINT(reg_bsn_monitor_v2_rx_cipo.rddata(c_word_w-1 DOWNTO 0)); rx_mon_latency_arr(I) <= TO_UINT(reg_bsn_monitor_v2_rx_cipo.rddata(c_word_w-1 DOWNTO 0));
proc_common_wait_some_cycles(mm_clk, 1); proc_common_wait_some_cycles(mm_clk, 1);
-- Print logging
print_str(g_tb_str & print_str(g_tb_str &
"Tx BSN monitor(" & NATURAL'IMAGE(I) & ") :" & "Tx BSN monitor(" & NATURAL'IMAGE(I) & ") :" &
" nof_sop = " & NATURAL'IMAGE(tx_mon_nof_sop_arr(I)) & " nof_sop = " & NATURAL'IMAGE(tx_mon_nof_sop_arr(I)) &
...@@ -324,19 +329,20 @@ BEGIN ...@@ -324,19 +329,20 @@ BEGIN
", nof_valid = " & NATURAL'IMAGE(rx_mon_nof_valid_arr(I)) & ", nof_valid = " & NATURAL'IMAGE(rx_mon_nof_valid_arr(I)) &
", latency = " & NATURAL'IMAGE(rx_mon_latency_arr(I))); ", latency = " & NATURAL'IMAGE(rx_mon_latency_arr(I)));
-- Verify, only log when wrong
IF I = 0 THEN IF I = 0 THEN
ASSERT tx_mon_nof_sop_arr(I) = c_mon_nof_sop_first REPORT g_tb_str & "Wrong tx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT tx_mon_nof_sop_arr(I) = c_mon_nof_sop_first REPORT g_tb_str & "Wrong tx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_nof_sop_arr(I) = c_mon_nof_sop_first REPORT g_tb_str & "Wrong rx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT rx_mon_nof_sop_arr(I) = c_mon_nof_sop_first REPORT g_tb_str & "Wrong rx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT tx_mon_nof_valid_arr(I) = c_mon_nof_valid_first_tx REPORT g_tb_str & "Wrong tx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT tx_mon_nof_valid_arr(I) = c_mon_nof_valid_first_tx REPORT g_tb_str & "Wrong tx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_nof_valid_arr(I) = c_mon_nof_valid_first_rx REPORT g_tb_str & "Wrong rx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT rx_mon_nof_valid_arr(I) = c_mon_nof_valid_first_rx REPORT g_tb_str & "Wrong rx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT tx_mon_latency_arr(I) = 0 REPORT g_tb_str & "Wrong tx latency for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ELSE ELSE
ASSERT tx_mon_nof_sop_arr(I) = c_mon_nof_sop_others REPORT g_tb_str & "Wrong tx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT tx_mon_nof_sop_arr(I) = c_mon_nof_sop_others REPORT g_tb_str & "Wrong tx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_nof_sop_arr(I) = c_mon_nof_sop_others REPORT g_tb_str & "Wrong rx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT rx_mon_nof_sop_arr(I) = c_mon_nof_sop_others REPORT g_tb_str & "Wrong rx nof_sop for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT tx_mon_nof_valid_arr(I) = c_mon_nof_valid_others_tx REPORT g_tb_str & "Wrong tx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT tx_mon_nof_valid_arr(I) = c_mon_nof_valid_others_tx REPORT g_tb_str & "Wrong tx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_nof_valid_arr(I) = c_mon_nof_valid_others_rx REPORT g_tb_str & "Wrong rx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR; ASSERT rx_mon_nof_valid_arr(I) = c_mon_nof_valid_others_rx REPORT g_tb_str & "Wrong rx nof_valid for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_latency_arr(I) = 22 REPORT g_tb_str & "Wrong rx latency for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
END IF; END IF;
ASSERT tx_mon_latency_arr(I) = 0 REPORT g_tb_str & "Wrong tx latency for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
ASSERT rx_mon_latency_arr(I) = 27 REPORT g_tb_str & "Wrong rx latency for stream (" & NATURAL'IMAGE(I) & ")" SEVERITY ERROR;
END LOOP; END LOOP;
------------------------------------------------------------------------- -------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment