svt_xml_writer Class Reference

Inheritance diagram for class svt_xml_writer:

List of all members.


Detailed Description

Class which can be used to open and manage the interaction with an XML file for use with the Protocol Analyzer.



Public Member Functions

function void  add_if_paths ( string if_paths[] )
function bit  add_object_successor ( string object_uid, string successor_object_uid, svt_xml_writer successor_writer = null )
function bit  add_object_successors ( string object_uid, string successor_object_uids[], svt_xml_writer successor_writer = null )
function bit  add_scope_attribute ( string attr_name, string attr_value, string scope_name = "" )
function bit  add_stream_attribute ( string attr_name, string attr_value )
function bit  begin_pa_xml ( string prot_name, string inst_name, string version = "" )
function bit  end_pa_xml ( )
function svt_xml_writer  get_active_writer ( string inst_name )
function bit  get_begin_pa_xml_done ( )
function int  get_client_control ( string name )
function bit  get_end_pa_xml_done ( )
function int  get_file ( )
function format_type_enum  get_format_type ( )
function void  new ( string prot_name, string inst_name, string version = "", string file_ext = "", string suite_name = "", svt_xml_writer :: format_type_enum format_type = FSDB )
function void  register_client_control ( string name, int value )
function bit  set_custom_relation ( string source_object_uid, string target_object_uid, string relation_type, svt_xml_writer target_writer = null )
function bit  set_custom_relations ( string source_object_uid, string target_object_uids[], string relation_type, svt_xml_writer target_writer = null )
function bit  set_object_predecessor ( string object_uid, string predecessor_object_uid, svt_xml_writer predecessor_writer = null )
function bit  write_pa_block_close ( string block_name, string prefix = "" )
function bit  write_pa_block_open ( string block_name, string block_text = "", string prefix = "" )
function bit  write_pa_child_reference ( string object_uid, string child_object_uid )
function bit  write_pa_comment ( string comment, string prefix = "" )
function bit  write_pa_field_name_string_value ( string object_uid, string name, string arr_val, string arr_exp_val, bit is_expected = 0, string prefix )
function bit  write_pa_field_name_value ( string object_uid, string name, bit [1023:0] value, bit [1023:0] expected_value, input svt_pattern_data :: type_enum typ, bit is_expected = 0, int unsigned bit_width = 0 )
function bit  write_pa_name_value ( string name, string value, string prefix = "" )
function bit  write_pa_object_begin ( string object_type, string object_uid, string parent_object_uid, string channel, realtime start_time, realtime end_time, string status, string time_unit = "" )
function bit  write_pa_object_begin_block ( string object_uid, string object_block_desc )
function bit  write_pa_object_close ( string object_uid )
function bit  write_pa_one_field_record ( string record_name, string field_name, string field_value, string prefix )

Public Attributes

static svt_data  active_cfgs [string] 
static svt_xml_writer  active_writers [string] 
vmm_log  log 
string  object_uid 

Protected Attributes

protected bit  begin_pa_xml_done = 0; 
protected int  client_control [string] 
protected bit  end_pa_xml_done = 0; 
protected int  file 
protected svt_vip_writer  vip_writer 

Member Typedefs

 typedef enum  format_type_enum 


Member Function Documentation

  function void
 svt_xml_writer::add_if_paths

 (  string if_paths []  ) 


This method calls the 'svt_vip_writer' API to add the interface path into FSDB.

if_paths - String array contains all the interface path.

  function bit
 svt_xml_writer::add_object_successor

 (  string object_uid , string successor_object_uid , svt_xml_writer successor_writer = null  ) 


This is a wrapper API provided for clients to capture the successor object information inside XML/FSDB.

This method calls the 'svt_vip_writer' method to write out the successor data to indicated XML/FSDB.

object_uid - The uid of the object to which a successor object is to be added.

successor_object_uid - The uid of the successor object.

