svt_mem_backdoor_base Class Reference

Inheritance diagram for class svt_mem_backdoor_base:

List of all members.


Detailed Description

This base class defines the common backdoor method signatures.



Public Member Functions

function int  compare ( 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 )
virtual 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  dump ( string filename, string filetype, bit append, svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 )
virtual 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 bit  free ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi )
virtual function bit  free_base ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 )
function string  get_formatted_name ( )
function int  get_fully_supported_features ( )
virtual function int  get_supported_features ( )
function void  initialize ( 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, svt_mem_data_t optional_data = 0 )
virtual 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 ( string filename, bit write_protected = 0 )
virtual function void  load_base ( string filename, svt_mem_address_mapper mapper = null, int modes = 0 )
function void  new ( string name = "", uvm_report_object reporter = null )
function bit  peek ( svt_mem_addr_t addr, output svt_mem_data_t data )
virtual function svt_mem_attr_t  peek_attributes ( svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 )
virtual function bit  peek_base ( svt_mem_addr_t addr, output svt_mem_data_t data, input int modes )
function bit  poke ( svt_mem_addr_t addr, svt_mem_data_t data )
virtual function void  poke_attributes ( svt_mem_attr_t attr, svt_mem_addr_t addr_lo, svt_mem_addr_t addr_hi, int modes = 0 )
virtual function bit  poke_base ( svt_mem_addr_t addr, svt_mem_data_t data, int modes = 0 )
function string  psdisplay ( string prefix = "" )

Public Attributes

uvm_report_object  reporter 

Member Typedefs

 typedef enum  compare_type_enum 
 typedef enum  init_pattern_type_enum 


Member Function Documentation

  function int
 svt_mem_backdoor_base::compare

 (  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  ) 


Compare 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. This is the method that the user should use when doing 'compare' operations.

The svt_mem_backdoor_base class provided implementation simply calls the internal method, compare_base, which is the method that classes extended from svt_mem_backdoor_base must implement.

The following comparison mode are available:

  • Subset: The content of the file is present in the memory core. The memory core may contain additional values that are ignored.
  • Strict: The content of the file is strictly equal to the content of the memory core.
  • Superset: The content of the memory core is present in the file. The file may contain additional values that are ignored.
  • Intersect: The same addresses present in the memory core and in the file contain the same data. Addresses present only in the file or the memory core are ignored.

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.


 Superseding functions 
 svt_mem_system_backdoor :: compare 

 virtual function int
 svt_mem_backdoor_base::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  ) 


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. This is the file compare method which classes extended from svt_mem_backdoor_base must implement.

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:

  • Subset: The content of the file is present in the memory core. The memory core may contain additional values that are ignored.
  • Strict: The content of the file is strictly equal to the content of the memory core.
  • Superset: The content of the memory core is present in the file. The file may contain additional values that are ignored.
  • Intersect: The same addresses present in the memory core and in the file contain the same data. Addresses present only in the file or the memory core are ignored.

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.


 Superseding functions 
 svt_mem_backdoor :: compare_base 
 svt_mem_core :: compare_base 
 svt_mem_system_backdoor :: compare_base 

  function void
 svt_mem_backdoor_base::dump

 (  string filename , string filetype , bit append , svt_mem_addr_t addr_lo , svt_mem_addr_t addr_hi , int modes = 0  ) 


Saves 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 'append' bit indicates whether the content should be appended to the file if it already exists. This is the method that the user should use when doing 'dump' operations.

The svt_mem_backdoor_base class provided implementation simply calls the internal method, dump_base, which is the method that classes extended from svt_mem_backdoor_base must implement.

filename - Name of the file to write to.

filetype - The string name of the format to be used when writing a memory dump file, either "MIF" or "MEMH".

append - Start a new file, or add onto an existing file.

addr_lo - Starting address.

addr_hi - Ending address.

