winIDEA SDK
isys::CTraceBinExportFormat Class Reference

Description

This class configures contents of Binary export.

It is highly recommended to set format to header version 2 (EHeaderVer2), and to export also the presence flags. This way the file format is self descriptive and can be parsed anytime later. In all other cases we have to store the file format separately, but even then the file may not be parseable - for example, if addresses and OCD are exported, than samples with OCD may not have data for addresses, and there is no way to find this out from the information in file. Use export without presence flags only when file size is really critical, and you know that all exported data is present in each sample.

winIDEA 9.12.x note: If parsing binary data without header or with header version 1, always call setNumBusStatusBytes(4) on this object, because it is set to 8 by default.

test_ctrace_bin_export_format.py

#include <CTraceController.h>

Inheritance diagram for isys::CTraceBinExportFormat:
isys::CTraceFormatBase

Public Types

enum  EHeaderVersion { EHeaderVer1 = 1 , EHeaderVer2 = 2 }
 This enum defines available versions of trace binary export file headers. More...
 
enum  EPresenceFlags {
  EDataItem = 0x01 , EAddressItem = 0x02 ,
  EMemAreaItem = 0x04 , ETimeStampItem = 0x8 ,
  EBusStatusItem = 0x10 , ESampleIndexItem = 0x20 ,
  EOCDItem = 0x40 , EAUXItem = 0x80 ,
  EPresenceFlagsItem = 0x0100 , ETraceSourceIdItem = 0x0200
}
 This enum defines bit flags for presence of specific data in binary export. More...
 
enum  EExportFormat {
  EFmtText , EFmtCSV ,
  EFmtBinary , EFmtXML
}
 This enum defines constants for export formats. More...
 

Public Member Functions

 CTraceBinExportFormat ()
 Creates object with default values. More...
 
CTraceBinExportFormatSPtr setHeader (bool isHeader)
 If true, header is saved to binary export. More...
 
CTraceBinExportFormatSPtr setHeaderVersion (EHeaderVersion headerVersion)
 Sets header version. More...
 
CTraceBinExportFormatSPtr setNumOfCpuBuses (int numberOfCpuBusses)
 Sets the number of CPU buses. More...
 
CTraceBinExportFormatSPtr setNumMAUs (int numMAUs)
 Sets the number of valid MAUs in the data item. More...
 
CTraceBinExportFormatSPtr setNumBusStatusBytes (int numBusStatusBytes)
 Sets the number of valid bus status bytes in the bus status item. More...
 
CTraceBinExportFormatSPtr setTraceItemFlags (unsigned short presenceFlags)
 Sets flags, where each bit defines, which trace items should be exported. More...
 
CTraceBinExportFormatSPtr addTraceItem (EPresenceFlags presenceFlag)
 Adds the given trace item to export.
 
CTraceBinExportFormatSPtr removeTraceItem (EPresenceFlags presenceFlag)
 Removes the given trace item from export.
 
bool isHeader ()
 Returns true, if header will be exported.
 
EHeaderVersion getHeaderVersion ()
 Returns export header version.
 
std::string getHeaderVersionAsStr ()
 Returns export header version as string.
 
int getNumOfCpuBuses ()
 Returns the number of CPU buses as set by setNumOfCpuBuses()
 
int getNumMAUs ()
 Returns the number of MAUs as set by setNumMAUs()
 
int getNumBusStatusBytes ()
 Returns the number of valid bus status bytes as set by setNumBusStatusBytes()
 
unsigned short getPresenceFlags ()
 Returns presence flags, which indicate which trace items should be exported. More...
 
bool isTraceItem (CTraceBinExportFormat::EPresenceFlags itemMask)
 Returns true, if trace item specified in itemMask is available.
 
void setOptions (CIDEController &ide, const std::string &docFileName)
 Writes options to winIDEA. More...
 
EExportFormat getExportFormat ()
 Returns value used for option /TraceExport.Type.
 
virtual std::string getExportFormatAsStr ()
 Returns string with export format, suitable for setting winIDEA trace export format option.
 

Member Enumeration Documentation

◆ EExportFormat

This enum defines constants for export formats.

Enumerator
EFmtText 

text export

EFmtCSV 

CSV export.

EFmtBinary 

binary export

EFmtXML 

XMl export.

◆ EHeaderVersion

This enum defines available versions of trace binary export file headers.

Enumerator
EHeaderVer1 

the old header, without information about file format

EHeaderVer2 

the new header, which contains file format info

◆ EPresenceFlags

This enum defines bit flags for presence of specific data in binary export.

Enumerator
EDataItem 

data is present

EAddressItem 

address is present

EMemAreaItem 

memory area is present

ETimeStampItem 

timestamp is present

EBusStatusItem 

bus status is present

ESampleIndexItem 

sample and subsample indices are present

EOCDItem 

On Chip Data is present.

EAUXItem 

AUX is present.

EPresenceFlagsItem 

presence flags are saved in the file,

this flag is set only in file header

ETraceSourceIdItem 

trace source ID is present

Constructor & Destructor Documentation

◆ CTraceBinExportFormat()

isys::CTraceBinExportFormat::CTraceBinExportFormat ( )
inline

Creates object with default values.

Most important, header version 2 and presence flags are saved to file. Change these two settings only if the export file size really matters.

Member Function Documentation

◆ getPresenceFlags()

unsigned short isys::CTraceBinExportFormat::getPresenceFlags ( )
inline

Returns presence flags, which indicate which trace items should be exported.

See also
EPresenceFlags
setPresenceFlags()

◆ setHeader()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setHeader ( bool  isHeader)
inline

If true, header is saved to binary export.

Default: true.

◆ setHeaderVersion()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setHeaderVersion ( EHeaderVersion  headerVersion)
inline

Sets header version.

Default: EHeaderVer2.

◆ setNumBusStatusBytes()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setNumBusStatusBytes ( int  numBusStatusBytes)
inline

Sets the number of valid bus status bytes in the bus status item.

Default: 4.

◆ setNumMAUs()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setNumMAUs ( int  numMAUs)
inline

Sets the number of valid MAUs in the data item.

Default: 4. Should be set to 4 for winIDEA 9.12.x, and 8 for winIDEA 9.17 and newer, if trace header version 2 is not available.

◆ setNumOfCpuBuses()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setNumOfCpuBuses ( int  numberOfCpuBusses)
inline

Sets the number of CPU buses.

This value is not used during export - all buses are always exported, but only during parsing. Default: 1.

◆ setOptions()

void isys::CTraceBinExportFormat::setOptions ( CIDEController ide,
const std::string &  docFileName 
)
inlinevirtual

Writes options to winIDEA.

This method is automatically called by CTraceController::exportData(). This method sets only configuration for binary format, but does not set trace export format to binary (modifies only options '/Document/<fname>/TraceExport.Bin.*').

Parameters
ideide controller
docFileNamedocument file name relative to winIDEA workspace location

Implements isys::CTraceFormatBase.

◆ setTraceItemFlags()

CTraceBinExportFormatSPtr isys::CTraceBinExportFormat::setTraceItemFlags ( unsigned short  presenceFlags)
inline

Sets flags, where each bit defines, which trace items should be exported.

See also
EPresenceFlags