successor_writer - The "svt_xml_writer" writer with which the successor object is associated or null for the current writer.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::add_object_successors

 (  string object_uid , string successor_object_uids [], svt_xml_writer successor_writer = null  ) 


This is a wrapper API provided for clients to capture the set of successor object's information inside XML/FSDB.

This method calls the 'svt_vip_writer' method to write out the set of successor data to indicated XML/FSDB.

object_uid - The uid of the object to which a successor objects are to be added.

successor_object_uids - The uids of the successor objects.

successor_writer - The "svt_xml_writer" writer with which the successor object is associated or null for the current writer.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::add_scope_attribute

 (  string attr_name , string attr_value , string scope_name = ""  ) 


Utility function used to add a scope attribute.

attr_name - The name of the attribute to be added.

attr_value - The value associated with the attribute

scope_name - The name of the stream for which the attribute needs to be added. If the stream name is empty then the scope attribute will be added to the 'parent' scope. The defalut stream name will be empty.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::add_stream_attribute

 (  string attr_name , string attr_value  ) 


Utility function used to add a stream attribute.

attr_name - The name of the attribute to be added.

attr_value - The value associated with the attribute

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::begin_pa_xml

 (  string prot_name , string inst_name , string version = ""  ) 


This method opens the file and writes out the XML header.

prot_name - The protocol associated with the object.

inst_name - The instance identifier for the object initiating the write.

version - The version for the object, typically the suite version.

Return values - Indicates success (1) or failure (0) of the request.

  function bit
 svt_xml_writer::end_pa_xml

 (   ) 


This method writes out the XML trailer and closes the file.

Return values - Indicates success (1) or failure (0) of the request.

  function svt_xml_writer
 svt_xml_writer::get_active_writer

 (  string inst_name  ) 


Retrive 'writer' instance for the given full hierarchical name. If the writer not found for given full hierarchical name try if any 'writer' associated for 'parent hierarchical name', if found retrive writer and register 'parent' writer to given full hierarchical name to enahance performance for subsequent retrivals.

inst_name - The full hierarchical name for the required 'writer'.

Return values - The associated writer, if writer not found returns null.

  function bit
 svt_xml_writer::get_begin_pa_xml_done

 (   ) 


Utility function for getting the begin_pa_xml_done value.

Return values - Indicates current begin_pa_xml_done value.

  function int
 svt_xml_writer::get_client_control

 (  string name  ) 


Retrieves a client control value from the XML writer.

name - The control being retrieved.

Return values - The value associated with the control. If control not found, returns -1.

  function bit
 svt_xml_writer::get_end_pa_xml_done

 (   ) 


Utility function for getting the end_pa_xml_done value.

Return values - Indicates current end_pa_xml_done value.

  function int
 svt_xml_writer::get_file

 (   ) 


Get a handle to the file that is being written to.

  function format_type_enum
 svt_xml_writer::get_format_type

 (   ) 


Method used to get the format type of the writer.

Return values - The format type associated with the writer.

  function void
 svt_xml_writer::new

 (  string prot_name , string inst_name , string version = "", string file_ext = "", string suite_name = "", svt_xml_writer :: format_type_enum format_type = FSDB  ) 


CONSTRUCTOR: Creates a new instance of the svt_xml_writer class.

prot_name - The protocol associated with the object.

inst_name - The instance identifier for the object initiating the write.

version - The version for the object, typically the suite version.

file_ext - Optional file extension. Only required for suites that support PA with multiple sub-protocols.

suite_name - Optional string associated with suite name of the protocol. For suites with multiple sub protocol this value indentifies the suite_name for the protocol. For single suite protocol this field should be empty. For example in case of ddr family of protocol where the protocol name is ddr3_svt the suite_name field value should carry "ddr_svt" and the prot_name filed value should be ddr3_svt.