modes - Optional dump modes, represented by individual constants. Supported values:

  • SVT_MEM_DUMP_ALL - Specify in order to include 'all' addresses in the output.
  • SVT_MEM_DUMP_NO_HEADER - To exclude the header at the front of the file.
  • SVT_MEM_DUMP_NO_BEGIN - To exclude the BEGIN at the start of the data block (MIF).
  • SVT_MEM_DUMP_NO_END - To exclude the END at the end of the data block (MIF).

 Superseding functions 
 svt_mem_system_backdoor :: dump 

 virtual function void
 svt_mem_backdoor_base::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  ) 


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". This is the file dump method which classes extended from svt_mem_backdoor_base must implement.

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:

  • SVT_MEM_DUMP_ALL - Specify in order to include 'all' addresses in the output.
  • SVT_MEM_DUMP_NO_HEADER - To exclude the header at the front of the file.
  • SVT_MEM_DUMP_NO_BEGIN - To exclude the BEGIN at the start of the data block (MIF).
  • SVT_MEM_DUMP_NO_END - To exclude the END at the end of the data block (MIF).
  • SVT_MEM_DUMP_APPEND - Append the contents to the existing file if found.

 Superseding functions 
 svt_mem_backdoor :: dump_base 
 svt_mem_core :: dump_base 
 svt_mem_system_backdoor :: dump_base 

  function bit
 svt_mem_backdoor_base::free

 (  svt_mem_addr_t addr_lo , svt_mem_addr_t addr_hi  ) 


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

Return values - Bit indicating the success (1) or failure (0) of the free operation.


 Superseding functions 
 svt_mem_core :: free 

 virtual function bit
 svt_mem_backdoor_base::free_base

 (  svt_mem_addr_t addr_lo , svt_mem_addr_t addr_hi , int modes = 0  ) 


Internal method to 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.


 Superseding functions 
 svt_mem_backdoor :: free_base 
 svt_mem_system_backdoor :: free_base 

  function string
 svt_mem_backdoor_base::get_formatted_name

 (   ) 


Used to get the backdoor name in a form that can easily be added to a message.

Return values - Name assigned to this backdoor formatted for inclusion in a message.

  function int
 svt_mem_backdoor_base::get_fully_supported_features

 (   ) 


Method to provide a bit vector identifying which operations are fully supported.

The backdoor class may represent multiple backdoor instances in which case this method indicates which operations are supported by all contained backdoors. Clients wishing to know which operations are supported by at least one contained backdoor should refer to the 'get_supported_features' method.

The default implementation, which should be sufficient for simple backdoor classes, simply calls 'get_supported_features' to determine which operations are supported.

Each operation included in the svt_mem_system_backdoor definition will have its own bit value. A value of '1' in the bit position associated with a specific operation indicates the operation is supported, a value of '0' indicates the operation is not supported. Note that this insures that as new operations are by default not supported.

The following masks have been defined for the currently defined operations and can be used to indicate or check specific operation support.

  • SVT_MEM_PEEK_OP_MASK
  • SVT_MEM_POKE_OP_MASK
  • SVT_MEM_LOAD_OP_MASK
  • SVT_MEM_DUMP_OP_MASK
  • SVT_MEM_FREE_OP_MASK
  • SVT_MEM_INITIALIZE_OP_MASK
  • SVT_MEM_COMPARE_OP_MASK
  • SVT_MEM_ATTRIBUTE_OP_MASK

Return values - Bit vector indicating which features are supported by this backdoor.


 Superseding functions 
 svt_mem_system_backdoor :: get_fully_supported_features 

 virtual function int
 svt_mem_backdoor_base::get_supported_features

 (   ) 


Method to provide a bit vector identifying which operations are supported.

The backdoor class may represent multiple backdoor instances in which case the method should indicate which operations are supported by at least one contained backdoor. Clients wishing to know which operations are supported by all contained backdoors should refer to the 'get_fully_supported_features' method.

