v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha
v10.50 v10.55 Alpha v10.54 Alpha v10.53 Alpha v10.52 Alpha v10.51 Alpha

Commands

The following commands are available for the USB4 Exerciser.

Set

Modifies a field in the sent packet buffer, global settings, protocol timers, and Exerciser’s Sideband Registers. For setting a field in global settings, protocol timers and Sideband Registers, you need to use two predefined variables, $USB4GlobalSettings, $USB4Timers and $USB4SBRegisters respectively. But for the sent packet, you need to create your own custom variable inherited from USB4Packet. When such a variable is used as the first operand, it refers to the sent packet and if it is used as the second operand, it refers to the latest received packet.

Set [$Variable].[Field] = [numeric value]
Set [$Variable].[Field] = [$Variable].[Field]

Examples

Set $USB4GlobalSettings.DataRole = USB4_DEVICE

OR

Struct ControlPacketBase : USB4Packet
{
     : USB4TPHeader
     : USB4RouteString
     : USB4ReadWriteControlData
 }
$sent_packet_header = ControlPacketBase

Set $sent_packet_header.AdapterNum = 3

# Copy HopId of the received packet to the sent packet
Set $sent_packet_header.HopId = $sent_packet_header.HopId 

# Define a Control packet with one DWORD payload. It represents a Request command to read/write the third Register of the Lane Adapter Configuration space.
$sent_packet = ControlPacketBase 

{
     : LANE_ADP_CS_2
}

Set $sent_packet.CS_2_LogicalLayerErr = 0x2


USB4_StartRouter

Starts a Router based on the specified Protocol and Data Role in $USB4GlobalSettings. It adds some default configuration spaces and handles PowerDelivery Discovery and Entry flow, sideband Lane initialization and Router initialization until after the lane bonding.

USB4_StartRouter( USB4StartRouterSettings $setting )

Parameters

: USB4StartCMSettings

Refer to USB4StartCM for the list of fields

: USB4StartDeviceSettings

Refer to USB4StartDeviceSettings for the list of fields

Examples

$setting = USB4StartRouterSettings
{
    SkipBonding = USB4_TRUE
}
Call USB4_StartRouter( $setting )

OR

Call USB4_StartRouter()


USB4_SetupPath

Configures Paths for the enabled Tunneled Protocols.

USB4_SetupPath( USB4_SetupPathSettings $settings )

Parameters/USB4_SetupPathSettings

Field Name

Possible Values

Description

USB3GenTPathCreditAllocated

1 .. 127

or

USB4_INVALID_VALUE

When set to USB4_INVALID_VALUE, the Buffer Allocation Request Operation is used to allocate Buffers for existing Path.

USB3GenTPathPMSupport

USB4_FALSE

USB4_TRUE


USB3GenTPathWeight

0 .. 15


USB3GenTPathPriority

0 .. 7


USB3GenTPathIFCFlag

0/1


USB3GenTPathEFCFlag

0/1


USB3GenTPathISEFlag

0/1


USB3GenTPathESEFlag

0/1


Example

$path_settings = USB4_SetupPathSettings
{
   USB3GenTPathPMSupport = USB4_TRUE

   USB3GenTPathIFCFlag = 1
   USB3GenTPathEFCFlag = 1
   USB3GenTPathISEFlag = 1
   USB3GenTPathESEFlag = 1
}
Call USB4_SetupPath( $path_settings ) 


USB4_TeardownPath

Tears down all existing Paths.

USB4_TeardownPath()

Example

Call USB4_TeardownPath()


USB4_StartUSB3Enumeration

Initiates USB3 Enumeration procedure. If the Tunneled USB3 link is not in the U0 state it waits for it.

USB4_StartUSB3Enumeration()

Example

Call USB4_StartUSB3Enumeration()


USB4_SendOOBM

Sends Tunneled USB3 GenT OOBM packets with the specified interval time.

USB4_SendOOBM( type, count, time_interval_ns )

Parameters (default values in bold)

type

SB4_USB3_SEND_OOBM_TYPE_LINK_ERROR

SB4_USB3_SEND_OOBM_TYPE_PORT_DISABLE

SB4_USB3_SEND_OOBM_TYPE_RESET_DONE

SB4_USB3_SEND_OOBM_TYPE_U3_RESUME

SB4_USB3_SEND_OOBM_TYPE_PORT_RESET

SB4_USB3_SEND_OOBM_TYPE_LINK_READY

count


time_interval_ns


Example

Call USB4_SendOOBM( USB4_USB3_SEND_OOBM_TYPE_LINK_READY, 2, 8000 )


USB4_DisconnectRouter

Sends SB Disconnect, exits PowerDelivery Alt mode, and disconnect the Type-C connection.

C++
USB4_DisconnectRouter()

Example

Call USB4_DisconnectRouter()

USB4_Pause

Pauses execution of the Main function. It will resume when ResumeUSB4Generation() API is called. The Tag parameter allows the WaitForUSB4GenerationPauseTag() API to differentiate pause commands used in a script.

USB4_Pause( tag )

Example

Call USB4_Pause( 20 )

USB4_Delay

Adds a delay before running the next command in the script. Note that the delay will be equal or bigger than the specified value but not less.

USB4_Delay( time_micro_sec )

Parameters

time_micro_sec

Possible values: 0 to 0xFFFFFFFF

Example

Call USB4_Delay( 1000 )

USB4_InfiniteDelay

Adds an infinite delay, causing the script to run indefinitely while allowing the Exerciser to continue responding to incoming commands. Note that the Exerciser must be stopped manually or will automatically stop once the recording memory buffer gets full.

USB4_InfiniteDelay( )

Example

Call USB4_InfiniteDelay()

USB4_Loop

A runtime instruction to repeat command(s) for the specified count.

USB4_Loop( count )

Parameters

count

Possible values:

0 to 65534

USB4_INFINITE_LOOP_COUNT

Example

USB4_Loop( 1000 )
{
	# Optional commands
}

USB4_StopRecording

Stops the current recording. Stops the Exerciser as well.

USB4_StopRecording()

Example

Call USB4_StopRecording()

USB4_SendSBTransaction

Sends a Transaction on sideband channel. The parameter can be a variable of the types shown below.

USB4_SendSBTransaction( USB4SendSBTransactionSettings $settings, $transsaction_struct )

Parameters/USB4SendSBTransactionSettings

Default settings are listed in bold.

Field Name

Possible Values

Description

AutoCLSE

USB4_FALSE

USB4_TRUE

Used for LT Transactions only. Set it to false if you want to have error injection on CLSE.

AutoCELSE

USB4_FALSE

USB4_TRUE

Used for ELT Transactions only. Set it to false if you want to have error injection on CELSE.

AutoCRC

USB4_FALSE

USB4_TRUE

Used for AT, Broadcast RT and Addressed RT Transactions. Set to false for injecting CRC error.

AutoFEInsertion

USB4_FALSE

USB4_TRUE

Used for AT and RT Transactions to automatically insert extra FEh symbol for FEh symbols in the data and CRC16.

$transsaction_struct: A variable of the following templates to be sent on Sideband channel

  • USB4_LT_Transaction

  • USB4_AT_Transaction

  • USB4_Broadcast_RT_Transaction

  • USB4_Addressed_RT_Transaction

  • USB4_ELT_Transaction

Example

$settings = USB4SendSBTransactionSettings
{
    AutoCLSE = USB4_FALSE
}
$transsaction_struct = USB4_LT_Transaction
{
    LSELane = 1
    CLSE = 0x00
}
Call USB4_SendSBTransaction( $settings, $transsaction_struct )

USB4_SendReadRequest

Sends a Control packet Read Request.

USB4_SendReadRequest( USB4SendCtrlReadWriteSettings $settings )

Parameters/USB4SendCtrlReadWriteSettings

Default values in bold.

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0


CM

0

1


RouteStringLow

0


Address

0

If CapabilityID is zero, it is an absolute address otherwise it is an offset within selected capability by CapabilityID.

DataSize

0


AdapterNum

0

If the AdapterType is set to USB4_ADP_TYPE_INVALID, then it represents the target Adapter Number.

AdapterType

USB4_ADP_TYPE_INVALID 

USB4_LANE_ADP

USB4_HI_ADP

USB4_PCIE_DN_ADP

USB4_PCIE_UP_ADP

USB4_DP_OUT_ADP

USB4_DP_IN_ADP

USB4_USB3_DN_ADP

USB4_USB3_UP_ADP

USB4_USB3_GenT_DN_ADP

USB4_USB3_GenT_UP_ADP

If it is set, dynamically detect the target Adapter Number based on the AdapterIndex

AdapterIndex

0

Represents the index of the adapter within this particular type of adapter. If the AdapterType is set, the target Adapter Number will be dynamically detected based on this field.

