arno Posted February 10, 2011 Report Share Posted February 10, 2011 Field "queue" of uvm_queue is declared as protected, and it turns out to be limiting the use and reusability of this object. All it does is providing a container for a SV queue, and adds the "protected" restriction. Could it be changed to public in future releases ? Thanks. Quote Link to comment Share on other sites More sharing options...
uwes Posted February 11, 2011 Report Share Posted February 11, 2011 (edited) Field "queue" of uvm_queue is declared as protected, and it turns out to be limiting the use and reusability of this object. All it does is providing a container for a SV queue, and adds the "protected" restriction.Could it be changed to public in future releases ? Thanks. hi, for own code you could do something like the code below. i think it would be better to have the set/get variants instead of the direct access. /uwe : program test50; import uvm_pkg::*; class my_queue#(type T=int) extends uvm_queue#(T); typedef T this_type[$]; function new(string name=""); super.new(name); endfunction function this_type get_view(); return queue; endfunction function void set_view(ref this_type r); this.queue = r; endfunction endclass initial begin int a[$]; static my_queue#(int) mq = new(); a.push_back(4); mq.set_view(a); a.push_back(5); assert (mq.size() == 1); mq.push_back(5); assert (mq.size() == 2); end endprogram Edited February 11, 2011 by uwes 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.