From 866c9435f7d23bec71b2f50021cf6554bad56879 Mon Sep 17 00:00:00 2001 From: Luca Colagrande Date: Tue, 18 Apr 2023 14:31:34 +0200 Subject: [PATCH] axi_test: Adapt syntax for Questa 2022.3 --- src/axi_test.sv | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/axi_test.sv b/src/axi_test.sv index a02319a71..0a6c03763 100644 --- a/src/axi_test.sv +++ b/src/axi_test.sv @@ -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 #( @@ -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 @@ -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);