ConfigurationSpace

USB4_PATH_CFG

USB4_ADAPTER_CFG

USB4_ROUTER_CFG

USB4_COUNTERS_CFG


SequenceNumber

0

Ignored if AutoSequenceNumber is true.

AutoSequenceNumber

USB4_FALSE

USB4_TRUE

If true, SequenceNumber is handled internally.

CapabilityID

0

USB4_CFG_CAP_TMU

USB4_CFG_CAP_LANE

USB4_CFG_CAP_USB4

USB4_CFG_CAP_PCIE

USB4_CFG_CAP_DP_IN

USB4_CFG_CAP_DP_OUT USB4_CFG_CAP_USB3

USB4_CFG_CAP_VS

Refer to Address field.

WaitForResponse

USB4_FALSE

USB4_TRUE

If true, command waits to receive the response.

HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

CopyResponseForWrite

USB4_FALSE

USB4_TRUE

If true, the received response payload will be provided for the next Write Command. The Write Command can use it by setting ImmediatePayload to USB4_FALSE.

Example

$settings = USB4SendCtrlReadWriteSettings
{
    Lane = USB4_LANE_0
    
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    Address = 0x02 # offset within TMU capability
    CapabilityID = USB4_CFG_CAP_TMU
    
    ConfigurationSpace = USB4_ROUTER_CFG
}
Call USB4_SendReadRequest( $settings )

USB4_SendWriteResponse

Sends a Control packet write Response.

USB4_SendWriteResponse( USB4SendCtrlReadWriteSettings $settings )

Parameters/USB4SendCtrlReadWriteSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

Address

0


DataSize

0


AdapterNum

0


AutoAdapterNum

USB4_FALSE

USB4_TRUE


ConfigurationSpace

USB4_PATH_CFG

USB4_ADAPTER_CFG

USB4_ROUTER_CFG

USB4_COUNTERS_CFG


SequenceNumber

0

Ignored if AutoSequenceNumber is true.

AutoSequenceNumber

USB4_FALSE

USB4_TRUE

If true, SequenceNumber is copied from the latest received Control packet internally.

AutoRouteString

USB4_FALSE

USB4_TRUE

If true, RouteString is copied from the latest received Control packet internally.

HECErrorMask

0x00

If not zero, the corresponding bit of 1 one in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

Example

$settings = USB4SendCtrlReadWriteSettings
{
    Lane = USB4_LANE_1
    
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
}
Call USB4_SendWriteResponse ( $settings )

USB4_SendReadResponse

Sends a Control packet Read Response.

USB4_SendReadResponse( USB4SendCtrlReadWriteSettings $settings, $data )

Parameters/USB4SendCtrlReadWriteSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

Address

0


DataSize

0


AdapterNum

0


AutoAdapterNum

USB4_FALSE

USB4_TRUE


ConfigurationSpace

USB4_PATH_CFG

USB4_ADAPTER_CFG

USB4_ROUTER_CFG

USB4_COUNTERS_CFG


SequenceNumber

0

Ignored if AutoSequenceNumber is true.

AutoSequenceNumber

USB4_FALSE

USB4_TRUE

If true, SequenceNumber is copied from the latest received Control packet internally.

AutoRouteString

USB4_FALSE

USB4_TRUE

If true, RouteString is copied from the latest received Control packet internally.

HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

$data: Data payload of the Read Response

Example

$data = USB4VarContainer
{
	Data = { 00 11 22 33 }
}
$settings = USB4SendCtrlReadWriteSettings
{
    Lane = USB4_LANE_0
    
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    Address = 0
    DataSize = 1
    AdapterNum = 1
    ConfigurationSpace = USB4_ADAPTER_CFG
}
Call USB4_SendReadResponse( $settings, $data )

USB4_SendWriteRequest

Sends a Control packet Write Request. If ImmediatePayload field in the settings is true, the second parameter is used as the Write Data Payload otherwise the provided data in the send buffer is used.

USB4_SendWriteRequest( USB4SendCtrlReadWriteSettings $settings, $data )

Parameters/USB4SendCtrlReadWriteSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

Address

0

If CapabilityID is zero, it is an absolute address otherwise it is an offset within selected capability by CapabilityID.

DataSize

0


AdapterNum

0

If the AdapterType is set to USB4_ADP_TYPE_INVALID, then it represents the target Adapter Number.

AdapterType

USB4_ADP_TYPE_INVALI

USB4_LANE_ADP

USB4_HI_ADP

USB4_PCIE_DN_ADP

USB4_PCIE_UP_ADP

USB4_DP_OUT_ADP

USB4_DP_IN_ADP

USB4_USB3_DN_ADP

USB4_USB3_UP_ADP

USB4_USB3_GenT_DN_ADP

USB4_USB3_GenT_UP_ADP

If set, dynamically detects the target Adapter Number based on the AdapterIndex.

AdapterIndex

0

Represents the index of the adapter within this particular type of adapter. If the AdapterType is set, the target Adapter Number will be dynamically detected based on this field.

ConfigurationSpace

USB4_PATH_CFG

USB4_ADAPTER_CFG

USB4_ROUTER_CFG

USB4_COUNTERS_CFG


SequenceNumber

0

Ignored if AutoSequenceNumber is true.

AutoSequenceNumber

USB4_FALSE

USB4_TRUE

If true, SequenceNumber is copied from the latest received Control packet internally.

AutoRouteString

USB4_FALSE

USB4_TRUE

If true, RouteString is copied from the latest received Control packet internally.

ImmediatePayload

USB4_FALSE

USB4_TRUE

If true, the passed data to the command is used as Read Response payload otherwise the data provided by the previous Read command is used.

CapabilityID

0

USB4_CFG_CAP_TMU

USB4_CFG_CAP_LANE

USB4_CFG_CAP_USB4

USB4_CFG_CAP_PCIE

USB4_CFG_CAP_DP_IN

USB4_CFG_CAP_DP_OUT USB4_CFG_CAP_USB3

USB4_CFG_CAP_VS

Refer to Address field.

WaitForResponse

USB4_FALSE

USB4_TRUE

If true, command waits to receive the response.

HECErrorMask

0x00

If it is not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

$data: Data payload of the Write Request

Example

$data = USB4VarContainer
{
    Data = { 00 11 22 33 }
}
$settings = USB4SendCtrlReadWriteSettings
{
    Lane = USB4_LANE_0
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    Address = 0
    DataSize = 1
    AdapterNum = 1
    ConfigurationSpace = USB4_ADAPTER_CFG
}
Call USB4_SendWriteRequest( $settings, $data )

USB4_ResetRouterCfg

Clears all added structures to Router Configuration space.

USB4_ResetRouterCfg( router_id )

USB4_AddRouterCfg

Appends a structure to the Router Configuration space. Note that you need to set the proper NextCapPointer manually.

USB4_AddRouterCfg( router_id, USB4TemplateBase $cfg_struct )

Example

struct_size_dw = pkt_size( USB4RouterCfgSpace ) / 4
$router_cfg_struct = USB4RouterCfgSpace
  {
    CS_0_VendorID  = 0x05FF
    CS_0_ProductID = 0x0004
    
    CS_1_NextCapPointer   = struct_size_dw
    CS_1_MaxAdapter        = 5
    CS_1_UpstreamAdapter = 1
    CS_1_RevisionNumber  = 0x6
}
Call USB4_AddRouterCfg( 0, $router_cfg_struct )

USB4_AddAdapterCfg

Appends a structure to Configuration space of the specified Adapter. Note that you need to set the proper NextCapPointer manually.

USB4_AddRouterCfg( router_id, adapter_num, USB4TemplateBase $cfg_struct )

Example

struct_size_dw = pkt_size( USB4BasicAdapterCfgSpace ) / 4
$adapter_cfg_struct_baseic = USB4BasicAdapterCfgSpace
{
    CS_1_NextCapPointer  = struct_size_dw
    CS_2_AdpTypeSubtype  = USB4_ADP_TYPE_LANE
    CS_2_AdpTypeVersion  = USB4_ADP_VER_LANE
    CS_2_AdpTypeProtocol = USB4_ADP_PRO_LANE
    CS_3_AdapterNumber = 1
    CS_5_MaxInputHopID  = 19
    CS_5_MaxOutputHopID = 19
}
USB4_AddRouterCfg( 0, 1, $adapter_cfg_struct_baseic )

USB4_ResetAdapterCfg

Clears all added structures to the specified Adapter Configuration space.

USB4_ResetAdapterCfg( router_id, adapter_num )

USB4_SetDefaultCfgSpaces

Adds default Configuration Spaces based on $USB4GlobalSettings.DataRole. To add your own Configuration Spaces, use the USB4_ResetRouterCfg, USB4_AddRouterCfg(), USB4_ResetAdapterCfg, and USB4_AddAdapterCfg() commands.