Each operation included in the svt_mem_system_backdoor definition will have its own bit value. A value of '1' in the bit position associated with a specific operation indicates the operation is supported, a value of '0' indicates the operation is not supported. Note that this insures that as new operations are by default not supported.

The following masks have been defined for the currently defined operations and can be used to indicate or check specific operation support.

  • SVT_MEM_PEEK_OP_MASK
  • SVT_MEM_POKE_OP_MASK
  • SVT_MEM_LOAD_OP_MASK
  • SVT_MEM_DUMP_OP_MASK
  • SVT_MEM_FREE_OP_MASK
  • SVT_MEM_INITIALIZE_OP_MASK
  • SVT_MEM_COMPARE_OP_MASK
  • SVT_MEM_ATTRIBUTE_OP_MASK

Return values - Bit vector indicating which features are supported by this backdoor.


 Superseding functions 
 svt_mem_backdoor :: get_supported_features 
 svt_mem_system_backdoor :: get_supported_features 

  function void
 svt_mem_backdoor_base::initialize

 (  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, svt_mem_data_t optional_data = 0  ) 


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
  • rand
  • different constant value on odd and even addresses

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.

optional_data - Starting data value used for odd addresses with INIT_ODD_EVEN_CONST pattern


 Superseding functions 
 svt_mem_core :: initialize 

 virtual function void
 svt_mem_backdoor_base::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  ) 


Internal method to 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
  • rand

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


 Superseding functions 
 svt_mem_backdoor :: initialize_base 
 svt_mem_system_backdoor :: initialize_base 

  function void
 svt_mem_backdoor_base::load

 (  string filename , bit write_protected = 0  ) 


Loads memory locations with the contents of the specified file. This is the method that the user should use when doing 'load' operations.

The svt_mem_backdoor_base class provided implementation simply calls the internal method, load_base, which is the method that classes extended from svt_mem_backdoor_base must implement.

The 'write_protected' field enables write protect checking for all of the loaded memory locations.

filename - Name of the file to load. The file extension determines which format to expect.

write_protected - If supported by the backdoor, marks the addresses initialized by the file as write protected.


 Superseding functions 
 svt_mem_system_backdoor :: load 

 virtual function void
 svt_mem_backdoor_base::load_base

 (  string filename , svt_mem_address_mapper mapper = null, int modes = 0  ) 


Internal method for loading memory locations with the contents of the specified file. This is the file load method which classes extended from svt_mem_backdoor_base must implement.

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:

  • SVT_MEM_LOAD_WRITE_PROTECT - Marks the addresses initialized by the file as write protected

 Superseding functions 
 svt_mem_backdoor :: load_base 
 svt_mem_core :: load_base 
 svt_mem_system_backdoor :: load_base 

  function void
 svt_mem_backdoor_base::new

 (  string name = "", uvm_report_object reporter = null  ) 


CONSTRUCTOR: Creates a new instance of the svt_mem_backdoor_base class.

name - (optional) Used to identify the backdoor in any reported messages.

reporter - (optional but recommended) Used to report messages.


 Superseding functions 
 svt_mem_system_backdoor :: new 

  function bit
 svt_mem_backdoor_base::peek

 (  svt_mem_addr_t addr , output svt_mem_data_t data  ) 


Set the output argument to the value found at the specified address

addr - Address of data to be read.

data - Data read from the specified address.

Return values - '1' if a value was found, otherwise '0'.

 virtual function svt_mem_attr_t
 svt_mem_backdoor_base::peek_attributes

 (  svt_mem_addr_t addr_lo , svt_mem_addr_t addr_hi , int modes = 0  ) 


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:

  • SVT_MEM_ATTRIBUTE_OR - Specify to do an 'OR' of the attributes within the range.

 Superseding functions 
 svt_mem_backdoor :: peek_attributes 
 svt_mem_system_backdoor :: peek_attributes 

 virtual function bit
 svt_mem_backdoor_base::peek_base

 (  svt_mem_addr_t addr , output svt_mem_data_t data , input int modes  ) 


