Skip to content

Commit

Permalink
Add function add_traffic_shaping_with_size to avoid changing
Browse files Browse the repository at this point in the history
`add_traffic_shaping`'s interface.
  • Loading branch information
luca-valente authored and micprog committed May 8, 2024
1 parent 6089791 commit 6d30a5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/axi_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ package axi_test;
mem_map.delete();
endfunction

function void add_traffic_shaping(input int unsigned len, input int unsigned size, input int unsigned freq);
function void add_traffic_shaping(input int unsigned len, input int unsigned freq);
int unsigned size = -1;
if (traffic_shape.size() == 0)
traffic_shape.push_back({len, size, freq});
else
Expand All @@ -822,6 +823,15 @@ package axi_test;
max_cprob = traffic_shape[$].cprob;
endfunction : add_traffic_shaping

function void add_traffic_shaping_with_size(input int unsigned len, input int unsigned size, input int unsigned freq);
if (traffic_shape.size() == 0)
traffic_shape.push_back({len, size, freq});
else
traffic_shape.push_back({len, size, traffic_shape[$].cprob + freq});

max_cprob = traffic_shape[$].cprob;
endfunction : add_traffic_shaping_with_size

function ax_beat_t new_rand_burst(input logic is_read);
automatic logic rand_success;
automatic ax_beat_t ax_beat = new;
Expand Down

0 comments on commit 6d30a5a

Please sign in to comment.