amritaas_20 Posted March 7, 2013 Report Share Posted March 7, 2013 Hi! Want to know whether we can use more than one uvm_queue of same item type in our env. I am facing some issue while doing so. Consider following example: // pass_value.sv //File where uvm_queue is declared and data is passed on to it //declare 2 uvm_queue of same item type uvm_queue#(uvm_object) host_q; uvm_queue#(uvm_object) device_q; //create a handle to pass the item type by reference host_q =uvm_queue#(uvm_object)::get_global_queue() ; device_q=uvm_queue#(uvm_object)::get_global_queue() ; uvm_object data_h; //some logice goes here ... .... host_q.push_front(data_h); device_q.push_front(data_h); .... // get_value.sv //Another File to extract the data from uvm_queue. host_q =uvm_queue#(uvm_object)::get_global_queue() ; device_q=uvm_queue#(uvm_object)::get_global_queue() ; uvm_object host_rx_pkt; uvm_object host_rx_pkt; wait(host_q.size() >= 1); wait(device_q.size() >= 1); host_rx_pkt = host_q.pop_back(); // over here host_q.size() become 0 as expected But also device_q.size() becomes 0 device_rx_pkt = device_q.pop_back(); // Since the size of device_q becomes 0 this line gives error msg stating that cannot pop_back() from an empty queue So i have a doubt whether we can have more than one uvm_queue of same type defined in an env. I feel that they are treated as singleton queue, so it is not correct to do so. Anyone having experience with this please suggest. Thanks & Regards Amrita Quote Link to comment Share on other sites More sharing options...
jadec Posted May 6, 2013 Report Share Posted May 6, 2013 The uvm_queue::get_global_queue() function returns a shared queue of a particular type. You can create separate queues by using the uvm_queue::type_id::create(...) function. If your intention is to communicate data between 2 components, it's probably better to use tlm ports. 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.