pavan.kota@sandisk.com Posted January 15, 2016 Report Share Posted January 15, 2016 Does UVM Provide any handy class similar to uvm_mem_mam to manage a pool of device indices (any numbers). To be more clear: Lets say I want to randomly pick an unused Device ID, I want to know if UVM has any utility class that manages the list of Device Indexes that are already allotted and when requested provides a random free device index, while adding it to the list of used device index. This functionality is close to uvm_mem_mam where mam manages the list of addresses that are in use and when requested will randomly return an address+length combination. In essence I am looking for a list manager class. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 17, 2016 Report Share Posted January 17, 2016 I don't think the UVM provides a class for that, but you can easily model that with a simple constraint on any member of a class. class myclass; int pool_of_devices[$]; rand int device; constraint new_device { !( device inside {pool_of_devices} ); } function void post_randomize(); pool_of_devices.push_back(device); endfunction endclass 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.