USB4_SetDefaultCfgSpaces()

Example

Call USB4_SetDefaultCfgSpaces()

USB4_SetCurrentCfgSpaceCap

Changes previously added configuration spaces.

USB4_SetCurrentCfgSpaceCap( router_id , adapter_id, space_type, cap_id, vsc_index )

Parameters

space_type

Possible values:

  • USB4_ROUTER_CFG

  • USB4_ADAPTER_CFG

router_id


adapter_id

Possible values:

  • 1 … 64

  • USB4_UPSTREAM_LANE_ADAPTER

  • USB4_DOWNSTREAM_LANE_ADAPTER

cap_id

Possible values:

  • USB4_CFG_CAP_TMU

  • USB4_CFG_CAP_LANE

  • USB4_CFG_CAP_USB4

  • USB4_CFG_CAP_PCIE

  • USB4_CFG_CAP_DP_IN

  • USB4_CFG_CAP_DP_OUT

  • USB4_CFG_CAP_USB3

  • USB4_CFG_CAP_VS

vsc_index


Example

# To enable CS_0_CL0sSupport in the upstream Lane Adapter Configuration Space

Call USB4_SetCurrentCfgSpaceCap( 0, USB4_UPSTREAM_LANE_ADAPTER, USB4_ADAPTER_CFG, USB4_CFG_CAP_LANE )

$lane_adp_cfg = USB4LaneAdapterCfgCap

Set $lane_adp_cfg.CS_0_CL0sSupport = USB4_TRUE

TBT3_EnterAlternateMode

Handles Type-C connectivity, Power Delivery TBT3 discovery, and entry process.

TBT3_EnterAlternateMode()

Example

Call TBT3_EnterAlternateMode()

USB4_EnterAlternateMode

Handles Type-C connectivity, Power Delivery USB4 discovery, and entry process.

USB4_EnterAlternateMode()

Example

Call USB4_EnterAlternateMode()

USB4_StartCM

Starts Connection Managers tasks, including Router enumeration, Adapters enumeration, and Lane Bonding.

USB4_StartCM( USB4StartCMSettings $setting )

Parameters/USB4StartCMSettings

Field Name

Possible Values (defaults in bold)

Description

SkipEnumerateRouter

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipCheckRouterReady

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipEnumerateAdapters

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipBonding

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

StartBondingAfterPUT

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipNextRoutersEnum

USB4_FALSE

USB4_TRUE

To enumerate only the first Router

Only for Host Exerciser.

SkipPathSetup

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipUSB3Enumeration

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SkipWaitForUSB3U0

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

WaitForBonding

USB4_FALSE

USB4_TRUE

Only for Device Exerciser.

Examples

$cm_settings = USB4StartCMSettings
{
    SkipBonding = USB4_TRUE
}
Call USB4_StartCM( $cm_settings )

OR

Call USB4_StartCM()


USB4_EnumerateRouter

Starts the Connection Manager’s Router Enumeration task.

USB4_EnumerateRouter()

Example

Call USB4_EnumerateRouter()

USB4_CheckRouterReady

After router enumeration, the Connection Manager keeps reading the Router configuration space to check for router readiness.

USB4_CheckRouterReady()

Examples

Call USB4_CheckRouterReady()

USB4_EnumerateAdapters

As a Connection Manager task, call this function to scan the Router Adapters to identify Adapter Number and Adapter Type.

USB4_EnumerateAdapters()

Examples

C++
Call USB4_EnumerateAdapters()

USB4_SetRouterConfiguration

As a Connection Manager task, call this function to enable Tunneling protocols and set Configuration Valid bit.

USB4_SetRouterConfiguration()

Examples

C++
Call USB4_SetRouterConfiguration()

USB4_CheckConfigurationReady

After adapter enumeration, the Connection Manager keeps reading the Router configuration space to check for configuration readiness.

USB4_CheckConfigurationReady()

Examples

C++
Call USB4_CheckConfigurationReady()

USB4_BondLanes

As a Connection Manager task, call this function to start Lane Bonding.

USB4_BondLanes( USB4BondingSettings $setting )

Parameters (defaults in bold)

StartBondingAfterPUT

USB4_FALSE

USB4_TRUE

Examples

$setting = USB4StartRouterSettings
{
    SkipBonding = USB4_TRUE
}

Call USB4_StartRouter( $setting )

	…
    
$bond_lane_settings = USB4BondingSettings
{
    StartBondingAfterPUT = USB4_TRUE
}
Call USB4_BondLanes( $bond_lane_settings )

OR

Call USB4_BondLanes()

USB4_WaitForBondedLanes

Waits until the lanes bond.

USB4_WaitForBondedLanes()

Examples

Call USB4_WaitForBondedLanes()

USB4_SetRouterLowPowerState

As a Connection Manager task, call this function to configure Low Power state bits in the Lane Adapter Configuration Space.

USB4_SetRouterLowPowerState()

Examples

# As Low Power states are disabled in the default Configuration Spaces, first we need to enable desired Low Power state bits in the Exerciser Configuration Space then call USB4_SetRouterLowPowerState() to send a write command to configure the partners configuration.

Call USB4_SetCurrentCfgSpaceCap( USB4_ADAPTER_CFG, 0, USB4_UPSTREAM_LANE_ADAPTER, USB4_CFG_CAP_LANE )

 $lane_adp_cfg = USB4LaneAdapterCfgCap

 Set $lane_adp_cfg.CS_0_CL0sSupport = USB4_TRUE
 Set $lane_adp_cfg.CS_0_CL1Support = USB4_TRUE

Call USB4_StartRouter()

Call USB4_SetRouterLowPowerState()

USB4_AssertLowPowerObjection

Rejects a Low Power entry request while the Low Power state is supported.

USB4_AssertLowPowerObjection ( power_state, is_enable )

Parameters

power_state

Possible values:

  • USB4_LLSM_STATE_CL0s

  • USB4_LLSM_STATE_CL1

  • USB4_LLSM_STATE_CL2

is_enable

Possible values:

  • USB4_FALSE

  • USB4_TRUE

Example

# Causes to send CL_NACK in response of CL2_REQ and CL1_REQ
Call USB4_AssertLowPowerObjection ( USB4_LLSM_STATE_CL1, USB4_FALSE )

USB4_SetLinkState

Forces the link to transition to the specified state.

USB4_SetLinkState( state, lane, timeout )

Parameters (default values in bold)

State

Possible values:

  • USB4_LLSM_STATE_LOCK_1

  • USB4_LLSM_STATE_CL0

  • USB4_LLSM_STATE_CL1

  • USB4_LLSM_STATE_CL2

  • USB4_USB3_GEN_T_LTSSM_STATE_U0

  • USB4_USB3_GEN_T_LTSSM_STATE_U2

  • USB4_USB3_GEN_T_LTSSM_STATE_U3

  • USB4_USB3_GEN_T_LTSSM_STATE_ERROR

  • USB4_USB3_GEN_T_LTSSM_STATE_DISCONNECT

  • USB4_USB3_GEN_T_LTSSM_STATE_DISABLE

  • USB4_USB3_GEN_T_LTSSM_STATE_PORTRESET

lane

This parameter is ignored for Tunneled USB3 states.

Possible values:

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BOTH

timeout

Possible values:

  • 0 … 4294967294 us

  • USB4_INFINITE_TIME

Examples

Call USB4_SetLinkState ( USB4_LLSM_STATE_CL0, USB4_LANE_1, 500000 )

OR

Call USB4_SetLinkState ( USB4_LLSM_STATE_CL0, USB4_LANE_0 )

OR

Call USB4_SetLinkState ( USB4_LLSM_STATE_CL0 )

USB4_WaitForLinkState

Waits until the specified lane(s) transition to the specified state.

USB4_WaitForLinkState( state_bitmap, lane, timeout )

Parameters (default values in bold)

state_bitmap

Possible values:

  • USB4_LLSM_STATE_CL0

  • USB4_LLSM_STATE_CL0s

  • USB4_LLSM_STATE_CL1

  • USB4_LLSM_STATE_CL2

  • USB4_LLSM_STATE_CLx

  • USB4_LLSM_STATE_LOCK_1

  • USB4_LLSM_STATE_LOCK_2

  • USB4_LLSM_STATE_TS1

  • USB4_LLSM_STATE_TS2

  • USB4_USB3_GEN_T_LTSSM_STATE_U0

  • USB4_USB3_GEN_T_LTSSM_STATE_U2

  • USB4_USB3_GEN_T_LTSSM_STATE_U3

  • USB4_USB3_GEN_T_LTSSM_STATE_DISCONNECT

  • USB4_USB3_GEN_T_LTSSM_STATE_ERROR

  • USB4_USB3_GEN_T_LTSSM_STATE_DISABLE

  • USB4_USB3_GEN_T_LTSSM_STATE_PORTRESET

