The class uvm_memory_ranges contains a list of ranges, sorted by starting address.
Create N allocated blocks with each having a size in the range [i,j] bytes. Create the N allocated blocks
| uvm_memory_ranges | ||
| The class uvm_memory_ranges contains a list of ranges, sorted by starting address. | ||
| Class Declaration | ||
| ||
| Methods | ||
| m_new_range_random | Create a new range, and mark it random. | |
| add_range() | This is the “by-hand” access routine. | |
| add_range_random_by_hand() | This is the “MEMORY_RAND_BY_HAND” access routine. | |
| m_unlock() | Internal use only, for turning constraints back on after a previous call to lock(). | |
| m_lock() | Internal use only, for turning constraints off. | |
| pre_randomize() | Built-in function. | |
| post_randomize() | Built-in function. | |
| m_check | A utility function that call be called anytime. | |
local function uvm_memory_range m_new_range_random( string l_tag_name = "ranges" )
Create a new range, and mark it random. It is important to call randomize here - it appears to make the array more “fair”. Instead of calling randomize(), you can just set the range_start and end values to zero - or any other value. The real values will get set later (randomize() will be called later, whether or not you call randomize() now).
virtual function uvm_memory_range add_range( address_t range_start, address_t range_end, string l_tag_name = "ranges" )
This is the “by-hand” access routine. Create a new range with the range_start and end values specifid, and give it a “tag”. The tag is used as a way to group ranges.
virtual function uvm_memory_range add_range_random_by_hand( string l_tag_name = "ranges" )
This is the “MEMORY_RAND_BY_HAND” access routine. Create a placeholder for some random range. We don’t care a lick about the values, just that we need to have a block. It is tagged. TODO: add a “size” parameter - create a block of at least size bytes.
local function void m_unlock()
Internal use only, for turning constraints back on after a previous call to lock().
local function void m_lock()
Internal use only, for turning constraints off. The goal is to turn off ALL constraints NOT associated with the size randomization.
function void pre_randomize()
Built-in function. In this case we’re using pre_randomize() as a way to randomize the size of the array before randomizing the contents.
Take care of expansion and contraction.
function void post_randomize()
Built-in function. In this case we’re using post_randomize() as a way to randomize the value of the range_end attribute.
function void m_check()
A utility function that call be called anytime. It checks to make sure the list is “OK”. The list can get to be not OK if the constraints are not correct or if other bad things happen. Under normal circumstances, this function won’t be neeed - the list will be fine.
TODO: Is this code needed anymore?
The class uvm_memory_ranges contains a list of ranges, sorted by starting address.
class uvm_memory_ranges
Create a new range, and mark it random.
local function uvm_memory_range m_new_range_random( string l_tag_name = "ranges" )
This is the “by-hand” access routine.
virtual function uvm_memory_range add_range( address_t range_start, address_t range_end, string l_tag_name = "ranges" )
This is the “MEMORY_RAND_BY_HAND” access routine.
virtual function uvm_memory_range add_range_random_by_hand( string l_tag_name = "ranges" )
Internal use only, for turning constraints back on after a previous call to lock().
local function void m_unlock()
Internal use only, for turning constraints off.
local function void m_lock()
Built-in function.
function void pre_randomize()
Built-in function.
function void post_randomize()
A utility function that call be called anytime.
function void m_check()