Inheritance diagram for class svt_mem_backdoor:
This class provides a backdoor and iterator interface to a memory core. Multiple instances of this interface may exist on the same memory core.
Public Member Functions | |
| function bit | are_set ( svt_mem_attr_t attr, svt_mem_addr_t addr ) |
| function bit | clear_attributes ( svt_mem_attr_t attr, svt_mem_addr_t addr ) |
| function uvm_object | clone ( ) |
| function int | compare_base ( string filename, svt_mem_backdoor_base :: compare_type_enum compare_type, int max_errors, svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, svt_mem_address_mapper mapper = null ) |
| function void | copy ( svt_mem_backdoor rhs ) |
| function void | dump_base ( string filename, string filetype, svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, svt_mem_address_mapper mapper = null, int modes = 0 ) |
| function void | free_all ( ) |
| function bit | free_attribute ( svt_mem_attr_t free_attr_mask ) |
| function bit | free_base ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 ) |
| function int | get_access_lock_attr ( ) |
| function svt_mem_addr_t | get_addr ( ) |
| function int | get_addr_width ( ) |
| function svt_mem_attr_t | get_attributes ( ) |
| function unsigned int | get_checks ( ) |
| function svt_mem_data_t | get_data ( ) |
| function int | get_data_width ( ) |
| function int | get_supported_features ( ) |
| function int | get_write_protect_attr ( ) |
| function void | initialize_base ( svt_mem_backdoor_base :: init_pattern_type_enum pattern = INIT_CONST, svt_mem_data_t base_data = 0, svt_mem_addr_t start_addr = 0, svt_mem_addr_t end_addr = -1, int modes = 0, svt_mem_data_t optional_data = 0 ) |
| function void | load_base ( string filename, svt_mem_address_mapper mapper = null, int modes = 0 ) |
| function void | new ( string name = "", svt_mem_core mem_core = null, uvm_report_object reporter = null ) |
| function svt_mem_attr_t | new_attribute ( ) |
| function bit | next ( ) |
| function svt_mem_attr_t | peek_attributes ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 ) |
| function bit | peek_base ( svt_mem_addr_t addr, output svt_mem_data_t data, input int modes ) |
| function void | poke_attributes ( svt_mem_attr_t attr, svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 ) |
| function bit | poke_base ( svt_mem_addr_t addr, svt_mem_data_t data, int modes = 0 ) |
| function void | protect ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi ) |
| function bit | reset ( svt_mem_attr_t attr = 'h2 ) |
| function void | set_attributes ( svt_mem_attr_t attr, svt_mem_addr_t addr ) |
| function void | set_checks ( int unsigned enables ) |
| function void | unprotect ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi ) |
Public Attributes | |
| static const svt_mem_attr_t | LAST_RD = SVT_MEM_ATTRIBUTE_LAST_RD; |
| static const svt_mem_attr_t | LAST_WR = SVT_MEM_ATTRIBUTE_LAST_WR; |
| string | name |
| static const svt_mem_attr_t | WRITTEN = SVT_MEM_ATTRIBUTE_INIT; |
|
||
|
||
|
||||
Make a copy of this class, including the state of the iterator
| ||||
|
|
||||
Internal method for comparing the content of the memory in the specifed
address range (entire memory by default) with the data found in the specifed file,
using the relevant policy based on the filename.
The 'mapper' can be used to convert between the source address domain used in the file and the destination address domain used by the backdoor. If the 'mapper' is not provided it implies the source and destination address domains are the same. The following comparison mode are available:
filename - Name of the file to compare to. The file extension determines which format the file is created in. compare_type - Determines which kind of compare is executed max_errors - Data comparison terminates after reaching max_errors. If max_errors is 0 assume a maximum error count of 10. addr_lo - Starting address addr_hi - Ending address
Return values - The number of miscompares. | ||||
|
|
||
Copy the state of the specified iterator to this iterator. The specified
iterator must refer to the same memory core.
rhs - svt_mem_backdoor object to be copied. |
|
||||
Internal method for saving memory contents within the indicated 'addr_lo' to
'addr_hi' address range into the specified 'file' using the format identified
by 'filetype', where the only supported values are "MIF" and "MEMH".
The 'mapper' can be used to convert between the source address domain used in the file and the destination address domain used by the backdoor. If the 'mapper' is not provided it implies the source and destination address domains are the same. The 'modes' field is a loophole for conveying basic well defined instructions to the backdoor implementations.
filename - Name of the file to write to. The file extension determines which format the file is created in. filetype - The string name of the format to be used when writing a memory dump file, either "MIF" or "MEMH". addr_lo - Starting address addr_hi - Ending address mapper - Used to convert between address domains. modes - Optional dump modes, represented by individual constants. Supported values:
| ||||
|
|
||
Free all data in the memory.
|
|
||
Release a presviously-created user-defined attribute. The released
attibute may be reused by a new subsequently created user-defined
attibute.
free_attr_mask - attributes to be freed. |
|
||||
Free the data associated with the specified address range, as if it had never
been written. If addr_lo == 0 and addr_hi == -1 then this frees all of the
data in the memory.
addr_lo - Low address addr_hi - High address modes - Optional access modes, represented by individual constants. No predefined values supported.
Return values - Bit indicating the success (1) or failure (0) of the free operation. | ||||
|
|
||
Retrieve the attribute mask for the lock attribute
|
|
||
Return the address of the memory location corresponding to the current
location of the iterator.
|
|
||
Returns the configured address width of the memcore
|
|
||
Return the bitwise-OR of all attributes set for the memory location
corresponding to the current location of the iterator
|
|
||
Retrieves the check mask which determines which checks the memserver performs
Retrieves the check mask which determines which checks the C-based memserver application performs. The return value is a bitwise-OR that determines which checks are enabled. The following macros can be used to test whether specific checks are enabled:
|
|
||
Return the value in the memory location corresponding to the current
location of the iterator.
|
|
||
Returns the configured data width of the memcore
|
|
||||
Method to provide a bit vector identifying which of the common memory
operations (i.e., currently peek, poke, load, and dump) are supported.
This class supports all of the common memory operations, so this method returns a value which is an 'OR' of the following:
Return values - Bit vector indicating which features are supported by this backdoor. | ||||
|
|
||
Retrieve the attribute mask for the write protect attribute
|
|
||||
Initialize the specified address range in the memory with the specified
pattern. Supported patterns are: constant value, incrementing values,
decrementing values, walk left, walk right. For user-defined patterns, the
backdoor should be used.
pattern - initialization pattern. base_data - Starting data value used with each pattern For pattern INIT_ODD_EVEN_CONST pattern denotes data value for even addresses start_addr - start address of the region to be initialized. end_addr - end address of the region to be initilized. modes - Optional access modes, represented by individual constants. No predefined values supported. optional_data - Starting data value used for odd addresses with INIT_ODD_EVEN_CONST pattern | ||||
|
|
||||
Internal method for loading memory locations with the contents of the specified
file.
The 'mapper' can be used to convert between the source address domain used in the file and the destination address domain used by the backdoor. If the 'mapper' is not provided it implies the source and destination address domains are the same.
filename - Name of the file to load. The file extension determines which format to expect. mapper - Used to convert between address domains. modes - Optional load modes, represented by individual constants. Supported values:
| ||||
|
|
||
|
||
Creates a new user-defined attribute that can be attanched to any address.
Different user-defined attributes can be bitwise-OR's to operate on
multiple attributes at the same time.
The return value is the attribute mask for the new attribute. |
|
||
Move the iterator to the next memory location. The order in which
memory location are visited is not specified.
|
|
||||
Return the attribute settings for the indicated address range. Does an 'AND'
or an 'OR' of the attributes within the range, based on the 'modes' setting.
The default setting results in an 'AND' of the attributes.
addr_lo - Starting address. addr_hi - Ending address. modes - Optional attribute modes, represented by individual constants. Supported values:
| ||||
|
|
||||
Set the output argument to the value found a the specified address
Returns TRUE if a value was found. Returns FALSE otherwise. By default. the
attributes are not modified but if specified, attributes may be set or cleared.
addr - address on which data to be read data - ouput data on specified address. modes - Optional access modes, represented by individual constants. No predefined values supported.
Return values - '1' if the value was written, otherwise '0'. | ||||
|
|
||||
Set the attributes for the addresses in the indicated address range. Does an
'AND' or an 'OR' of the attributes within the range, based on the 'modes'
setting. The default setting results in an 'AND' of the attributes.
Special care must be taken when setting the 'access' attributes for a memory location as these attributes govern how the memory package interacts with the location. An access value of SVT_MEM_ATTRIBUTE_UNINIT, for example, indicates the location is not occupied. This will result in the failure of subsequent peek, peek_attribute, and poke_attribute operations of that location. Changing the access value between the different 'occupied' settings will not not result in failures with subsequent peek or poke operations. But it could impact the outcome of subsequent access checks which rely on these settings to discern the current state of the memory locations. The 'occupied' settings are defined by:
attr - attribute to be set addr_lo - Starting address. addr_hi - Ending address. modes - Optional attribute modes, represented by individual constants. Supported values:
| ||||
|
|
||||
Write the specified value at the specified address. By default, the
attributes are not modified but if specified, attributes may be set or
cleared.
addr - address on which data to be written data - data to be written to the specific address. modes - Optional access modes, represented by individual constants. No predefined values supported.
Return values - '1' if the value was written, otherwise '0'. | ||||
|
|
||
|
||
Reset the iterator to the first address with all the specified(bitwise-OR'd)
attributes set. Default is SVT_MEM_ATTRIBUTE_INIT, which is interpreted to
represent all occupied locations, whether they have been initialized or
written to.
|
|
||
|
||
Sets the error checking enables which determine whether particular types of
errors or warnings will be checked by the C-based memserver application. The
check_enables mask uses the same bits as the status values.
The following macros can be supplied as a bitwise-OR:
Note however that not all status values represent error checks that can be disabled. Two pre-defined check enable defines exist:
enables - Error check enable mask |
|
||
|
|
Predefined attribute indicating an address was last accessed by a READ operation.
|
|
|
Predefined attribute indicating an address was last accessed by a WRITE operation.
Provided for backwards compatibility, but clients should actually use the
SVT specified attribute constants.
|
|
|
|
Pre-defined attribute indicating an address has been written or initialized.
Provided for backwards compatibility, but clients should actually use the
SVT specified attribute constants.
Note that this uses the SVT_MEM_ATTRIBUTE_INIT constant, although the backdoor code actually assumes that it represents all occupied locations, whether they have been initialized or written to. |