In reply to saikanthan7798:
You should never use an assert statement with a call to randomize(). Instead, you should use the return code to determine if the call was successful:
case(cfg_axi::testname)
"TEST_10_WR_TX":begin
for(int i=0;i<9;i=i+1) begin
tx=new();
if (!(tx.randomize() with {tx.tx_type == WRITE;}))
$display("Randomization failed!");
else
cfg_axi::gen2bfm.put(tx);
end
end
In this case, you would receive the error message that the call to randomize() failed.
You would then focus on the error message:
axi_gen:: inside gen
gen.sv(10): randomize() failed due to conflicts between the following constraints:
gen.sv(10): (tx_type == WRITE);
Where:
tx_type = READ /* non-random */
In the axi_tx class, tx_type is not declared as ‘rand’, hence it can’t be randomized.