Skip to content

Commit

Permalink
Merge branch 'isa_fix_mfb_stats' into 'devel'
Browse files Browse the repository at this point in the history
This MR improve MFB speed meter in verification

See merge request ndk/ndk-fpga!82
  • Loading branch information
jakubcabal committed Oct 18, 2024
2 parents 18a701a + 1b7d3a9 commit f3b5108
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions comp/uvm/mfb/statistic.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,35 @@ class statistic #(int unsigned REGIONS, int unsigned REGION_SIZE, int unsigned B
const int unsigned eof_pos = (REGION_SIZE*BLOCK_SIZE) > 1 ? t.eof_pos[it] : 0;

if (indata == 1) begin
//Data end in this region
if (t.eof[it]) begin
data_size += (eof_pos+1)*ITEM_WIDTH;
indata = 0;
// Next data start in this region
if (t.sof[it]) begin
data_size += (REGION_SIZE - sof_pos)*BLOCK_SIZE*ITEM_WIDTH;
indata = 1;
end
end else begin
// Data is all acros this region
data_size += REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH;
end

if (t.sof[it]) begin
data_size += (REGION_SIZE - sof_pos)*BLOCK_SIZE*ITEM_WIDTH;
indata = 1;
end
end else begin
// This path is outside frame. If there is EOF then there have to
// sof before it.
if (t.sof[it]) begin
data_size += (REGION_SIZE - sof_pos)*BLOCK_SIZE*ITEM_WIDTH;
indata = 1;
// Data start and end in same region
if (t.eof[it]) begin
data_size += (eof_pos+1 - sof_pos*BLOCK_SIZE)*ITEM_WIDTH;
indata = 0;
// Data only start in this region
end else begin
data_size += (REGION_SIZE - sof_pos)*BLOCK_SIZE*ITEM_WIDTH;
indata = 1;
end
end else begin
data_size += REGION_SIZE*BLOCK_SIZE*ITEM_WIDTH;
end

if (t.eof[it]) begin
data_size -= (REGION_SIZE*BLOCK_SIZE - eof_pos)*ITEM_WIDTH;
indata = 0;
//There is no data in region
data_size += 0;
end
end
end
Expand Down

0 comments on commit f3b5108

Please sign in to comment.