lane

Possible values:

  • USB4_LANE_0

  • USB4_LANE_1

  • USB4_LANE_BOTH

  • USB4_LANE_EITHER

timeout

Possible values:

  • 0 … 4294967294 us

  • USB4_INFINITE_TIME

Examples

Call USB4_WaitForLinkState( USB4_LLSM_STATE_CL0s | USB4_LLSM_STATE_CL1, USB4_LANE_BOTH, 500000 )

OR

Call USB4_WaitForLinkState( USB4_LLSM_STATE_CL1, USB4_LANE_0 )

OR

Call USB4_WaitForLinkState( USB4_LLSM_STATE_CL0 )

USB4_SetDROMSpace

Sets DROM space.

USB4_SetDROMSpace( $drom )

Example

$drom = USB4VarContainer
{
  Data = { 86 
           00 BC FD 45 76 1F 86 80 
           08 DA 31 2A 
           01 
           19 00
           86 80 
           34 12 
           03 
           02 
           08 81 80 02 00 00 00 00 
           08 82 90 01 00 00 00 00 }
}
Call USB4_SetDROMSpace ( $drom )

USB4_SendHotPlugEvent

Sends a Hot Plug Event.

USB4_SendHotPlugEvent( USB4SendHotPlugSettings $settings )

Parameters/USB4SendHotPlugSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

AdapterNum

0


UPG

0


WaitForResponse

USB4_FALSE

USB4_TRUE

If true, command waits to receive the response.

Example

$settings = USB4SendHotPlugSettings
{
    Lane = USB4_LANE_0
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    AdapterNum = 1
    UPG = 1
}
Call USB4_SendHotPlugEvent( $settings )

USB4_SendNotification

Sends a Notification packet.

USB4_SendNotification( USB4SendNotificationSettings $settings )

Parameters/USB4SendNotificationSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

EventCode

USB4_ERR_CONN

USB4_ERR_LINK

USB4_ERR_ADDR

USB4_ERR_ADP

USB4_ERR_ENUM

USB4_ERR_NUA

USB4_ERR_LEN

USB4_ERR_HEC

USB4_ERR_FC

USB4_ERR_PLUG

USB4_ERR_LOCK

USB4_HP_ACK


AdapterNum

0


PG

USB4_NOTIFICATION

USB4_HOT_PLUG_EVENT

USB4_HOT_UNPLUG_EVENT


WaitForResponse

USB4_FALSE

USB4_TRUE

If true, command waits to receive the response.

HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

Example

$settings = USB4SendNotificationSettings
{
    Lane = USB4_LANE_0
    
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    
    EventCode = USB4_ERR_ADDR
    AdapterNum = 1
    PG = USB4_NOTIFICATION
}
Call USB4_SendNotification ( $settings )

USB4_SendInterDomainRequest

Sends an Inter-Domain request.

USB4_SendInterDomainRequest ( USB4SendCtrlInterDomainSettings $settings )

Parameters/USB4SendCtrlInterDomainSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


RouteStringHigh

0

Ignored if AutoRouteString is true.

CM

0

1

Ignored if AutoRouteString is true.

RouteStringLow

0

Ignored if AutoRouteString is true.

SN

0


DiscoveryProtocol

0


PacketType

0


Data


InterDomain Data

WaitForResponse

USB4_FALSE

USB4_TRUE

If true, command waits to receive the response.

HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

Example

$settings = USB4SendCtrlInterDomainSettings
{
    Lane = USB4_LANE_0
    
    RouteStringHigh = 0x00000000
    RouteStringLow  = 0x00000001
    
    DiscoveryProtocol = { B6 38 D7 0E 42 FF 40 BB 97 C2 90 E2 C0 B2 FF 07 }
    PacketType = 3 
}
Call USB4_SendInterDomainRequest ( $settings )

USB4_SendTunneledPacket

Sends a Tunneled packet.

USB4_SendTunneledPacket ( USB4SendTunneledPacketSettings$settings, $Payload )

Parameters/USB4SendTunneledPacketSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


AutoHopID

USB4_FALSE

USB4_TRUE


ProtocolType

USB4_TUNNELED_HI

USB4_TUNNELED_USB3_GEN_X

USB4_TUNNELED_USB3_GEN_T


HopId

0


PDF

0


HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

Example

$payload = USB4VarContainer
{
    Data = { 00 11 22 33 }
}
$settings = USB4SendTunneledPacketSettings
{
    Lane = USB4_LANE_0
    
    HopId = 0x00000000
    PDF = 0x0000000
}
Call USB4_SendTunneledPacket ( $settings, $payload )

USB4_ConfigExrCreditGrant

Configures how the Exerciser sends Credit Grant.

USB4_ConfigExrCreditGrant( USB4ConfigExrCreditGrantSettings $settings)

Parameters/USB4ConfigExrCreditGrantSettings

Field Name

Possible Values (defaults in bold)

Description

Enable

USB4_TRUE

USB4_FALSE

Enables or disables the sending of credit grants for a specific HopID

ECCErrorMask

_00000000

Injects an error into the ECC field

IncrementStep

1


ECCErrorCount

1 .. 14

or

USB4_INFINIT_CG_ERROR_COUNT

Indicates how many corrupted Credit Grant packets should be sent after receiving a packet with the specified Hop ID.

HopId

0


CreditValue

USB4_INVALID_VALUE

Initial allocated credit value

LFlag

USB4_TRUE

USB4_FALSE


Interval_us

USB4_INVALID_VALUE

Interval for sending Credit Grants

CGToRcvdTLP

USB4_TRUE

USB4_FALSE

Enable/Disable immediate Credit Grant after TLP reception

Example

Configures to send Credit Grant for HopID = 8 every 10 us
local $credit_settings = USB$ConfigExrCreditGrantSettings
{
    Enable = USB4_TRUE
    ECCErrorCount = USB4_INFINIT_CG_ERROR_COUNT
    HopId = 8
    CreditValue = 1
    Interval_us = 10000
}
Call USB4_ConfigExrCreditGrant( $credit_settings )

USB4_SendPathCreditSync

Sends a Path Credit Sync packet.

USB4_SendPathCreditSync ( USB4SendPathCreditSyncSettings $settings )

Parameters/USB4SendPathCreditSyncSettings

Field Name

Possible Values (defaults in bold)

Description

Lane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BONDED


HopID

0


PCC

0


HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

ECCErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in ECC field to inject ECC error.

Example

$settings = USB4SendPathCreditSyncSettings
{
    Lane = USB4_LANE_0
    
    HopID = 8
    PCC = 1
}
Call USB4_SendPathCreditSync ( $settings )

USB4_InjectSBErrors

Injects errors in Side Band traffic.

USB4_InjectSBErrors( USB4SBErrorInjectionSettings $settings )

Parameters/USB4SBErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

LateBroadcastRT

USB4_FALSE

USB4_TRUE

Start sending Broadcast RT Transaction at the latest time

EarlyBroadcastRT

USB4_FALSE

USB4_TRUE

Start sending Broadcast RT Transaction at the earliest time

DisableSBAutoResponse

USB4_FALSE

USB4_TRUE

Disable auto responding to SB Transactions

Example

$error_injection = USB4SBErrorInjectionSettings
{
    LateBroadcastRT = USB4_TRUE
}
Call USB4_InjectSBErrors( $error_injection )

USB4_ClearInjectedSBErrors

Clears the errors injected by the USB4_InjectSBErrors() command.

C++
USB4_ClearInjectedSBErrors( USB4SBErrorInjectionSettings $settings )

Parameters/USB4SBErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

DisableSBAutoResponse

USB4_FALSE

USB4_TRUE


Example

$clear_error = USB4SBErrorInjectionSettings
{
    DisableSBAutoResponse = USB4_ TRUE
}
Call USB4_ClearInjectedSBErrors( $clear_error )

USB4_InjectHSErrors

Injects errors in high-speed traffic.

USB4_InjectHSErrors( USB4HSErrorInjectionSettings $settings )

Parameters/USB4HSErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

LoopBackHECErrorMask

0x00


ECCErrorHopId

0


ECCErrorMask

_00000000


ECCErrorCount

1 .. 14

or

USB4_INFINIT_CG_ERROR_COUNT

Indicates how many corrupted Credit Grant packets should be sent after receiving a packet with the specified Hop ID.

ECCErrorCreditStep

1

Indicates how much the Flow Control Credits is incremented after receiving a packet with the specified Hop ID.

TxSubstPacketType