format_type - Optional file dump format. 'FSDB' (the default) writes out data in FSDB format, 'FSDB_PERF_ANALYSIS' writes out data in FSDB format optimized for Performance Analyzer, 'XML' writes out data in XML format, 'BOTH' writes out data in both XML and FSDB format.

  function void
 svt_xml_writer::register_client_control

 (  string name , int value  ) 


Registers a client control with the XML writer.

name - The control being registered.

value - The value being registered with the control. Must be >= 0.

  function bit
 svt_xml_writer::set_custom_relation

 (  string source_object_uid , string target_object_uid , string relation_type , svt_xml_writer target_writer = null  ) 


This is a wrapper API provided for clients to capture the custom object relation inside FSDB.

This method calls the 'svt_vip_writer' method to write out the identical relation into indicated FSDB.

source_object_uid - The uid of the object whose custom relation object is to be specified.

target_object_uid - The uid of the custom relation object.

relation_type - The custom relation type which needs to associated, eg: if the two transactions are identical then the relation type value should 'identical'.

target_writer - The "svt_xml_writer" instance with which the identical object is associated or null for the current writer.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::set_custom_relations

 (  string source_object_uid , string target_object_uids [], string relation_type , svt_xml_writer target_writer = null  ) 


This is a wrapper API provided for clients to capture the custom object relation inside FSDB.

This method calls the 'svt_vip_writer' method to write out the identical relation into indicated FSDB.

source_object_uid - The uid of the object whose custom relation object is to be specified.

target_object_uids - Set of uids of the custom relation objects.

relation_type - The custom relation type which needs to associated, eg: if the two transactions are identical then the relation type value should 'identical'.

target_writer - The "svt_xml_writer" instance with which the identical object is associated or null for the current writer.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::set_object_predecessor

 (  string object_uid , string predecessor_object_uid , svt_xml_writer predecessor_writer = null  ) 


This is a wrapper API provided for clients to capture the predecessor object information inside XML/FSDB.

This method calls the 'svt_vip_writer' method to write out the predecessor data to indicated XML/FSDB.

object_uid - The uid of the object whose predecessor object is to be specified.

predecessor_object_uid - The uid of the predecessor object.

predecessor_writer - The "svt_xml_writer" instance with which the predecessor object is associated or null for the current writer.

Return values - The status of the operation; 1 = success, 0 = failure.

  function bit
 svt_xml_writer::write_pa_block_close

 (  string block_name , string prefix = ""  ) 


This method writes the XML trailer to the indicated XML file.

block_name - The name of the block being closed.

prefix - String to be placed at the beginning of the output.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_block_open

 (  string block_name , string block_text = "", string prefix = ""  ) 


This method writes the XML header to the file.

block_name - The name of the block being opened.

block_text - Text to be inserted as part of the block 'open' statement.

prefix - String to be placed at the beginning of the output.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_child_reference

 (  string object_uid , string child_object_uid  ) 


This method writes child references to the file.

object_uid - The current object uid.

child_object_uid - Child object uid.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_comment

 (  string comment , string prefix = ""  ) 


This method writes a comment to the indicated XML file. This method is deprecated shouldn't be used in new implementation. Added to support backward compatibiltiy.

comment - Comment to be saved to the file.

prefix - String to be placed at the beginning of the output.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_field_name_string_value

 (  string object_uid , string name , string arr_val , string arr_exp_val , bit is_expected = 0, string prefix  ) 


This method writes field name and an a string representation of associated value to the indicated XML/FSDB file.

object_uid - Unique id of the object for which the name value to be written.

name - Name of the filed.

arr_val - The filed value.

arr_exp_val - The expected value of the field.

is_expected - The bit indicates expected value present or not.

prefix - The prefix to be written in the begining

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_field_name_value

 (  string object_uid , string name , bit [1023:0] value , bit [1023:0] expected_value , input svt_pattern_data :: type_enum typ , bit is_expected = 0, int unsigned bit_width = 0  ) 


This method writes field name/value pair to XML/FSDB, the value will always be in bit vector converted to right data type and written out to XML/FSDB accordingly.