Internal method for reading individual address locations from the memory. This is the peek method which classes extended from svt_mem_backdoor_base must implement.

The modes argument is optional and is not used by the base class implementation.

addr - Address of data to be read.

data - Data read from the specified address.

modes - Optional access modes, represented by individual constants. No predefined values supported.

Return values - '1' if a value was found, otherwise '0'.


 Superseding functions 
 svt_mem_backdoor :: peek_base 
 svt_mem_system_backdoor :: peek_base 

  function bit
 svt_mem_backdoor_base::poke

 (  svt_mem_addr_t addr , svt_mem_data_t data  ) 


Write the specified value at the specified address.

addr - Address of data to be written.

data - Data to be written at the specified address.

Return values - '1' if the value was written, otherwise '0'.

 virtual function void
 svt_mem_backdoor_base::poke_attributes

 (  svt_mem_attr_t attr , svt_mem_addr_t addr_lo , svt_mem_addr_t addr_hi , int modes = 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.

attr - attribute to be set

addr_lo - Starting address.

addr_hi - Ending address.

modes - Optional attribute modes, represented by individual constants. Supported values:

  • SVT_MEM_ATTRIBUTE_OR - Specify to do an 'OR' of the attributes within the range.

 Superseding functions 
 svt_mem_backdoor :: poke_attributes 
 svt_mem_system_backdoor :: poke_attributes 

 virtual function bit
 svt_mem_backdoor_base::poke_base

 (  svt_mem_addr_t addr , svt_mem_data_t data , int modes = 0  ) 


Internal method for writing individual address locations to the memory. This is the poke method which classes extended from svt_mem_backdoor_base must implement.

The modes argument is optional and is not used by the base class implementation.

addr - Address of data to be written.

data - Data to be written at the specified address.

modes - Optional access modes, represented by individual constants. No predefined values supported.

Return values - '1' if the value was written, otherwise '0'.


 Superseding functions 
 svt_mem_backdoor :: poke_base 
 svt_mem_system_backdoor :: poke_base 

  function string
 svt_mem_backdoor_base::psdisplay

 (  string prefix = ""  ) 


Generates short description of the backdoor instance.

Return values - The generated description.


 Superseding functions 
 svt_mem_system_backdoor :: psdisplay 


Member Attribute Documentation

 uvm_report_object  attribute
 svt_mem_backdoor_base::reporter


SVT message macros route messages through this reference. This overrides the shared svt_sequence_item_base reporter.

Member Typedef Documentation

 typedef enum  svt_mem_backdoor_base::compare_type_enum

The same addresses present in the memory core and in the file contain the same data and addresses present only in the file or the memory core are ignored

SUBSET(SVT_MEM_COMPARE_SUBSET)
STRICT(SVT_MEM_COMPARE_STRICT)
SUPERSET(SVT_MEM_COMPARE_SUPERSET)
INTERSECT(SVT_MEM_COMPARE_INTERSECT)

 typedef enum  svt_mem_backdoor_base::init_pattern_type_enum

Pattern type to define the default value for uninitialized memory locations.

INIT_CONST(SVT_MEM_INITIALIZE_CONST)
Initialize to a constant value
INIT_INCR(SVT_MEM_INITIALIZE_INCR)
Initialize to an incrementing pattern
INIT_DECR(SVT_MEM_INITIALIZE_DECR)
Initialize to a decrementing pattern
INIT_WALK_LEFT(SVT_MEM_INITIALIZE_WALK_LEFT)
Initialize to a walking left pattern
INIT_WALK_RIGHT(SVT_MEM_INITIALIZE_WALK_RIGHT)
Initialize to a walking right pattern
INIT_RAND(SVT_MEM_INITIALIZE_RAND)
Initialize to a random pattern
INIT_ODD_EVEN_CONST(SVT_MEM_INITIALIZE_ODD_EVEN_CONST)
Initialize to different constant value for odd and even locations