SeanChou Posted February 7, 2012 Report Share Posted February 7, 2012 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 Quote Link to comment Share on other sites More sharing options...
SeanChou Posted February 7, 2012 Author Report Share Posted February 7, 2012 And my previous workaround is to extend another class who has the same body with base class, and then set_type_override to it when needed. Quote Link to comment Share on other sites More sharing options...
janick Posted February 7, 2012 Report Share Posted February 7, 2012 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 Quote Link to comment Share on other sites More sharing options...
SeanChou Posted February 8, 2012 Author Report Share Posted February 8, 2012 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 Quote Link to comment Share on other sites More sharing options...
janick Posted February 8, 2012 Report Share Posted February 8, 2012 Hadn't realized overriding with same didn't work. I'll file a bug against this. A work-around is to create a dummy extension that does not add/do anything and use it to "undo" the override. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.