object_uid - The unique identification of the object.

name - The name of the field to be written out.

value - The value to be written out.

expected_value - The expected value of the field

typ - The data type of the field value

is_expected - The bit indicates expected value is present or not

bit_width - Width of the field, in bits. Only applicable to fields with typ svt_pattern_data :: BITVEC. 0 indicates "not set".

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_name_value

 (  string name , string value , string prefix = ""  ) 


This method writes a name/value pair to the indicated XML file. This method is added to set the filed name and field value to the current object to be written to XML. This method is used only for backward compatibility where some clients directly called the field value writing. This methods needs to be removed once all the clients moved to new writer methods.

name - Name to be saved for the property.

value - Value to be saved for the property.

prefix - String to be placed at the beginning of the output.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_object_begin

 (  string object_type , string object_uid , string parent_object_uid , string channel , realtime start_time , realtime end_time , string status , string time_unit = ""  ) 


This method writes the object begin information to the file.

object_type - The object type.

object_uid - The unique indentification value required for relationship handling.

parent_object_uid - The parent unique indentification value required for parent child relation.

channel - The channel of object.

start_time - The start time of the object.

end_time - The end time of the object. Added to support backward compatibility.

status - The object status.

time_unit - The time unit used during the simulation.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_object_begin_block

 (  string object_uid , string object_block_desc  ) 


This method writes object begin block to XML file. This method is added only to support backward compatibility for existing VIPs, shouldn't be used by any new VIPs tor existing VIPs updatingPA XML support.

object_uid - Unique id of the object for which the name value to be written.

object_block_desc - String holds the PA object begin XML data.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_object_close

 (  string object_uid  ) 


This method writes the object end information to the file.

object_uid - The unique identification value of the object.

Return values - Indicates success (1) or failure (0) of the write.

  function bit
 svt_xml_writer::write_pa_one_field_record

 (  string record_name , string field_name , string field_value , string prefix  ) 


This method writes a one field record out to the indicated XML file.

record_name - The name given to the record.

field_name - The name of the one field in the record.

field_value - The value of the one field of the record.

prefix - String to be placed at the beginning of the output.

Return values - Indicates success (1) or failure (0) of the write.


Member Attribute Documentation

 static svt_data  attribute
 svt_xml_writer::active_cfgs[string]


Register active configuration, provides a way to cache cfg handles when the request to save a cfg occurs before the creation of the writer. The writer creation then accesses this cache to obtain a handle to the cfg and insure it is written into XML/FSDB.

 static svt_xml_writer  attribute
 svt_xml_writer::active_writers[string]


Register active writer when created, the string value is the component the writer is associated.

 protected bit  attribute
 svt_xml_writer::begin_pa_xml_done = 0


Flag to indicate whether we have executed the 'begin' for the xml.

 protected int  attribute
 svt_xml_writer::client_control[string]


Additional controls that clients can register and access during generation.

 protected bit  attribute
 svt_xml_writer::end_pa_xml_done = 0


Flag to indicate whether we have executed the 'begin' for the xml.

 protected int  attribute
 svt_xml_writer::file


Handle to the file that is being written to.

 vmm_log  attribute
 svt_xml_writer::log


Built-in shared log instance that will be used by the XML writer instance.

 string  attribute
 svt_xml_writer::object_uid


Holds the uid for the current object. Added to support backward compatibility.

 protected svt_vip_writer  attribute
 svt_xml_writer::vip_writer


VIP Writer instance to create FSDB or XML

Member Typedef Documentation

 typedef enum  svt_xml_writer::format_type_enum
FSDB(SVT_WRITER_FORMAT_FSDB)
FSDB_PERF_ANALYSIS(SVT_WRITER_FORMAT_FSDB_PERF_ANALYSIS)
XML(SVT_WRITER_FORMAT_XML)
BOTH(SVT_WRITER_FORMAT_XML_N_FSDB)