2

I have two sequence item class a_packet and its extended class called bad_packet. By default, a_packet type is used. Trying to override a_packet instance with bad_packet, I am able to do it successfully by using set_inst_override_by_name in my uvm test,

factory.set_inst_override_by_name("a_packet","bad_packet", "*");

Now my question is: what if I don't want to use "*", how to know the full hierarchical path of the sequence item instance?

I was trying to utilise get_full_name() from inside the sequence item, right after it is received by the driver, to know the exact hierarchical path. It displayed:

uvm_test_top.env.a_agt.a_seqr.a_sequence.a_packet

But when I replaced the * with above path, the overriding is not happening.

factory.set_inst_override_by_name("a_packet","bad_packet","uvm_test_top.env.a_agt.a_seqr.a_sequence.a_packet");

Did I do something wrong?

AldoT
  • 913
  • 1
  • 8
  • 34
  • possible duplicate of [uvm set\_inst\_override for a sequence](http://stackoverflow.com/questions/26100386/uvm-set-inst-override-for-a-sequence) – Tudor Timi Dec 19 '14 at 11:06
  • The question I linked above deals with sequences, not sequence items, but the process is essentially the same (as sequences are child classes of sequence items). – Tudor Timi Dec 19 '14 at 11:08

1 Answers1

3

Where you create your packet, you'll need to to specify the full path to the corresponding call to create(..):

packet = a_packet::type_id::create("packet", , get_full_name());

If you were using the uvm_do macro, you'll have to change to using the explicit sequence API:

packet = a_packet::type_id::create("packet", , get_full_name());
start_item(packet);
// ... randomize ...
finish_item(packet);

Idea is from this DVCon Paper, section IV.A.

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53