Hi i got the question that i want to create a sequence which including 2 child sequence and these children can drive a specific data. Now the using “parameter” to do that but i got the error during run time:
Error-[DCF] Dynamic cast failed
…/…/uvm/wdt_sequence.sv, 160
Casting of source class type '\w_r_ctrl_seq#(32,1,32’hffffffff) ’ to
destination class type '\w_r_ctrl_seq#(32,0,32’ha5000007) ’ failed due to
type mismatch.
Please ensure matching types for dynamic cast
Here is my a part of my code:
``` verilog
class w_r_ctrl_seq
#(
parameter pWIDTH = 32
,random = 1
,pdata = 32'hffff_ffff
)
extends uvm_sequence#(wdt_seq_item);
`uvm_object_utils(w_r_ctrl_seq);
write_ctrl_seq #(.pWIDTH(pWIDTH),.random(random),.pdata(pdata)) wrt_seq;
read_ctrl_seq rd_seq;
//---------------------------------------
//Constructor
//---------------------------------------
function new(string name = "w_r_ctrl_seq");
super.new(name);
endfunction
virtual task body();
`uvm_do(wrt_seq)
`uvm_do(rd_seq)
endtask
endclass
//---- Top Sequence ----//
class top_sequence extends uvm_sequence #(wdt_seq_item);
//Declare sequences
w_r_cnt_seq conf_cnt_seq;
w_r_ctrl_seq #(32,0,32'ha500_0007) conf_ctrl_seq;
write_ctrl_seq #(32,0,32'ha500_0010) pause_seq;
write_ctrl_seq #(32,0,32'ha500_0007) resume_seq;
//Register to UVM Factory
`uvm_object_utils(top_sequence)
//---------------------------------------
//Constructor
//---------------------------------------
function new(string name = "top_seq");
super.new(name);
endfunction
Is there anyway i can fix that issue. I dont know what is the best way to supply specific data for a sequence? Thank You