USB4_ERR_PACKET_TYPE_UNDEFINED

USB4_ERR_PACKET_TYPE_No_Error

USB4_ERR_PACKET_TYPE_SLOS1

USB4_ERR_PACKET_TYPE_SLOS2

USB4_ERR_PACKET_TYPE_TS1

USB4_ERR_PACKET_TYPE_TS2

USB4_ERR_PACKET_TYPE_DESKEW

USB4_ERR_PACKET_TYPE_TSNOS

USB4_ERR_PACKET_TYPE_CL2_REQ

USB4_ERR_PACKET_TYPE_CL1_REQ

USB4_ERR_PACKET_TYPE_CL2_ACK

USB4_ERR_PACKET_TYPE_CL1_ACK

USB4_ERR_PACKET_TYPE_CL0s_ACK

USB4_ERR_PACKET_TYPE_CL_NACK

USB4_ERR_PACKET_TYPE_CL_OFF

USB4_ERR_PACKET_TYPE_WAKE1

USB4_ERR_PACKET_TYPE_WAKE2

USB4_ERR_PACKET_TYPE_SKIP

USB4_ERR_PACKET_TYPE_IDLE

USB4_ERR_PACKET_TYPE_TLP

The specified sent packet will be replaced with the packet in the TxSubstNewPacketType field

TxSubstCount

2

The count of packet to be replaced with the packet in the TxSubstNewPacketType field

TxSubstNewPacketDataL0

A 64-bits data

USB4_SUBST_PACKET_UNDEFINED_DATA

To replace the specified sent packet in the TxSubstPacketType field on lane0 if the value is not undefined.

TxSubstNewPacketDataL1

A 64-bits data

USB4_SUBST_PACKET_UNDEFINED_DATA

To replace the specified sent packet in the TxSubstPacketType field on lane1 if the value is not undefined.

BondedRandomFECError

USB4_FALSE

USB4_TRUE

Inject randomly spaced errors so that either one or two errors fall within an RS-FEC block

LLSMStuckState

USB4_LLSM_STATE_UNKNOWN

USB4_LLSM_STATE_LOCK_1

USB4_LLSM_STATE_LOCK_2

USB4_LLSM_STATE_TS1

USB4_LLSM_STATE_TS2

Specifies a state that LLSM will be stuck in.

If TimerDuration is zero, it will be stuck forever or until the timer reaches timeout.


LLSMTimerDurationNs

0

Used in conjunction with StuckState and TimerOrigin.

LLSMTimerOrigin

USB4_TIMER_ORIGIN_UNDEFINED

USB4_TIMER_ORIGIN_EXR_SLOS1

USB4_TIMER_ORIGIN_EXR_SLOS2

USB4_TIMER_ORIGIN_EXR_TS1

USB4_TIMER_ORIGIN_EXR_TS2

USB4_TIMER_ORIGIN_EXR_LFPS

USB4_TIMER_ORIGIN_EXR_CL_WAKE1

USB4_TIMER_ORIGIN_EXR_CL_WAKE2

USB4_TIMER_ORIGIN_PUT_SLOS1

USB4_TIMER_ORIGIN_PUT_SLOS2

USB4_TIMER_ORIGIN_PUT_TS1

USB4_TIMER_ORIGIN_PUT_TS2

USB4_TIMER_ORIGIN_PUT_LFPS

USB4_TIMER_ORIGIN_PUT_CL_WAKE1

USB4_TIMER_ORIGIN_PUT_CL_WAKE2

Specifies when the timer is started. Used in conjunction with StuckState and TimerDuration.


_EXR_SLOS1 means the first sent SLOS1 from the Exerciser and _PUT_SLOS1 means the first received SLOS1 OS from the port under test.


LLSMApplyOnce

USB4_FALSE

USB4_TRUE

LLSM Error injection is applied once

LLSMTrainingPhase

USB4_FALSE

USB4_TRUE

Specifies the target phase of LLSM

LLSMCLxExitPhase

USB4_FALSE

USB4_TRUE

Specifies the target phase of LLSM

LLSMBondingPhase

USB4_FALSE

USB4_TRUE

Specifies the target phase of LLSM

LLSMDisableProtocolTimers

USB4_FALSE

USB4_TRUE


LLSMSendOneTS1ThenLock1

USB4_FALSE

USB4_TRUE

If true, LLSM sends only one TS1 OS upon entering the TS1 state and then transitions to LOCK1 state.

LLSMSendOneTS2ThenLock1

USB4_FALSE

USB4_TRUE

If true, LLSM sends only one TS2 OS upon entering the TS2 state and then transitions to LOCK1 state.

LLSMReceiveOneTS1ThenLock1

USB4_FALSE

USB4_TRUE

If true, Exerciser remains in TS1 till receiving one TS1 from PUT then transition to SLOS1

LLSMReceiveOneTS2ThenLock1

USB4_FALSE

USB4_TRUE

If true, Exerciser remains in TS1 till receiving one TS2 from PUT then transition to SLOS1

LLSMLane

USB4_LANE_0

USB4_LANE_1

USB4_LANE_BOTH


TS1SymbolsMask

0x0000000000000000

Specifies which symbols of sent TS1 OS must be replaced with the corresponding symbols in the TS1Symbols.

TS1Symbols


Overrides sent TS1 symbol.

TS2SymbolsMask

0x0000000000000000

Specifies which symbols of sent TS2 OS must be replaced with the corresponding symbols in the TS2Symbols.

TS2Symbols


Overrides sent TS2 symbol.

BondingTS1FewLBT1ThenLBT0

USB4_FALSE

USB4_TRUE


BondingTS1FewLBT1ThenLBT0Lane1

USB4_FALSE

USB4_TRUE


SendSingleCLWAKEOnCL0sExit

USB4_FALSE

USB4_TRUE


Example

$error_injection = USB4HSErrorInjectionSettings
{
  LLSMStuckState      = USB4_LLSM_STATE_TS1
  LLSMTrainingPhase   = USB4_TRUE
  LLSMTimerDurationNs = 900000000 # 900ms
  LLSMTimerOrigin     = USB4_TIMER_ORIGIN_PUT_SLOS1 | SB4_TIMER_ORIGIN_PUT_SLOS2
}
Call USB4_InjectHSErrors( $error_injection )

USB4_ClearInjectedHSErrors

Clears the errors injected by the USB4_InjectHSErrors() command.

USB4_ClearInjectedHSErrors( USB4HSErrorInjectionSettings $settings )

Parameters/USB4HSErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

LoopBackHECErrorMask

0x00


ECCErrorMask

_00000000


Example

$clear_error = USB4HSErrorInjectionSettings
{
    SendTS1TillDisconnect = USB4_TRUE
    TS1Delay = USB4_TRUE
    TS2Delay = USB4_FALSE
}
Call USB4_ClearInjectedHSErrors( $clear_error )

USB4_LoopbackRcvdPacket

Loops back the latest received control packet.

USB4_LoopbackRcvdPacket ( USB4LoopBackSettings $settings )

Parameter/USB4LoopBackSettings

Field Name

Possible Values

Description

HECErrorMask

0x00

If not zero, the corresponding bit of each 1 in this mask will be flipped in HEC field to inject HEC error.

CRC32ErrorMask

0x00000000

If not zero, the corresponding bit of each 1 in this mask will be flipped in CRC32 field to inject CRC error.

Example

$settings = USB4LoopBackSettings
{
    HECErrorMask = 0x01
}
Call USB4_LoopbackRcvdPacket( $settings )

USB4_WaitForPacketEx

Waits to receive a packet matched with input filter.

USB4_WaitForPacketEx( timeout_us, $filter_mask, $filter_match, USB4WaitForPacketFilterSettings $settings )

Parameters/USB4WaitForPacketFilterSettings

Field Name

Possible Values (defaults in bold)

Description

FilterAutoResponse

USB4_FALSE

USB4_TRUE

If true, the proper response is send automatically before sending the received packet to USB4_WaitForPacket().

Set to false if you want to send a user-defined response for the matched received packet.

Example

$mask_value = USB4TPHeader
{
    HopId = 0xFFFF
}
$match_value = USB4TPHeader
{
   HopId = 8
}
$wait_settings = USB4WaitForPacketFilterSettings

Call USB4_WaitForPacketEx( 100000, $mask_value, $match_value, $wait_settings )

USB4_AddWaitForPacketFilter

To add a mask/match for USB4_WaitForPacket(). Currently, only one filter can be added. It is very important to call USB4_RemoveWaitForPacketFilters() after you finished with calling USB4_WaitForPacket().

USB4_AddWaitForPacketFilter( $filter_mask, $filter_match, USB4WaitForPacketFilterSettings $settings )

Parameters/USB4WaitForPacketFilterSettings

Field Name

