beautypg.com

A.5 helper file – Teledyne LeCroy SimPASS PE PCI Express Software User Manual User Manual

Page 111

background image

SimPASS PE Software User Manual Appendix A: Configuration Space Decoding

LeCroy Corporation

105

AddField( field_name, field_length, configuration_reg_type, tooltip,

encoding_table = NULL )

This function adds a register field to the Capability View and returns a pointer to the field,
for adding subfields.

field_name: Name of the register field to display in the Capability View

field_length: Length of the register field

configuration_reg_type: Configuration register type of the register field.

Note: If subfields are defined, their configuration register types override this setting
for their specified bits.

tooltip: Tooltip displayed for the register field in the Capability View

encoding_table: Optional. Displays encodings as lists for select values.

For example, user input becomes a combo box for the field in the Field View.

As examples:

AddField( "PCI Express Extended Capability ID", 16, CFGREG_RO, "" );

means: Add the field “PCI Express Extended Capability ID” with length 16 and cfg register
type CFGREG_RO.
capability_reg = AddField( "Capability Register", 32, CFGREG_RW, "" );

means: Added the field “Capability Register” with length 32 and cfg register type
CFGREG_RW and stored a pointer to this field in variable capability_reg, which can be
used to add subfields to this field.

AddSubField( parent_field, subfield_name, subfield_length,

configuration_reg_type, tooltip, encoding_table = NULL );

This function adds a subfield to a register field in the Capability View. Subfields are
modifiable and visible in the Field View and appear in the tooltips of register fields.

parent_field: Pointer to a register field in the Capability View

subfield_name: Name of the subfield, displayed in the Field View

subfield_length: Length of the subfield

configuration_reg_type: Configuration register type of the subfield field.

Note: This overrides the configuration_reg_type of the parent field.

tooltip: Tooltip displayed for the subfield in the Capability View

encoding_table: Optional. Displays encodings as lists for select values.

For example, user input becomes a combo box for the field in the Field View

.

For example,

AddSubField( capability_reg, "Mode Supported", 4, CFGREG_RO, "Indicates the
Function modes," ), ModeEncodings );

means: Add the subfield “Mode Supported” to the parent field “capability_reg” with length
4, type CFGREG_RO, a tooltip in the Capability View, and a combo box displaying
“mode encodings” for input in the Field View.

A.5 Helper File

ConfigSpaceCommon.inc include file contains useful functions for script decoding.