Iam having issue with $cast(expected_trans,trans.clone()); where expected_trans does not copy values from trans.clone()
function void mux_scoreboard::write_in(mux_mon_trans trans);
mux_mon_trans expected_trans ;
$cast(expected_trans,trans.clone());
case (expected_trans.sel)
2’b01 : expected_trans.data_out = expected_trans.a;
2’b10 : expected_trans.data_out = expected_trans.b;
2’b11 : expected_trans.data_out = expected_trans.c;
endcase
expected_q.push_back(expected_trans);
endfunction
cgales
2
In reply to Veeraraju potta:
Have you implemented the do_copy() function in your sequence_item?
No .I have not implemented . .clone() is in build function right ?
Below is the trans item iam using
class mux_mon_trans extends uvm_object;
//object utils
`uvm_object_utils(mux_mon_trans);
//variables declaration
bit[3:0] a;
bit[3:0] b;
bit[3:0] c;
bit[1:0] sel;
bit[3:0] data_out;
//constraints
function new(string name =“mux_mon_trans”);
super.new(name);
endfunction
endclass
After implementing do_copy method .clone is working .
Thanks,
Veera