Constraining address for the memory making sure the Offset is not within the previous memory regions

In reply to dave_59:

Thanks for the quick response Dave. While I was thinking about the alternative approach you have mentioned I had a thought:

Since UVM is a powerful methodology is there a class that can actually do the random memory generation for us? I think this a pretty common use case where people need to allocate random non overlapping memory spaces.

Let’s say my use case is the following:

  1. I have 2GB of system memory
  2. I need to allocate random non overlapping space from this memory that will contain data that gets transmitted or can be used to store data that is received by a DMA agent from a packet based protocol (In my case Ethernet).
  3. I also need random non-overlapping chunks of memory space to store my DMA descriptors.

So, if there is such a class in which I can set start address and end address of the memory (0-2GB) and if it has methods something like:

  1. get_buffer(buf_start_addr,buf_size) // Both args are output
  2. get_buffer_of_spec_size(buf_start, req_buf_size) // Buf_start as output and req_buf_size as input

Are you aware of any such class in UVM. I want to reuse such class if it already exists.