Jump to content

[uvm_factory] how to remove the previous type override rule?


Recommended Posts

All,

My question as listed below, hope some body could give me some hint and thanks!

class b extends uvm_sequence;
class d extends b;
class c extends uvm_sequence;

  task body();
  b bb;
  `uvm_do(bb) // run b
  b::type_id::set_type_override(d::get_type());
  `uvm_do(bb) // run d
  // I hope to run b again in the next line, what should I do here?
  `uvm_do(bb)
  endtask
endclass
Link to comment
Share on other sites

You can't undo a factory type override, but you can simply override it with the original type:

b::type_id::set_type_override(b::get_type());

Is this a trivial example that does not accurately reflect what you are trying to do, because here you simply need to use variables of different types:

task body();
 b bb;
 d dd;
 `uvm_do(bb) // run b
 `uvm_do(dd) // run d
 `uvm_do(bb)
endtask

Link to comment
Share on other sites

Thanks for Janick,

1. Not really the same, for my case it is similar to select type of wheels or engines before `uvm_do(building_a_car)

2. overriding by same type does not works, it only shows the following message.

UVM_WARNING @ LINE: reporter [TYPDUP] Original and override type arguments are identical: b

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...