Hi,
Anyone, please clarify my below issue. It looks very long because I have explained my issue in a very descriptive manner.
Attaching eda link of my example for refernce. MY_SMALL_UVM_TB
At the end of this post i have attached heirarchy of my TB.
I am trying to override my Parent_transaction with child_transaction. This is working with set_type_override_by_type and replacing parent_transaction with child_trans throughout testbench.
function void uvm_fifo_test::build_phase(uvm_phase phase);
uvm_factory factory = uvm_factory::get();
super.build_phase(phase);
set_type_override_by_type(uvm_fifo_transaction::get_type(),child_fifo_transaction::get_type()); //overriding throught testbench
fifo_cfg = uvm_fifo_cfg :: type_id::create("fifo_cfg");
fifo_env = uvm_fifo_env::type_id::create("fifo_env",this);
uvm_config_db#(uvm_fifo_cfg)::set(this,"fifo_env.*","cfg",fifo_cfg);
factory.print();
endfunction
Result before overriding with child transaction.
Name Type Size Value
-----------------------------------------------------------------------------------------------------------
trans1 **uvm_fifo_transaction** - @814
write_en integral 1 'h1
read_en integral 1 'h1
wdata integral 16 'h1e6
rdata integral 16 'h6939
begin_time time 64 0
depth int 32 'd2
parent sequence (name) string 8 fifo_seq
parent sequence (full name) string 48 uvm_test_top.fifo_env.fifo_agt.fifo_sqr.fifo_seq
sequencer string 39 uvm_test_top.fifo_env.fifo_agt.fifo_sqr
-----------------------------------------------------------------------------------------------------------
The result after overriding parent_trans with child_trans.
Name Type Size Value
-------------------------------------------------------------------------------------------------------------
trans1 **child_fifo_transaction** - @814
write_en integral 1 'h1
read_en integral 1 'h0
wdata integral 16 'h15
rdata integral 16 'hb96
begin_time time 64 0
depth int 32 'd2
parent sequence (name) string 8 fifo_seq
parent sequence (full name) string 48 uvm_test_top.fifo_env.fifo_agt.fifo_sqr.fifo_seq
sequencer string 39 uvm_test_top.fifo_env.fifo_agt.fifo_sqr
-------------------------------------------------------------------------------------------------------------
But when i tried to make an instance overriding for only particular one agent component using set_inst_override_by_type. Parent_trans is not getting overriden with child_trans.
function void uvm_fifo_test::build_phase(uvm_phase phase);
uvm_factory factory = uvm_factory::get();
super.build_phase(phase);
set_inst_override_by_type("uvm_test_top.fifo_env.fifo_agt1.*",uvm_fifo_transaction::get_type(),child_fifo_transaction::get_type());
fifo_cfg = uvm_fifo_cfg :: type_id::create("fifo_cfg");
fifo_env = uvm_fifo_env::type_id::create("fifo_env",this);
uvm_config_db#(uvm_fifo_cfg)::set(this,"fifo_env.*","cfg",fifo_cfg);
factory.print();
endfunction
Result before overriding with child transaction.
Name Type Size Value
-----------------------------------------------------------------------------------------------------------
trans1 **uvm_fifo_transaction** - @814
write_en integral 1 'h1
read_en integral 1 'h1
wdata integral 16 'h1e6
rdata integral 16 'h6939
begin_time time 64 0
depth int 32 'd2
parent sequence (name) string 8 fifo_seq
parent sequence (full name) string 48 uvm_test_top.fifo_env.fifo_agt.fifo_sqr.fifo_seq
sequencer string 39 uvm_test_top.fifo_env.fifo_agt.fifo_sqr
-----------------------------------------------------------------------------------------------------------
Result after instance overriding.
Name Type Size Value
-----------------------------------------------------------------------------------------------------------
trans1 **uvm_fifo_transaction** - @814
write_en integral 1 'h1
read_en integral 1 'h1
wdata integral 16 'h1e6
rdata integral 16 'h6939
begin_time time 64 0
depth int 32 'd2
parent sequence (name) string 8 fifo_seq
parent sequence (full name) string 48 uvm_test_top.fifo_env.fifo_agt.fifo_sqr.fifo_seq
sequencer string 39 uvm_test_top.fifo_env.fifo_agt.fifo_sqr
-----------------------------------------------------------------------------------------------------------
My TB heirarchy.
--------------------------------------------------------------
Name Type Size Value
--------------------------------------------------------------
uvm_test_top uvm_fifo_test - @342
fifo_env uvm_fifo_env - @358
fifo_agt uvm_fifo_agent - @375
fifo_drvr uvm_fifo_driver - @538
rsp_port uvm_analysis_port - @557
seq_item_port uvm_seq_item_pull_port - @547
fifo_mon uvm_fifo_monitor - @569
fifo_sqr uvm_fifo_sequencer - @399
rsp_export uvm_analysis_export - @408
seq_item_export uvm_seq_item_pull_imp - @526
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
fifo_agt1 uvm_fifo_agent - @386
fifo_drvr uvm_fifo_driver - @730
rsp_port uvm_analysis_port - @749
seq_item_port uvm_seq_item_pull_port - @739
fifo_mon uvm_fifo_monitor - @761
fifo_sqr uvm_fifo_sequencer - @591
rsp_export uvm_analysis_export - @600
seq_item_export uvm_seq_item_pull_imp - @718
arbitration_queue array 0 -
lock_queue array 0 -
num_last_reqs integral 32 'd1
num_last_rsps integral 32 'd1
--------------------------------------------------------------