12 prepare wait packet instruction, Prepare wait packet instruction – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 92

Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
83
9.12 Prepare Wait Packet Instruction
This instruction tells the Voyager USB 3.0 Exerciser to prepare to wait for incoming packets.
Note 1: Even when no specific fields are checked in the packets to wait for, the USB 3.0 Link
partner may sometimes send a response faster than it takes for the Voyager USB 3.0 Exerciser
to get to the next WaitPacket instruction. In such cases, the Voyager USB 3.0 Exerciser should
prepare for incoming Rx packets before processing the next WaitPacket instruction. Otherwise,
Rx packets will be lost and WaitPacket will block forever. The PrepareWaitPkt instruction
explicitly tells the Voyager USB 3.0 Exerciser when it should start such preparations, so that no
Rx packets are lost and the next WaitPacket instruction executes normally.
Note2: The WaitPacket instruction also has an implicit way to indicate that the Voyager USB 3.0
Exerciser should prepare for incoming Rx packets at the time it executes the previous
Send Packet instruction. Please refer to the
for more details
.
Format
PrepareWaitPkt
[
( pkt_type, pkt_sub_type, ep_num, dev_addr, ep_dir,
stream_id )
]
The parameters are:
o pkt_type: Type of the packet(s) [TP, DP, or ITP] on which to wait
(defined in gen_constants.ginc)
o pkt_sub_type: Subtype of the packet(s) on which to wait (applicable only to TP; defined in
Main_Tp_Pkt_templates.ginc)
o ep_num: Endpoint number for the packet(s) on which to wait
o dev_addr: Device address for the packet(s) on which to wait
o ep_dir: Endpoint direction for the packet(s) on which to wait
o stream_id: Stream ID for the packet(s) on which to wait
A “don’t care” value of USB3_ANY (defined in gen_constants.ginc) can be used for any one of the
parameters.
Example
Set
Mode = HOST
# Set ‘Host’ mode
.
Main
{
# Prepare to wait for a data packet on the specified endpoint.
PrepareWaitPkt( USB3_TYPE_DP, USB3_ANY, 3 )
Send
TP_ACK
{
DevAddr =
1
Endp =
3
dir = HOST_TO_DEVICE
NumP =
1
}
# Wait for Data packet from device.
WaitPacket
}