drianf0 Posted March 16, 2012 Report Share Posted March 16, 2012 Hello, I would like to write a generic virtual sequence, which will spawn another sequences. Since I would like to to keep it generic, the type of spawned sequences should be defined by the overriding facility of the factory. My problem is that the code: class vir_seq extends uvm_sequencer#(); ... virtual task pre_body(); uvm_sequence_base seq; seq = uvm_sequence_base::type_id::create("my_name"); endtask; ... instead of creating the overriding type (let's say my_seq), creates vir_seq. One comment: I use the uvm_sequence_base instead of the uvm_sequence#(T) because I don't want to have the parametrized vir_seq (from my experience parameters always imply troubles at the end...). Is any other, more clean way, to avoid parameters ? I know, the that the uvm_sequence_base inherits type_id from uvm_sequence_item (so by default, without overriding, an item should be created). However, fact that I get every time vir_seq confuses me. To understand better the issue and isolate the problem, I end up with the following simple example: import uvm_pkg::*; `include <uvm_macros.svh> module top; test a(); endmodule // top class seq extends uvm_sequence#(); `m_uvm_object_registry_internal(seq, seq) // <- MACRO 1 // `uvm_object_utils (seq) function new(); super.new(); $display(uvm_sequence_base::type_id::type_name ); // <- DISPLAY 2 endfunction // new endclass // seq program automatic test; task start(); seq s; $display(uvm_sequence_base::type_id::type_name ); // <- DISPLAY 1 s = new(); endtask // start initial start(); endprogram // test Display 1, as expected, returns always 'uvm_sequence_item'. Output of Display 2 depends whether the Macro 1 (which is a part of `uvm_object_utils) is commented or not, returning respectively 'uvm_sequence_item' or 'seq' I would be grateful for an explanation why the above simulation doesn't follow my expectations. Thank you in advance. Regards, Adrian Quote Link to comment Share on other sites More sharing options...
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.