Implement discrete dynamic NEAR ladder strategy

This commit is contained in:
2026-04-16 19:40:36 +08:00
parent e4fdbdfeec
commit 7c56def929
5 changed files with 334 additions and 56 deletions

View File

@@ -84,7 +84,7 @@ module tb_jls_near_ctrl;
strip_done_valid = 1'b0;
@(posedge clk);
#1;
if (current_near !== 6'd1 || actual_bits_cumulative !== 48'd800 ||
if (current_near !== 6'd4 || actual_bits_cumulative !== 48'd800 ||
target_bits_cumulative !== 48'd512) begin
$fatal(1, "ratio=2 first strip update mismatch");
end
@@ -96,7 +96,7 @@ module tb_jls_near_ctrl;
strip_done_valid = 1'b0;
@(posedge clk);
#1;
if (current_near !== 6'd2 || actual_bits_cumulative !== 48'd1120 ||
if (current_near !== 6'd8 || actual_bits_cumulative !== 48'd1120 ||
target_bits_cumulative !== 48'd1024) begin
$fatal(1, "ratio=2 second strip update mismatch");
end
@@ -108,7 +108,7 @@ module tb_jls_near_ctrl;
strip_done_valid = 1'b0;
@(posedge clk);
#1;
if (current_near !== 6'd1 || actual_bits_cumulative !== 48'd1200 ||
if (current_near !== 6'd4 || actual_bits_cumulative !== 48'd1200 ||
target_bits_cumulative !== 48'd1536) begin
$fatal(1, "ratio=2 third strip update mismatch");
end
@@ -131,15 +131,15 @@ module tb_jls_near_ctrl;
$fatal(1, "lossless ratio should force NEAR to 0 without target miss");
end
// Repeated over-target strips saturate at MAX_NEAR and then set the sticky
// miss flag on the next over-target completion.
// Repeated over-target strips jump up the discrete NEAR ladder and then
// set the sticky miss flag once the ladder is already saturated.
@(posedge clk);
image_ratio = 4'd1;
image_start_valid = 1'b1;
@(posedge clk);
image_start_valid = 1'b0;
for (loop_index = 0; loop_index < 32; loop_index = loop_index + 1) begin
for (loop_index = 0; loop_index < 8; loop_index = loop_index + 1) begin
@(posedge clk);
strip_output_bytes = 32'd1000;
strip_done_valid = 1'b1;