In reply to heckey:
Yopu are doing things twice, see you code:
repeat(1000) begin
// Generate next transaction
assert(tx.randomize());
// Next transaction requires a special mode, set it first before sending the transaction
if ( tx.cmd == SPECIAL_MODE_CMD ) begin
// Generate special mode change transaction
start_item(tmp_tx);
assert(tmp_tx.randomize() with { cmd == SET_SPECIAL_MODE; });
finish_item(tmp_tx);
end
// Send special mode transaction
start_item(tx);
finish_item(tx);
end
Do you really start with a completely unconstrained seq_item and then you want to genearte another one where the data member cmd = SET_SPECIAL_MODE:
Even when you want to do this you can remove the if construct.