Possible Values (defaults in bold)

Description

FilterAutoResponse

USB4_FALSE

USB4_TRUE

If true, the proper response is send automatically before sending the received packet to USB4_WaitForPacket().

Set to false if you want to send a user defined response for the matched received packet.

HECErrorMaskOnCtrlResp

0x00

If set and FilterAutoResponse is true, the HEC in the corresponding Response will be XORed with this mask to inject an error.

CRC32ErrorMaskOnCtrlResp

0x00000000

If set and FilterAutoResponse is true, the CRC32 in the corresponding Response will be XORed with this mask to inject an error.

Example

$mask_value = USB4TPHeader
{
    HopId = 0xFFFF
}
$match_value = USB4TPHeader
{
    HopId = 8
}
$wait_settings = USB4WaitForPacketFilterSettings

Call USB4_AddWaitForPacketFilter( $mask_value, $match_value, $wait_settings )
Call USB4_WaitForPacket( 100000 ) # wait for 100ms
Call USB4_RemoveWaitForPacketFilters()

USB4_WaitForPacket

Waits to receive a packet matched with added filters by USB4_AddWaitForPacketFilter().

USB4_WaitForPacket( timeout_us )

Examples

$mask_value = USB4TPHeader
{
   HopId = 0xFFFF
}
$match_value = USB4TPHeader
{
   HopId = 8
}
$wait_settings = USB4WaitForPacketFilterSettings

Call USB4_AddWaitForPacketFilter( $mask_value, $match_value, $wait_settings )
Call USB4_WaitForPacket( 100000 ) # wait for 100ms
Call USB4_RemoveWaitForPacketFilters()

USB4_RemoveWaitForPacketFilters

Removes filters added by USB4_AddWaitForPacketFilter(). It is very important to call this function when you finished with calling USB4_WaitForPacket().

USB4_RemoveWaitForPacketFilters()

Example

Call USB4_RemoveWaitForPacketFilters()

USB4_StartHSOnlyMode

Forces the Exerciser to immediately enter high-speed traffic mode.

USB4_StartHSOnlyMode( USB4HSOnlyModeSettings $settings )

Parameters/USB4HSOnlyModeSettings

Field Name

Possible Values (defaults in bold)

DataRole


USB4_DEVICE

USB4_HOST

Protocol

USB4_PROTOCOL_TBT3

USB4_PROTOCOL_USB4

BondingSupport

USB4_FALSE

USB4_TRUE

Gen3Support


USB4_FALSE

USB4_TRUE

RSFECEnabled


USB4_FALSE

USB4_TRUE

LinkWidth


USB4_LINK_WIDTH_X1

USB4_LINK_WIDTH_X2

LegacySpeed


USB4_FALSE

USB4_TRUE

PrecodingEnabled


USB4_FALSE

USB4_TRUE

TxSSCAlwaysOn


USB4_FALSE

USB4_TRUE

Lane0Preset

0

1 … 15

Lane1Preset

0

1 … 15

Examples

$settings = USB4HSOnlyModeSettings
{
    DataRole = USB4_HOST
    Protocol = USB4_PROTOCOL_USB4
    
    BondingSupport   = USB4_TRUE
    Gen3Support      = USB4_TRUE
    RSFECEnabled     = USB4_TRUE
    LinkWidth        = USB4_LINK_WIDTH_X1
    LegacySpeed      = USB4_FALSE
    PrecodingEnabled = USB4_TRUE
    
    TxSSCAlwaysOn   = USB4_TRUE
    
    Lane0Preset  = 1
    Lane1Preset  = 8	
}
Call USB4_StartHSOnlyMode( $settings )

USB4_SetOrderedSetSettings

Used to configure OS parameters.

USB4_SetOrderedSetSettings( $settings )

Parameters (default values in bold)

IntervalNs

0

90 … 5800000, Granularity 90ns

L0Enable

USB4_FALSE

USB4_TRUE

L1Enable

USB4_FALSE

USB4_TRUE

BondedEnable

USB4_FALSE

USB4_TRUE

USB4TSNOSControlSettings (default values in bold)

IntervalNs

0

90ns … 5.8ms - Granularity 90ns

USB4DeSkewControlSettings (default values in bold)

L0DelayNs

0

7 … 195, Granularity 7ns


L1DelayNs

0

7 … 195, Granularity 7ns

Example

$setting = USB4TSNOSControlSettings
{
    IntervalNs = 16
}
Call USB4_SetOrderedSetSettings( $setting )


USB4_ApplyUSB3Settings

Configures the behavior of the Tunneled USB3 Exerciser

USB4_ApplyUSB3Settings( USB4USB3Settings $usb3_settings )

Parameters/USB4USB3Settings

Field Name

Possible Values (defaults in bold)

Description

EnableLCAggregation

USB4_FALSE

USB4_TRUE


EnableKeepAlive

USB4_FALSE

USB4_TRUE


LKAI_n


Link Keep-Alive Interval.

Only for Host Exerciser.

SendITP

USB4_FALSE

USB4_TRUE

Only for Host Exerciser.

SetU2Enable

USB4_FALSE

USB4_TRUE

To set U2_Enable during USB3 Enumeration via SetFeature request.

Only for Host Exerciser.

AcceptU2Entry

USB4_FALSE

USB4_TRUE


AcceptU3Entry

USB4_FALSE

USB4_TRUE


EnableU2CL2

USB4_FALSE

USB4_TRUE

To enable U2CL2 during Path Setup.

Only for Host Exerciser.

Example

$usb3_settings = USB4USB3Settings 
{
    EnableLCAggregation = USB4_TRUE
    SendITP = USB4_TRUE
}
Call USB4_ApplyUSB3Settings( $usb3_settings )


USB4_ConfigureUSB3BulkEndpoint

Configures a Bulk IN/OUT Endpoint on a Device Exerciser.

USB4_ConfigureUSB3BulkEndpoint( USB4ConfigureUSB3BulkINEndpointSettings $settings )
USB4_ConfigureUSB3BulkEndpoint( USB4ConfigureUSB3BulkOUTEndpointSettings $settings )

Parameters

USB4ConfigureUSB3BulkINEndpointSettings

USB4ConfigureUSB3BulkOUTEndpointSettings

Field Name

Possible Values (defaults in bold)

Description

IsInfiniteTransfer

USB4_FALSE

USB4_TRUE

If true, the Bulk Endpoint is infinitely responsive to the Host Transfers.

TotalPacketCount


The number of DP packets that will be sent/received for the Host initiated Transfer.

The payload size of each packet is Max Packet Size.

ShortPacketByteSize


Set this field if the payload of the last DP packet of the Transfer is less than the Max Packet Size

TotalByteCount


The total number of bytes that will be sent/received for the Host initiated Transfer.

It is an alternative for TotalPacketCount and ShortPacketByteSize fields.

DataPatternId

USB4_USB3_DATA_PATTERN_00
USB4_USB3_DATA_PATTERN_11
USB4_USB3_DATA_PATTERN_55
USB4_USB3_DATA_PATTERN_AA

The supported pattern of the DP’s payload.

WaitForTransferDone

USB4_FALSE

USB4_TRUE

Set to true to block the command for completing the Transfer.

WaitForTransferDoneTimeout

Microsecond time

or

USB4_INFINITE_TIME

It is applicable only when WaitForTransferDoneis is true.

ErrorInjectionId

USB4_USB3_BULK_ERROR_ID_NO_ERROR


USB4_USB3_BULK_IN_ERROR_ID_SKIP_SDP

USB4_USB3_BULK_IN_ERROR_ID_SKIP_SDP_MDPS

USB4_USB3_BULK_IN_ERROR_ID_SKIP_ALL_MDPS

USB4_USB3_BULK_IN_ERROR_ID_SKIP_ONE_MDP

USB4_USB3_BULK_IN_ERROR_ID_SKIP_EDP

USB4_USB3_BULK_IN_ERROR_ID_SEND_NDP


USB4_USB3_BULK_OUT_ERROR_ID_TD_9_1_6_P2

USB4_USB3_BULK_OUT_ERROR_ID_TD_9_1_6_P1


Example

$endpoint_settings = USB4ConfigureUSB3BulkINEndpointSettings
{
    TotalPacketCount    = 6500
    ShortPacketByteSize = 1
    WaitForTransferDone = USB4_TRUE
}
Call USB4_ConfigureUSB3BulkEndpoint( $endpoint_settings )


USB4_StartUSB3BulkTransfer

Starts a Bulk IN/OUT Transfer on a Host Exerciser.

USB4_StartUSB3BulkTransfer( USB4StartUSB3BulkINTransferSettings $settings )
USB4_StartUSB3BulkTransfer( USB4StartUSB3BulkOUTTransferSettings $settings )

