rtl: update accum to support real cases

This commit is contained in:
Phil
2026-04-28 13:13:27 +03:00
parent 264c9ecb8e
commit e083cd5c2e
3 changed files with 173 additions and 176 deletions

View File

@ -4,11 +4,11 @@ module tb_accumulator_top;
localparam DATA_WIDTH = 12;
localparam ACCUM_WIDTH = 32;
localparam N_MAX = 256;
localparam WINDOW_SIZE = 4;
localparam PACKET_SIZE = 128;
localparam N_MAX = 4096;
localparam WINDOW_SIZE = 65;
localparam PACKET_SIZE = 1024;
localparam READ_BATCH_SIZE = (PACKET_SIZE*8)/ACCUM_WIDTH;
localparam MAX_WORDS = N_MAX / WINDOW_SIZE;
localparam MAX_WORDS = N_MAX;
localparam MAX_SEQ_NUM = 64;
logic clk_in;
@ -147,7 +147,7 @@ module tb_accumulator_top;
input integer base_value,
input string test_name
);
logic [DATA_WIDTH-1:0] sample_mem [0:MAX_SEQ_NUM-1][0:N_MAX-1];
logic [DATA_WIDTH-1:0] sample_mem [0:MAX_SEQ_NUM-1][0:(N_MAX*WINDOW_SIZE)-1];
integer seq_idx;
integer sample_idx;
integer word_idx;
@ -213,7 +213,7 @@ module tb_accumulator_top;
end
timeout_cnt = 0;
while (packets_seen < exp_packet_count && timeout_cnt < 30000) begin
while (packets_seen < exp_packet_count && timeout_cnt < 50 * PACKET_SIZE) begin
@(posedge eth_clk_in);
timeout_cnt = timeout_cnt + 1;
end
@ -318,12 +318,14 @@ module tb_accumulator_top;
reset_dut();
run_test(1, 2, 8, 1'b0, 1, "deterministic_small");
run_test(2, 3, 8, 1'b1, 0, "random_seq3_smp8");
run_test(3, 5, 16, 1'b1, 0, "random_seq5_smp16_multi_packet");
run_test(1, 1, 1 * WINDOW_SIZE, 1'b0, 1, "deterministic_small");
// $finish;
run_test(2, 2, 1 * WINDOW_SIZE, 1'b1, 0, "random_seq3_smp8");
run_test(3, 1, 16 * WINDOW_SIZE, 1'b1, 0, "random_seq5_smp16_multi_packet");
// run_test(4, 1, 4, 1'b1, 0, "random_single_window");
run_test(5, 7, 12, 1'b1, 0, "random_seq7_smp12");
run_test(6, 4, 256, 1'b1, 0, "random_max_smpnum");
run_test(5, 2, 12 * WINDOW_SIZE, 1'b1, 0, "random_seq7_smp12");
run_test(6, 4, 256 * WINDOW_SIZE, 1'b1, 0, "random_max_smpnum");
run_test(7, 2, 1500 * WINDOW_SIZE, 1'b1, 0, "random_max_smpnum2");
$display("\n========================================");
$display("ALL TESTS COMPLETED");