Parth1242 Posted July 2, 2017 Report Share Posted July 2, 2017 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 ? Quote Link to comment Share on other sites More sharing options...
uwes Posted July 3, 2017 Report Share Posted July 3, 2017 unless you wrap the string/int/bit in a class instance this will not work. Quote Link to comment Share on other sites More sharing options...
Parth1242 Posted July 3, 2017 Author Report Share Posted July 3, 2017 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. Quote Link to comment Share on other sites More sharing options...
Mr_Verification Posted December 19, 2017 Report Share Posted December 19, 2017 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. .../common/fixed_uvm_event.svh 2) Change all occurrences of “uvm_event” to “fixed_uvm_event” in both files: fixed_uvm_event.svh and fixed_uvm_event_callback.svh Thus: 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 'fixed_uvm_event_base#(bit)'. 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 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.