Parameters

USB4StartUSB3BulkINTransferSettings

USB4StartUSB3BulkOUTTransferSettings

Field Name

Possible Values (defaults in bold)

Description

DeviceAddress

1 .. 127


EndpointNum

1 .. 15


DataPatternId

USB4_USB3_DATA_PATTERN_00
USB4_USB3_DATA_PATTERN_11
USB4_USB3_DATA_PATTERN_55
USB4_USB3_DATA_PATTERN_AA


IsInfiniteTransfer

USB4_FALSE

USB4_TRUE

Set to true to initiate an infinite Transfer.

TotalPacketCount


The number of DP packets that will be sent/received for the initiated Transfer.

The payload size of each packet is Max Packet Size.

ShortPacketByteSize


Set this field if the payload of the last DP packet of the Transfer is less than the Max Packet Size.

TotalByteCount


The total number of bytes that will be sent/received for the initiated Transfer.

It is an alternative for TotalPacketCount and ShortPacketByteSize fields.

AutoNumP

USB4_FALSE

USB4_TRUE


NumP

0 .. 64


WaitForTransferDone

USB4_FALSE

USB4_TRUE

Set to true to block the command for completing the Transfer.

WaitForTransferDoneTimeout

Microsecond time

or

USB4_INFINITE_TIME

It is applicable only when WaitForTransferDoneis is true.

Example



USB4_InjectUSB3TunnelingErrors

Injects errors in USB3 tunneling traffic.

USB4_InjectUSB3TunnelingErrors( USB4USB3GenTTunnelingErrorInjectionSettings $settings )
USB4_InjectUSB3TunnelingErrors( USB4USB3GenXTunnelingErrorInjectionSettings $settings )

Parameters/USB4USB3GenXTunnelingErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

LGoodDelayTimeNs

0

Delay time before sending LGOOD packets for all packets except Port Capability LMP packets

LAUDelayTimeNs

0

Delay time before sending LAU packets

PortConfigDelayTimeNs

0

Delay time before sending Port Configuration LMP packets after entering U0

PortConfigResponseDelayTimeNs

0

Delay time before sending Port Configuration LMP Response packets after entering U0

SkipPortConfig

USB4_FALSE

USB4_TRUE

Skip sending Port Configuration LMP packets

SkipPortConfigResponse

USB4_FALSE

USB4_TRUE

Skip sending Port Configuration LMP Response packets

SkipLGoodForPortConfig

USB4_FALSE

USB4_TRUE

Skip sending LGOOD for Port Configuration LMP packets

SkipLGoodForPortConfigResponse

USB4_FALSE

USB4_TRUE

Skip sending LGOOD for Port Configuration LMP Response packets

SendPortConfigInsteadOfResponse

USB4_FALSE

USB4_TRUE

Send a Port Configuration LMP Response packet instead of a Port Configuration LMP packet

SkipLPMA

USB4_FALSE

USB4_TRUE

Skip sending LPMA packets

SkipLAU

USB4_FALSE

USB4_TRUE

Skip sending LAU packets

Parameters/USB4USB3GenTTunnelingErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

Description

LAUDelayTimeNs

10ns to 15sec

The time precision is 10ns.

LPMADelayTimeNs

10ns to 60sec

The time precision is 10ns.

LCRDDelayTimeNs

10ns to 60sec

The time precision is 10ns.

LKAIDelayTimeNs

10ns to 4sec

The time precision is 10ns.

OOBMLinkReadyDelayTimeMs

1ms to 4sec

The time precision is 1ms.

OOBMPortResetDoneDelayTimeMs

1ms to 4sec

The time precision is 1ms.

DPPENDFramingError


When InjectDPPENDFramingError is true, the Tunneled USB3 packets are sent with this as a DPP END Framing.

SkipOOBMLinkReady

USB4_FALSE

USB4_TRUE


SkipLPMA

USB4_FALSE

USB4_TRUE


CorruptHSeq

USB4_FALSE

USB4_TRUE


InjectDPPENDFramingError

USB4_FALSE

USB4_TRUE

When is true, the Tunneled USB3 packets are sent with DPPEndFramingError as the DPP END Framing.

DoNotSendLGood

USB4_FALSE

USB4_TRUE


SendWrongLGood

USB4_FALSE

USB4_TRUE


SendWrongLCRD

USB4_FALSE

USB4_TRUE


StayInDisconnect

USB4_FALSE

USB4_TRUE


StopSendingLKAN

USB4_FALSE

USB4_TRUE


DisableU0ToError

USB4_FALSE

USB4_TRUE


Example

$error_injection = USB4USB3GenXTunnelingErrorInjectionSettings
{
    SkipLPMA = USB4_TRUE
}
Call USB4_InjectUSB3TunnelingErrors( $error_injection )


USB4_ClearInjectedUSB3TunnelingErrors

Clears the errors injected by the USB4_InjectUSB3TunnelingErrors () command.

USB4_ClearInjectedUSB3TunnelingErrors( USB4USB3GenTTunnelingErrorInjectionSettings $settings ) 
USB4_ClearInjectedUSB3TunnelingErrors( USB4USB3GenXTunnelingErrorInjectionSettings $settings ) 

Parameters/USB4USB3GenXTunnelingErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

SkipPortConfig

USB4_FALSE

USB4_TRUE

SkipPortConfigResponse

USB4_FALSE

USB4_TRUE

SkipLGoodForPortConfig

USB4_FALSE

USB4_TRUE

SkipLGoodForPortConfigResponse

USB4_FALSE

USB4_TRUE

Parameters/USB4USB3GenTTunnelingErrorInjectionSettings

Field Name

Possible Values (defaults in bold)

SkipLPMA

USB4_FALSE

USB4_TRUE

CorruptHSeq

USB4_FALSE

USB4_TRUE

InjectDPPENDFramingError

USB4_FALSE

USB4_TRUE

DoNotSendLGood

USB4_FALSE

USB4_TRUE

SendWrongLGood

USB4_FALSE

USB4_TRUE

SendWrongLCRD

USB4_FALSE

USB4_TRUE

StayInDisconnect

USB4_FALSE

USB4_TRUE

StopSendingLKAN

USB4_FALSE

USB4_TRUE

DisableU0ToError

USB4_FALSE

USB4_TRUE

Example

$clear_error = USB4USB3GenXTunnelingErrorInjectionSettings
{
    SkipLPMA = USB4_TRUE
}
Call USB4_ClearInjectedUSB3TunnelingErrors( $clear_error )


USB4_SendUSB3DP

Segments a USB3 Data Packet into Tunneled Packets and transmits them.

USB4_SendUSB3DP( $usb3_dp, is_gen_t, wait_for_response )

Parameters


$usb3_dp

A structure of USB3GenXDP or USB3GenTDP type.

is_gen_t

Possible values:

  • USB4_FALSE

  • USB4_TRUE

wait_for_response

Possible values:

  • USB4_FALSE

  • USB4_TRUE


Example

$data_payload = USB4VarContainer
{
    Data = 1024, 0xAA
} 
data_len_byte = GetPacketSizeBit( $data_payload  ) / 8 

$usb3_dp= USB3GenXDP
{
    DeviceAddress = 1
    Type = USB3_PKT_DATA_HEADER
    EptNum = 1
    DataLength = data_len_byte
    LenReplica1 = data_len_byte
    LenReplica2 = data_len_byte
    
    Payload = $data_payload
}
Call USB4_SendUSB3DP( $usb3_dp, USB4_FALSE, USB4_FALSE )

USB4_SendUSB3DPSegment

Transmits one segment of a USB3 Data Packet that is requested in the parameters. It can used for error injection.

USB4_SendUSB3DPSegment( $usb3_dp, segment_offset, pdf )

Parameters

$usb3_dp

A structure of USB3GenXDP or USB3GenTDP type.

segment_offset

Specifies the segment that should be transmitted.

pdf

Possible values:

  • USB3_PDF_START_DP(4)

  • USB3_PDF_MIDDLE_DP(5)

  • USB3_PDF_END_DP(6)

Example

$data_payload = USB4VarContainer
{
    Data = 1024, 0xAA
} 
data_len_byte = GetPacketSizeBit( $data_payload  ) / 8 

$usb3_dp= USB3GenXDP
{
    DeviceAddress = 1
    Type = USB3_PKT_DATA_HEADER
    EptNum = 1
    DataLength = data_len_byte
    LenReplica1 = data_len_byte
    LenReplica2 = data_len_byte
    
    Payload = $data_payload
}

