Skip to content

Commit

Permalink
axi_test: Adapt syntax for Questa 2022.3
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Apr 21, 2023
1 parent 45a0056 commit 866c943
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/axi_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ package axi_test;
} traffic_shape[$];
int unsigned max_cprob;

real mcast_prob;
int unsigned mcast_prob;

function new(
virtual AXI_BUS_DV #(
Expand Down Expand Up @@ -808,8 +808,10 @@ package axi_test;
atop_resp_r = '0;
endfunction

// Sets the probability to generate a transaction with a non-zero multicast mask
function void set_multicast_probability(real prob);
// Sets the probability to generate a transaction with a non-zero multicast mask.
// `prob` should be a percentage, as Questa 2022.3 doesn't support real types
// in SystemVerilog `dist` constraints.
function void set_multicast_probability(int unsigned prob);
mcast_prob = prob;
endfunction

Expand Down Expand Up @@ -946,7 +948,7 @@ package axi_test;
// Randomize multicast mask.
if (ENABLE_MULTICAST && !is_read) begin
rand_success = std::randomize(mcast, mcast_mask) with {
mcast dist {0 := (1 - mcast_prob), 1 := mcast_prob};
mcast dist {0 := (100 - mcast_prob), 1 := mcast_prob};
!mcast -> mcast_mask == 0;
mcast -> mcast_mask != 0;
}; assert(rand_success);
Expand Down

0 comments on commit 866c943

Please sign in to comment.