beautypg.com

2 addfield(), 3 addsubfield(), 2 addfield() 12.4.3 addsubfield() – Teledyne LeCroy Summit T24 PCIe Multi-lane Protocol Analyzer User Manual User Manual

Page 229

background image

 

Summit T24 PCI Express Multi‐Lane Protocol Analyzer User Manual

217

Primitives

 Teledyne LeCroy

For example, GetRegisterField(1, 9, 2); means: Go to DWORD 1, bit offset 9, and returns 2 
bits.

12.4.2 AddField()

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 set‐
ting 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.

12.4.3 AddSubField()

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