Jump to content
Sign in to follow this  

uvm_event with uvm1.2

Recommended Posts

With UVM1.2 uvm_event class is made parameterized , but I am not able to use it for types other than extend class of uvm_object. I am running with IUS simulator.

Getting Error , because virtual function void trigger (T data=null);  , expects type to be object . Is there a way to use it for string/integer/bit ? 

Share this post

Link to post
Share on other sites
5 hours ago, uwes said:

unless you wrap the string/int/bit in a class instance this will not work. 

Even If I use class object which is not extended from uvm_object , it is not working with IUS. It fails in compilation error from uvm library file. So what is change in uvm 1.2 ? it is same behavior as uvm 1.1.


Share this post

Link to post
Share on other sites

I just ran into this anomaly today.  Here's the fix, if you want to use a “uvm_event#(bit)” type:

1) Copy uvm_event.svh and uvm_event_callback.svh to your project area where you can "enhance" it.  I renamed the files and classes to include a "fixed_" prefix, thus uvm_event class is now fixed_uvm_event class.


2) Change all occurrences of “uvm_event” to “fixed_uvm_event” in both files: fixed_uvm_event.svh and fixed_uvm_event_callback.svh


class fixed_uvm_event#(type T=bit) extends fixed_uvm_event_base#(T);

3) Change the default type T to "bit" (or whatever your base type is going to be) in both classes in fixed_uvm_event.svh

virtual class fixed_uvm_event_base#(type T=bit) extends uvm_object;

class fixed_uvm_event#(type T=bit) extends fixed_uvm_event_base#(T);

I haven’t figured out why the VCS compiler doesn’t resolve this error (I’ll save it for another rainy day)

    Error-[SV-ICVA] Illegal class variable access

    .../common/fixed_uvm_event.svh, 263

      Protected member 'm_event' of class

      'fixed_uvm_event_base#(uvm_pkg::uvm_object)' is not visible to scope


      Please make sure that the above member is accessed only from its own class or inherited class properties as it is declared as protected.

4) Add type T to the callbacks queue in the base class:

protected fixed_uvm_event_callback#(T)  callbacks[$];

5) Comment out “do_print()” and “do_copy()” and hope you don’t need them.

OK, I should have used the "mutated_" prefix instead of "fixed_" because it's not really fixed.

Good Luck, Mr V

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this