Jump to content

Recommended Posts

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.

Link to comment
Share on other sites

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 
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...