This topic contains information about the special group of VSE functions that specify the events the verification script should expect to receive.
SendLevel()
Specifies that events of specified transaction level should be sent to the script. Currently only frame level events can be sent to verification scripts.
SendLevel(level)
|
Parameters |
|
|---|---|
|
level |
Can be one of the following values:
|
Remark
If no level is specified, events of frame level are sent to the script by default.
Example
SendLevel(_PKT); # Send packet level events.
SendLevelOnly()
Specifies that ONLY events of a specified transaction level should be sent to the script. Currently only frame level events can be sent to verification scripts.
SendLevelOnly(level)
|
Parameters |
|
|---|---|
|
level |
Can be one of the following values:
|
Example
SendLevelOnly(_PKT); # Send ONLY packet level events.
DontSendLevel()
Specifies that events of a specified transaction level should NOT be sent to the script. Currently only frame level events can be sent to verification scripts.
DontSendLevel(level)
|
Parameters |
|
|---|---|
|
level |
Can be one of the following values:
|
Example
…
DontSendLevel(_SPL_TRA); # DO NOT send split transaction level events.
SendChannel()
Specifies that events on the specified channel should be sent to the script.
SendChannel(channel)
|
Parameters |
|
|---|---|
|
channel |
Can be one of channel values defined as in.channel in section 5.1. |
Example
SendChannel(_USB2); # Send events from USB2 channel.
…
SendChannel(_CHANNEL_5); # Send events from channel 5 (USB3_RX).
SendChannel(_CHANNEL_6); # Send events from channel 6 (USB3_TX).
…
SendChannel(5); # Send events from channel 5 (USB3_RX).
SendChannel(6); # Send events from channel 6 (USB3_TX).
…
SendChannelOnly()
Specifies that ONLY events occuring on a specified channel should be sent to the script.
SendChannelOnly(channel)
|
Parameters |
|
|---|---|
|
channel |
Can be one of channel values defined as in.channel in section 5.1. |
Example
SendChannelOnly (_USB2); # Send ONLY events from USB2 channel.
…
SendChannelOnly (_CHANNEL_5); # Send ONLY events from channel 5 (USB3_RX).
SendChannelOnly (_CHANNEL_6); # Send ONLY events from channel 6 (USB3_TX).
…
SendChannelOnly (5); # Send ONLY events from channel 5 (USB3_RX).
SendChannel Only (6); # Send ONLY events from channel 6 (USB3_TX).
…
DontSendChannel()
Specifies that events occuring on a specified channel should NOT be sent to the script.
DontSendChannel (channel)
|
Parameters |
|
|---|---|
|
channel |
Can be one of channel values defined as in.channel in section 5.1. |
Example
DontSendChannel(_USB3_TX); # DO NOT send events from USB3 downstream channel.
…
DontSendChannel(_CHANNEL_5); # DO NOT send events from channel 5 (USB3_RX).
DontSendChannel(_CHANNEL_6); # DO NOT send events from channel 6 (USB3_TX).
…
DontSendChannel(5); # DO NOT send events from channel 5 (USB3_RX).
DontSendChannel(6); # DO NOT send events from channel 6 (USB3_TX).
…
SendAllChannels()
Specifies that events occuring on ALL channels should be sent to the script.
SendAllChannels ()
Example
…
SendAllChannels (); # Send events from ALL channels.
SendTraceEvent()
Specifies the events to be sent to a script.
SendTraceEvent(event)
|
Parameters |
|
|---|---|
|
event |
Can have one of the Trace Event values defined in Engine Events |
Example
…
SendTraceEvent(_USB2_TOKEN); # Send USB2 Token packet trace events.
SendTraceEvent(_USB2_BUS_CONDITION); # Send bus condition trace events.
…
SendTraceEvent(_T_SETUP) # Send Setup Transactions.
DontSendTraceEvent()
Specifies that the event specified in this function should not be sent to a script.
DontSendTraceEvent (event)
|
Parameters |
|
|---|---|
|
event |
See SendTraceEvent() for all possible values. |
Example
…
SendTraceEvent(_PACKET); # Send all packets.
…
if(SomeCondition)
{
DontSendTraceEvent (_USB2_SOF); # Don’t send Start Of Frame packets.
DontSendTraceEvent (_USB2_SPLIT); # Don’t send Split tokens.
}
SendTraceEventOnly()
Specifies that ONLY the event specified in this function is sent to the script.
SendTraceEventOnly(event)
|
Parameters |
|
|---|---|
|
event |
See SendTraceEvent() for all possible values. |
Remark
Use this function to send only one kind of event in situations where there are many events to be sent.
Example
…
SendTraceEvent(_PACKET); # Send all packets.
…
if(SomeCondition)
{
SendTraceEventOnly (_USB2_TOKEN);
# Only Token packets are sent.
}
SendAllTraceEvents()
Specifies that ALL trace events relevant for the selected transaction level are sent to the script.
SendAllTraceEvents ()
Example
…
SendAllTraceEvents (); # Send all types of trace events.
SendDirection()
Specifies more precise tuning for sending events only for a specified direction of the link.
SendDirection (direction)
|
Parameters |
|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
direction |
Can have one of the following values: Primitive Values
|
||||||||
If this parameter is omitted, trace events of all directions are sent, which is the same as SendTraceEvent(_ANY).
Example
SendBusState(_IN); # Send events that were transmitted from Host to Device.
SendBusState(); # Send events in all directions.
SendBusState(_ANY); # Send events in all directions.
SendUsb2BusConditions()
Specifies more precise tuning for USB2 Bus Condition events. Only selected events are sent.
SendUsb2BusConditions (condition)
|
Parameters |
|||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
condition |
Specifies bus condition. This parameter can have one of the following values:
|
||||||||||||||||||||||||||||||||||||
Example
# Send only Resume signaling events.
SendUsb2BusConditions(_RESUME);
…
# Send all bus condition events.
SendUsb2BusConditions (_ANY);
# or
SendUsb2BusConditions ();
SendUsb2TokenPackets()
Specifies more precise tuning for USB2 Token packets.
SendUsb2TokenPackets (pid, address, endpoint)
|
Parameters |
|
|---|---|
|
pid |
Specifies that only Token packets with the specified PID value are sent.
|
|
address |
Specifies that only Token packets with the specified Address value are sent. The value _ANY means any Address is accepted. |
|
endpoint |
Specifies that only Token packets with the specified Endpoint value are sent. The value _ANY means any Endpoint is accepted. |
Example
# Send any Token packet.
SendUsb2TokenPackets();
# Send all SETUP packets.
SendUsb2TokenPackets (PID_SETUP);
# Send all IN tokens for address 5 endpoint 1.
SendUsb2TokenPackets (PID_IN, 3);
# Send all OUT tokens for address 3.
SendUsb2TokenPackets (PID_OUT, 5, 1);
# Send all token packets for endpoint zero.
SendUsb2TokenPackets (_ANY, _ANY, 0);
SendUsb2DataPackets ()
Specifies more precise tuning for Data packets.
SendUsb2DataPackets(pid)
|
Parameters |
|
|---|---|
|
pid |
Specifies that only Data packets with the specified data PID value are sent.
|
Example
# Send any Data packet.
SendUsb2DataPackets();
# Send only MDATA packets.
SendUsb2DataPackets(PID_MDATA);
SendUsb2HskPackets()
Specifies more precise tuning for Handshake packets.
SendUsb2HskPackets(pid)
|
Parameters |
|
|---|---|
|
pid |
Specifies that only Data packets with the specified data PID are sent. The value _ANY means any data packet is accepted. The following PID values apply:
|
Example
# Send any handshake.
SendUsb2HskPackets();
# Send only STALL handshakes.
SendUsb2HskPackets (PID_STALL);
SendTransaction()
Works on the Transaction level and allows specifying more precise tuning for the transaction events that are sent to the script.
SendTransaction(tra_type, xfer_type, address, endpoint, completion_flag, only_with_errors)
|
Parameters |
|
|---|---|
|
tra_type |
Specifies the type of Transaction event (see transaction event types). |
|
xfer_type |
Specifies the type of Transfer this transaction is being part of (see transfer event types). |
|
address |
Specifies that only Transaction events with the specified Address value are sent. The value _ANY means any Address is accepted. |
|
endpoint |
Specifies that only Transaction events with the specified Endpoint value are sent. The value _ANY means any Endpoint is accepted. |
|
completion_flag |
Specifies that only Transaction events with the specified Handshake PIDs are sent. The value _ANY means any handshake is accepted. The possible values are:
|
|
only_with_errors |
When set to 1, specifies that only Transaction events with errors at the transaction level are sent. |
Example
# Send SETUP transactions for any Transfer type and address 0.
SendTransaction( _T_SETUP, _ANY, 0 );
# Send OUT transactions for any transfer type, address 1, endpoint 0.
SendTransaction( _T_OUT, _ANY, 1, 0 );
# Send IN transactions for BULK transfers that were acknoledged by ACK.
SendTransaction( _T_IN, _X_BULK, _ANY, _ANY, PID_ACK );
# Send IN transactions with errors.
SendTransaction( _T_IN, _ANY, _ANY, _ANY, _ANY, 1 );
SendTransfer()
Works on the Transfer level and allows specifying more precise tuning for the transfer events that are sent to the script.
SendTransfer(xfer_type, address, endpoint, completed, only_with_errors)
|
Parameters |
|
|---|---|
|
xfer_type |
Specifies the type of Transfer to send to the script (see transfer event types). The value _ANY means any transfer type is accepted. |
|
address |
Specifies that only Transfer events with the specified Address value are sent. The value _ANY means any Address is accepted. |
|
endpoint |
Specifies that only Transfer events with the specified Endpoint value are sent. The value _ANY means any Endpoint is accepted. |
|
completed |
Specifies that only Transfers that are complete (1, default) or incomplete (0) should be sent to the script. |
|
only_with_errors |
When set to 1, specifies that only Transfer events with errors at the transfer level are sent. |
Example
# Send Control Transfers for address 0.
SendTransfer( _X_CONTROL, 0 );
# Send BULK transfers with errors.
SendTransfer( _X_BULK, _ANY, _ANY, 0, 1 );
SendSCSIOperation()
Works on the SCSI level and allows specifying more precise tuning for the SCSI operation events that are sent to the script.
SendSCSIOperation(address)
|
Parameters |
|
|---|---|
|
address |
Specifies that only SCSI operation events with the specified Address value are sent. The value _ANY means any Address is accepted. |
Example
# Send all SCSI operations.
SendSCSIOperation( _ANY );
# Send SCSI operations with address 2.
SendSCSIOperation ( 2 );
SendPHYTransaction()
This function works on the PHY Transaction level and allows specifying more precise tuning for the PHY Transaction events that are sent to the script.
SendPHYTransaction(phy_tra_type)
|
Parameters |
|
|---|---|
|
phy_tra_type |
Specifies the type of PHY Transaction to send to the script (see PHY Transaction event types). The value _ANY means any PHY Transaction type is accepted. |
Examples
# Send all PHY Transactions.
SendPHYTransaction( _ANY );
# Send PHY Ready Transactions.
SendPHYTransaction ( _P_PHY_READY );
SendPktsWithBadCRC()
This function instructs VSE to send packets with bad CRC to the script. By default, packets with bad CRC are not sent to verification scripts.
To determine whether a packet has an CRC5 or CRC16 error, check in.Errors
(It is different from 0 if there are some header errors. See the in.Errors section for full error bit descriptions.)
SendPktsWithBadCRC( send_packets_with_bad_crc )
|
Parameters |
|
|---|---|
|
send_packets_with_bad_crcr |
Optional parameter specifies whether frames with bad CRC should be sent to the verification script or not. If it is omitted or set to 1, frames with bad CRC are sent to the script. Otherwise, VSE sends only frames with correct CRC. |
Examples
SendAllChannels (); # Send events from ALL channels.
SendAllTraceEvents(); # Send all events.
SendPktsWithBadCRC(); # Send packets with CRC errors.
…
crc16_error_mask = 0x8; # Bit 3 (if set) indicates CRC16 error.
if( in.Errors & crc16_error_mask
{
# Handle CRC16 error.
}
…
SendPktsWithBadCRC ( 0 ); # Send frames with no CRC errors.