Hello Everyone,
I want to place a begin end for the if and else-if condition so that I can give a ucm_info print statement. Following is the piece of original code:
if (!rw_txn.randomize() with { if (cfg.controller.if_type inside {A, B,C})
rw_txn.tgt_id == m_seq_cfg.Target_ID;
else if (cfg.srcID == 0)
rw_txn.tgt_id == m_seq_cfg.Target_ID;
Following is my intention
if (!rw_txn.randomize() with { if (cfg.controller.if_type inside {A, B,C}) begin
`uvm_info("","Display_19",UVM_NONE);
rw_txn.tgt_id == m_seq_cfg.Target_ID;
end
else if (cfg.srcID == 0) begin//TgtID is fixed in HNF seq when multiple_srcID=0
`uvm_info("","Display_20",UVM_NONE);
rw_txn.tgt_id == m_seq_cfg.Target_ID;
end
With this approach I get error which says:
near “begin”: syntax error, unexpected begin
How can I include a begin end in this constrained if else. Any help or hint would be appreciable.
Thanks