Call USB4_SendUSB3GenXDPSegment( $usb3_dp, 0,   USB3_PDF_START_DP )
Call USB4_SendUSB3GenXDPSegment( $usb3_dp, 252,  USB3_PDF_MIDDLE_DP )
Call USB4_SendUSB3GenXDPSegment( $usb3_dp, 504,  USB3_PDF_MIDDLE_DP )
Call USB4_SendUSB3GenXDPSegment( $usb3_dp, 756,  USB3_PDF_MIDDLE_DP )
Call USB4_SendUSB3GenXDPSegment( $usb3_dp, 1008, USB3_PDF_END_DP )

USB4_SetRouterLogicalLayerErrorEnable

When the Exerciser acts as a Host, this function sends read/write requests to set the error bits in the Logical Layer Errors Enable field of the Lane Adapter Configuration Capability in the Adapter Configuration Space of the PUT.

USB4_SetRouterLogicalLayerErrorEnable( errors_bitmap, lane_adapter_index, RouteStringLow, RouteStringHigh )

Parameters

errors_bitmap:

Possible values that can be bitwise ORed together are:

  • USB4_LL_ERR_ALE

  • USB4_LL_ERR_OSE

  • USB4_LL_ERR_TE

  • USB4_LL_ERR_EBE

  • USB4_LL_ERR_DBE

  • USB4_LL_ERR_RDE

  • USB4_LL_ERR_RST

lane_adapter_index

Represents the index of the lane adapter:

  • RouteStringLow

  • RouteStringHigh

Example

logical_layer_errors_enable_bitmap = USB4_LL_ERR_ALE | USB4_LL_ERR_OSE | USB4_LL_ERR_TE

lane_adapter_index = 0 # The Lane 0 of The Upstream Port

Call USB4_SetRouterLogicalLayerErrorEnable( logical_layer_errors_enable_bitmap, lane_adapter_index )

USB4_SendHIFrame

Segments a HI Frame into the Tunnelled Packets and transmits them. This function can inject an error by sending all packets except the specified segment.

USB4_SendHIFrame( $data, excluded_segment_index )

Parameters

$data

A HI Data Frame.

excluded_segment_index

Used to exclude a specific segment of a frame from being sent.

Example

$data_payload = USB4VarContainer
{
    Data = 1024, 0xAA
}

# send all segmented packets
Call USB4_SendHIFrame( $data_payload )

# send all segments besides the second segment  
Call USB4_SendHIFrame( $data_payload, 1  )

USB4_SendPathWriteRequest

Sends a Write Request Control packet to configure a Path. This function has all the features of USB4_SendWriteRequest, plus a new capability to dynamically detect the target Adapter Number for path output.

USB4_SendPathWriteRequest( USB4SendPathWriteSettings $settings, $data )

Parameter/USB4SendPathWriteSettings

This setting includes all the features of USB4SendCtrlReadWriteSettings, plus the following.

Field Name

Possible Values (defaults in bold)

Description

PathOutputAdapterType

USB4_ADP_TYPE_INVALID 

USB4_LANE_ADP

USB4_HI_ADP

USB4_PCIE_DN_ADP

USB4_PCIE_UP_ADP

USB4_DP_OUT_ADP

USB4_DP_IN_ADP

USB4_USB3_DN_ADP

USB4_USB3_UP_ADP

USB4_USB3_GenT_DN_ADP

USB4_USB3_GenT_UP_ADP


If it is set, dynamically detect the target Adapter Number for path output, based on the PathOutputAdapterIndex

PathOutputAdapterIndex

0

Represents the index of the adapter within this particular type of adapter. If the PathOutputAdapterType is not set to USB4_ADP_TYPE_INVALID, the target Adapter Number for path output will be dynamically detected based on this field; otherwise, the Output Adapter in the path is set by the value that has been specified in $data.

$data: Data payload of the Write Request

Example

#  Configure a Loopback Path:
$path_setup = USB4PathCfgSpaceLaneAdp
{
    CS_0_OutputHopID = 8
    CS_0_OutputAdapter = 1
    CS_0_PathCreditsAllocated = 5
    CS_0_Valid = USB4_TRUE
    
    CS_1_Weight = 1
    CS_1_Priority = 3
    CS_1_CounterID = 0
    CS_1_CounterEnable = USB4_TRUE
    CS_1_IngressFlowCtrlFlag = USB4_TRUE
    CS_1_EgressFlowCtrlFlag = USB4_TRUE
    CS_1_IngressSharedBuffEnable = USB4_FALSE
    CS_1_EgressSharedBuffEnable = USB4_FALSE
    CS_1_PendingPackets = 0
}
$send_settings = USB4SendPathWriteSettings
{
    Address = 8 * 2
    AdapterType = USB4_LANE_ADP
    AdapterIndex = 0
    
    PathOutputAdapterType  = USB4_LANE_ADP
    PathOutputAdapterIndex = 0
    
    ConfigurationSpace = USB4_PATH_CFG
    CapabilityId       = USB4_CFG_CAP_BASIC
}
Call USB4_SendPathWriteRequest( $send_settings, $path_setup)

USB4_SetLoopbackPath

When the Exerciser acts as a Host, it sets a loopback path on the connected router in the specified depth.

USB4_SetLoopbackPath( USB4SetLoopbackPathSettings $settings )

Parameters/USB4SetLoopbackPathSettings

Field Name

Possible Values (defaults in bold)

Description

CS_0_OutputHopID



CS_0_OutputAdapter



CS_0_PathCreditsAllocated



CS_0_Rsvd



CS_0_Valid



CS_1_Weight



CS_1_Priority



CS_1_Rsvd1



CS_1_CounterID



CS_1_CounterEnable



CS_1_IngressFlowCtrlFlag



CS_1_EgressFlowCtrlFlag



CS_1_IngressSharedBuffEnable



CS_1_EgressSharedBuffEnable



CS_1_PendingPackets



CS_1_Rsvd2



CS_1_Rsvd3



IngressHopID

8


MaxDepth

USB4_DEEPEST_ROUTER_HOP

1..5


EnableExrCreditGrant

USB4_TRUE

USB4_FALSE

Enable/disable the Exerciser Credit Grant for the specified HopID.

Example

# Sets a loopback path on the deepest connected router to the Exerciser.
$path_settings = USB4SetLoopbackPathSettings
{
    CS_0_OutputHopID             = 8
    CS_0_PathCreditsAllocated    = 10
    
    CS_1_Weight                  = 1
    CS_1_Priority                = 3
    CS_1_CounterID               = 0
    CS_1_CounterEnable           = USB4_TRUE
    CS_1_IngressFlowCtrlFlag     = USB4_TRUE
    CS_1_EgressFlowCtrlFlag      = USB4_TRUE
    CS_1_IngressSharedBuffEnable = USB4_FALSE
    CS_1_EgressSharedBuffEnable  = USB4_FALSE
    CS_1_PendingPackets          = 0
    
    IngressHopID         = 8
    MaxDepth             = USB4_DEEPEST_ROUTER_HOP
    EnableExrCreditGrant = USB4_FALSE
}
Call USB4_SetLoopbackPath( $path_settings )

USB4_SetExerciserPathCreditsAllocated

Sets the initial value of the Path Credits Allocated for a HopID in the Exerciser.

USB4_SetExerciserPathCreditsAllocated( hop_id, credit_allocated )

Parameters

hop_id


credit_allocated

The initial value of the Path Credits Allocated.

Example

hop_id = 8

Call USB4_SetExerciserPathCreditsAllocated( hop_id, 5 )

USB4_SetExrLowPowerSettings

Configures the Exerciser's low-power behaviors.

USB4_SetExrLowPowerSettings( USB4ExrLowPowerSettings $settings )

Parameters/USB4ExrLowPowerSettings

Field Name

Possible Values (defaults in bold)

Description

IsPMSecondary

USB4_INVALID_VALUE

USB4_TRUE

USB4_FALSE


AutoExitAfterCLxEntryTime_Ns

USB4_INVALID_VALUE

3000 … 400,000,000

When set to a non-zero nanosecond time, the Exerciser automatically exits from the current Low Power state after the specified time. Zero value disables this functionality.

HighestSupportedCLxState

USB4_INVALID_VALUE

USB4_LLSM_STATE_CL0s

USB4_LLSM_STATE_CL1

USB4_LLSM_STATE_CL2


SendConcurrentCL1_Req

USB4_INVALID_VALUE

USB4_TRUE

USB4_FALSE

When true, the Exerciser sends CL1_REQ as soon as it receives a CL1_REQ from UUT

SendConcurrentCL2_Req

USB4_INVALID_VALUE

USB4_TRUE

USB4_FALSE

When true, the Exerciser sends CL2_REQ as soon as it receives a CL2_REQ from UUT

Example

$low_power_settings = USB4ExrLowPowerSettings
{
    IsPMSecondary = USB4_TRUE
}
Call USB4_SetExrLowPowerSettings( $low_power_settings )