hi all,
when i am parametrizing my code like
in transaction:-
class transaction#(int iq_ctrl=7,int cw_ctrl=1) extends uvm_sequence_item;
`uvm_object_param_utils(transaction#(iq_ctrl,cw_ctrl))
typedef struct {
rand bit [0:((iq_ctrl120)-1)] data;
rand bit [0:((cw_ctrl8)-1)] word;
} d_basic_frame;
in driver:-
class driver#(int iq_ctrl=7,int cw_ctrl=1) extends uvm_driver#(transaction#(iq_ctrl,cw_ctrl));
`uvm_component_param_utils(driver#(iq_ctrl,cw_ctrl))
virtual cpri_interface vif_h;
transaction#(iq_ctrl,cw_ctrl) trans_h;
in test:-
class test #(int iq_ctrl=7,int cw_ctrl=1) extends uvm_test;
`uvm_component_param_utils(test#(iq_ctrl,cw_ctrl))
class p20 extends test#(1,1);
//class p20 extends test#(7,1);
uvm_component_utils(p20) function new(string name="p20",uvm_component parent); super.new(name,parent); endfunction task run_phase(uvm_phase phase); phase.raise_objection(this); ................... phase.drop_objection(this); endtask endclass :p20 //////////////// in sequencer/// class sequencer#(int iq_ctrl=7,int cw_ctrl=1) extends uvm_sequencer#(transaction#(iq_ctrl,cw_ctrl));
uvm_component_param_utils(sequencer#(iq_ctrl,cw_ctrl))
////////////////////in sequence////
class master_sequence#(int iq_ctrl=7,int cw_ctrl=1) extends uvm_sequence #(transaction#(iq_ctrl,cw_ctrl));
`uvm_object_param_utils(master_sequence#(iq_ctrl,cw_ctrl))
transaction#(iq_ctrl,cw_ctrl) trans; //
class p20 extends master_sequence;
`uvm_object_utils(p20)
function new(string name =“tx_ethernet_p20”);
super.new(name);
endfunction
task body();
…
endtask
endclass
///////////////////////
similarly for sequence, monitor,agent,environment.
interface,agent config, env config not parametrized.
//////////////////////////////////////////////////////////////
when i give
class p20 extends test#(7,1) (same value as set default) it runs perfectly.
error comes when i try to override and give:- class p20 extends test#(1,1); it shows UVM_FATAL @ 0: uvm_test_top.env_h.m_agent_h.seqr_h [seqr_h] send_request failed to cast sequence item.
for this eror…
i got the clue that in driver get_item(trans) is not working. as i put display there and get to know. but not getting how to solve
second query:- is it necessary to parametrize driver,monitor,sequence and all if i am parametrizing transaction.
in driver:-
class driver extends uvm_driver#(transaction#(iq_ctrl,cw_ctrl));
`uvm_component_utils(driver)
virtual cpri_interface vif_h;
transaction#(iq_ctrl,cw_ctrl) trans_h;
shows error that iq_ctrl,cw_ctrl not defined.