background image

 

 

P

ROTOCOL 

S

OLUTIONS 

G

ROUP

 

3385

 

S

COTT 

B

LVD

 

S

ANTA 

C

LARA

,

 

CA

  

95054

 

 
 
 
 
 
 

 
 

Verification Script Engine 

for 

LeCroy USB Protocol Suite

™ 

Reference Manual

 

 
 
 
 
 
 
 
 
 
 
 
 

Manual Version 1.2 

For USB Protocol Suite version 3.71 

December 2009

 

 

Summary of Contents for USB Protocol Suite

Page 1: ...ROTOCOL SOLUTIONS GROUP 3385 SCOTT BLVD SANTA CLARA CA 95054 Verification Script Engine for LeCroy USB Protocol Suite Reference Manual Manual Version 1 2 For USB Protocol Suite version 3 71 December 2009 ...

Page 2: ...rves the right to revise the information presented in this document without notice or penalty Trademarks and Servicemarks LeCroy CATC and USB Protocol Suite are trademarks of LeCroy Microsoft and Windows are registered trademarks of Microsoft Inc All other trademarks are property of their respective companies Copyright Copyright 2009 LeCroy Corporation All Rights Reserved This document may be prin...

Page 3: ... 23 5 2 2 Transaction specific Set of Members 28 5 2 3 Split Transaction specific Set of Members 30 5 2 4 Transfer specific Set of Members 31 6 VERIFICATION SCRIPT ENGINE OUTPUT CONTEXT MEMBERS 32 7 VERIFICATION SCRIPT ENGINE EVENTS 33 7 1 PACKET LEVEL EVENTS 34 7 2 TRANSACTION LEVEL EVENTS 35 7 3 SPLIT TRANSACTION LEVEL EVENTS 35 7 4 TRANSFER LEVEL EVENTS 35 8 SENDING FUNCTIONS 36 8 1 SENDLEVEL 3...

Page 4: ...12 1 ADDTIME 64 12 2 SUBTRACTTIME 65 12 3 MULTIMEBYINT 66 12 4 DIVTIMEBYINT 67 13 TIME LOGICAL FUNCTIONS 68 13 1 ISEQUALTIME 68 13 2 ISLESSTIME 69 13 3 ISGREATERTIME 70 13 4 ISTIMEININTERVAL 71 14 TIME TEXT FUNCTIONS 72 14 1 TIMETOTEXT 72 15 OUTPUT FUNCTIONS 73 15 1 REPORTTEXT 73 15 2 ENABLEOUTPUT 74 15 3 DISABLEOUTPUT 75 16 INFORMATION FUNCTIONS 76 16 1 GETTRACENAME 76 16 2 GETSCRIPTNAME 77 16 3 ...

Page 5: ...0 COM AUTOMATION COMMUNICATION FUNCTIONS 93 20 1 NOTIFYCLIENT 93 21 USER INPUT FUNCTIONS 94 21 1 MSGBOX 94 21 2 INPUTBOX 96 21 3 GETUSERDLGLIMIT 98 21 4 SETUSERDLGLIMIT 99 22 STRING MANIPULATION FORMATING FUNCTIONS 100 22 1 FORMATEX 100 23 MISCELLANEOUS FUNCTIONS 102 23 1 SCRIPTFORDISPLAYONLY 102 23 2 SLEEP 103 23 3 CONVERTTOHTML 104 23 4 PAUSE 105 24 THE IMPORTANT VSE SCRIPT FILES 106 HOW TO CONT...

Page 6: ...ccordance with user defined conditions and performs post processing tasks such as exporting key information to external files in text or binary format or sending special Automation COM notifications to client applications The VSE fully utilizes the high performance and intelligence of LeCroy decoding capabilities making processing of information easy and fast VSE can Retrieve information about any...

Page 7: ...Scripts VFScripts of the main folder Some other files must be included in the main script file using the directive include The following schema presents a common structure of a verification script It is similar to the script template VSTemplate vs_ which is included with VSE VS1 vse Verification script Brief Description Verify something Module info Filling of this block is necessary for proper ver...

Page 8: ...ng up all necessary script parameters before running the script OnStartScript Specify in the body of this function the initial values for global variables and what kinds of trace events should be passed to the script By default only Primitive events from all channels are passed to the script For details about how to specify the kind of events to pass to the script please see the topic Sending Func...

Page 9: ...sage only once no matter how many times ProcessEvent is called ShowStartPrompt ShowStartPrompt n Write the body of this function depending on your needs Return Complete OnFinishScript Main script function called by the application when the script has completed running Specify in this function some resetting procedures for a successive run of this script OPTIONAL OnFinishScript return 0 Additional ...

Page 10: ...h all processing of incoming trace events is done Basically when the whole verification program consists of a few stages this function processes the event sent to the script verifies that information contained in the event is appropriate for the current stage and decides if VSE should continue script running If the whole result is clear on the current stage it tells VSE to complete execution of th...

Page 11: ...TION_FAILED will complete the script run Call If expected event OnFinishScript Finishing VSE running Call PASSED FAILED DONE Verification Script results ProcessEvent Call If expected event File COM Client Data Note Verification script result DONE means that the script is intended for extracting and displaying some information from recorded traces only and you do not care about results To specify t...

Page 12: ...anual Page 12 of 107 4 Running Verification Scripts from Application To run a verification script over a trace you select the main menu item Report Run verification scripts or click the Run verification scripts button on the main tool bar if it is not hidden ...

Page 13: ...on Descriptions for scripts are defined in set DecoderDesc MyDescription Starts running selected verification scripts Expands output windows Shortcut key F11 Shift F11 also maximizes dialog Tabbed output windows for selected verification scripts Saves contents of output windows in text files Allows to set different settings Finds a view related to the verified trace and place this window under it ...

Page 14: ...14 of 107 4 1 Running Verification Scripts Push the button Run scripts after you select scripts to run VSE starts running the selected verification scripts shows script report information in the output windows and presents the results of verifications in the script list ...

Page 15: ...dit selected scripts in the editor application specified in Editor settings New script Create a new script file using the template specified in Editor settings Show Grid Show hide a grid in the verification script list Show Description window Show hide the script description window Shortcut key F2 Show Output Show hide the script output windows Shortcut key F3 Settings Open a special Setting dialo...

Page 16: ...or applications supporting multi document interface MDI to edit all script files related to the selected scripts in one application instance Otherwise a new application instance will be launched for each script file This setting if set specifies that the last saved output for selected scripts should be loaded into the output windows This setting if set brings Run VS dialog to foreground when scrip...

Page 17: ...el value 3 in Index Index of the event in the trace file packet number for packets etc in Time Time of the event type list having format 2 sec 125 ns 2 125 For more information see section 10 1 VSE Time Object In Channel Indicates on which channel the event occured It can be one of the following constants _USB2 USB2 traffic value 1 _USB3_RX USB3 Host Receive traffic Upstream value 2 _USB3_TX USB3 ...

Page 18: ...rrors A bitmap of packet level errors The table below describes the current list of possible packet errors and their bit positions in the error bitmap Error type Bit position Description USB2 Errors PID_ERROR 1 Bad PID value CRC5_ERROR 2 Bad CRC5 CRC16_ERROR 3 Bad CRC16 PACKETLEN_ERROR 4 Wrong packet length BIT_STUFF_ERROR 5 Bit stuffing error EOP_ERROR 6 Bad End Of Packet BABBLE_START_ERROR 7 Bab...

Page 19: ...escription CHIRP_K _CHIRP_K 0 Device K Chirp to notify host of Hi Speed capability CHIRP_J _CHIRP_J 1 Device J Chirp to notify host of Hi Speed capability FS_K_ON_HS _FS_K_ON_HS 2 Full Speed K signaling on Hi Speed branch FS_J_ON_HS _FS_J_ON_HS 3 Full Speed J signaling on Hi Speed branch SUSPEND _SUSPEND 4 Suspend signaling RESUME _RESUME 5 Resume signaling SE1 _SE1 6 SE1 signaling SE0 _SE0 7 SE0 ...

Page 20: ... 2 0 PID values const PID_OUT 0x87 const PID_IN 0x96 const PID_SOF 0xA5 const PID_SETUP 0xB4 const PID_DATA0 0xC3 const PID_DATA1 0xD2 const PID_DATA2 0xE1 const PID_MDATA 0xF0 const PID_ACK 0x4B const PID_NAK 0x5A const PID_STALL 0x78 const PID_NYET 0x69 const PID_PRE 0x3C const PID_ERR 0x3C const PID_SPLIT 0x1E const PID_PING 0x2D const PID_EXT 0x0F in SubPidPacket If non zero signals that this ...

Page 21: ...t payload You can extract any necessary information using GetNBits NextNBits or PeekNBits function In PayloadLength Length in bytes of the packet payload In CRC16 CRC16 value for the Data packet 5 2 1 2 4 USB2 Split Token Packet Members in HubAddr Value of the Hub Address field the USB device address of the hub supporting the specified full low speed device for this full low speed transaction In S...

Page 22: ...Management Extended Token Members in HIRD Value of the Host Initiated Resume Duration field In bLinkState Value of the bLinkState field for the LPM extended token In bRemoteWake Value of the bRemoteWake bit for the LPM extended token In Reserved Value of the reserved field for the LPM extended token ...

Page 23: ...unt Value of TS count the number of sequential TS1 or TS2 sequences sent in LnkFunctionality Value of the whole Link Functionality Link Configuration byte in the training sequence in Reset Value of the Reset bit in the Link Configuration byte In SSDisable Value of the Spread Spectrum bit in the Link Configuration byte In Loopback Value of the Loopback asserted deasserted bit in the Link Configurat...

Page 24: ...acket Members in BusICounter Bus Interval Counter value for ITP in 1 8 of a millisecond in Delta Time Delta value for ITP in BusIAdjCtrl Bus Interval Adjustment Control value for ITP specifying the device in control of bus interval adjustment 5 2 1 3 10 Transaction Packet Members in SubType SubType value for Transaction Packet Use constant definitions in VS_constants inc in Addr Address of the dev...

Page 25: ...of the payload for this Data Packet in PayloadLength Length of the payload actually recorded for this Data Packet in Payload Bit source of the packet payload for this Data Packet You can extract any necessary information using the GetNBits NextNBits or PeekNBits function in CRC32 Value of CRC32 protecting the payload for this Data Packet Note In USB Protocol Suite software versions earlier than 3 ...

Page 26: ...g value str FormatEx tSubType str s GetDecodedPktField SubType ReportText str Hex Value val GetHexPktField SubType str FormatEx tSubType hex 0x X n val ReportText str Hseq field String value str FormatEx tHseq str s GetDecodedPktField Hseq ReportText str Hex Value val GetHexPktField Hseq str FormatEx tHseq hex 0x X n val ReportText str if in TraceEvent _USB3_TP_PKT in SubType TP_ACK Example of usi...

Page 27: ...matEx tSeqN hex 0x X n val ReportText str ENDP field String value str FormatEx tENDP str s GetDecodedPktField ENDP ReportText str Hex Value val GetHexPktField ENDP str FormatEx tENDP hex 0x X n val ReportText str Link Control Word if in TraceEvent _USB3_TP_PKT in TraceEvent _USB3_DP_PKT ReportText LCW val GetHexPktField Hseq str FormatEx tHseq d val ReportText str val GetHexPktField Hdepth str For...

Page 28: ... case no handshake was sent for the transaction In Complete Flag signaling if the transaction was complete In XferType Type of the USB Transfer this transaction belongs to See Transfer Types for possible values In CtrlDirection For a Setup transaction represents the direction of the corresponding Control Transfer 0 Host to device 1 Device to host in FirstInXfer This flag is set when the transactio...

Page 29: ... Value of the End bit for the split token In ET Value of the Endpoint Type field for the split token In OTGHostId For USB On The Go transactions indicates if the A device is acting as the host value of 0 or the B device is acting as the host value of 1 In OTGErrorCode For USB On The Go transactions indicates error code if non zero In OTGErrorCodeOffset For USB On The Go transactions with errors in...

Page 30: ... Split Transaction specific Set of Members All the input context members that are defined for USB2 transactions are also applicable to Split Transactions In addition to those Split Transactions define the following members in TraHalted Indicates that this split transaction was halted ...

Page 31: ...ice Request in ReqType in ReqRecipient in bRequest in wIndex in wValue in wLength in ClassicOnHigh When set indicates that this transfer was a classic speed transfer that was executed and captured on a high speed branch upstream from a high speed hub In OTGHostId For USB On The Go transfers indicates if the A device is acting as the host value of 0 or the B device is acting as the host value of 1 ...

Page 32: ...ification script This member can have three values _VERIFICATION_PROGRESS Set by default when a script starts running _VERIFICATION_PASSED _VERIFICATION_FAILED The last two values should be set if you decide that a recorded trace does or does not satisfy the imposed verification conditions In both cases the verification script stops running If you do not specify any of those values the result of s...

Page 33: ...luating retrieving and displaying some contained information The information about the type of event can be seen in the in TraceEvent input context member The application defines a set of VSE constants for Trace Event types Those constants should be used by the scripts for determining the event types See the topic Sending Functions for details about how to specify the events to send to verificatio...

Page 34: ...USB2 Link Power Management extended token _USB2_LPM All other USB2 packets _USB2_OTHER USB3 packet events All USB3 packet events _USB3_PACKET TSEQ Training Sequence Ordered Sets _USB3_TSEQ TS1 Training Sequence Ordered Sets _USB3_TS1 TS2 Training Sequence Ordered Sets _USB3_TS2 Low Frequency Periodic Signaling _USB3_LFPS Interpacket Symbols _USB3_IPS Link Commands _USB3_LINK_CMD SKIP Sequences _US...

Page 35: ... 7 3 Split Transaction Level Events The table below describes the current list of split transaction level events and values application defined constants for in TraceEvent Types of transactions in TraceEvent All split transactions _SPLIT_TRA 7 4 Transfer Level Events The table below describes the current list of transfer level events and values application defined constants for in TraceEvent Types...

Page 36: ...ies that events of specified transaction level should be sent to the script Currently only frame level events can be sent to verification scripts Format SendLevel level Parameters level Can be one of following values _PKT Packet level value 0 _TRA Transaction level value 1 _SPL_TRA Split Transaction level value 2 _XFER Transfer level value 3 Remark If no level was specified events of frame level a...

Page 37: ... level should be sent to the script Currently only frame level events can be sent to verification scripts Format SendLevelOnly level Parameters level Can be one of following values _PKT Packet level value 0 _TRA Transaction level value 1 _SPL_TRA Split Transaction level value 2 _XFER Transfer level value 3 Example SendLevelOnly _PKT Send ONLY packet level events ...

Page 38: ... NOT be sent to the script Currently only frame level events can be sent to verification scripts Format DontSendLevel level Parameters level Can be one of following values _PKT Packet level value 0 _TRA Transaction level value 1 _SPL_TRA Split Transaction level value 2 _XFER Transfer level value 3 Example DontSendLevel _SPL_TRA DO NOT send split transaction level events ...

Page 39: ...an be one of following values _USB2 USB2 traffic value 1 _USB3_RX USB3 Host Receive traffic Upstream value 2 _USB3_TX USB3 Host Transmit traffic Downstream value 3 Example SendChannel _USB2 Send events from USB2 channel SendChannel _CHANNEL_2 Send events from channel 2 USB3_RX SendChannel _CHANNEL_3 Send events from channel 3 USB3_TX SendChannel 2 Send events from channel 2 USB3_RX SendChannel 3 S...

Page 40: ...following values _USB2 USB2 traffic value 1 _USB3_RX USB3 Host Receive traffic Upstream value 2 _USB3_TX USB3 Host Transmit traffic Downstream value 3 Example SendChannelOnly _USB2 Send ONLY events from USB2 channel SendChannelOnly _CHANNEL_2 Send ONLY events from channel 2 USB3_RX SendChannelOnly _CHANNEL_3 Send ONLY events from channel 3 USB3_TX SendChannelOnly 2 Send ONLY events from channel 2 ...

Page 41: ...lues _USB2 USB2 traffic value 1 _USB3_RX USB3 Host Receive traffic Upstream value 2 _USB3_TX USB3 Host Transmit traffic Downstream value 3 Example DontSendChannel _USB3_TX DO NOT send events from USB3 downstream channel DontSendChannel _CHANNEL_2 DO NOT send events from channel 2 USB3_RX DontSendChannel _CHANNEL_3 DO NOT send events from channel 3 USB3_TX DontSendChannel 2 DO NOT send events from ...

Page 42: ... Script Engine Reference Manual Page 42 of 107 8 7 SendAllChannels This function specifies that events occuring on ALL channels should be sent to the script Format SendAllChannels Example SendAllChannels Send events from ALL channels ...

Page 43: ...ent to a script Format SendTraceEvent event Parameters event Can have one of the Trace Event values defined in Chapter 7 Verification Script 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 ...

Page 44: ...vent specified in this function should not be sent to a script Format 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 ...

Page 45: ...on is sent to the script Format SendTraceEventOnly event Parameters event See SendTraceEvent for all possible values Remark This function may be useful when there are many events to be sent to send only one kind of event and not send the other ones Example SendTraceEvent _PACKET Send all packets if SomeCondition SendTraceEventOnly _USB2_TOKEN Only Token packets are sent ...

Page 46: ...ference Manual Page 46 of 107 8 11 SendAllTraceEvents This function specifies that ALL trace events relevant for the selected transaction level are sent to the script Format SendAllTraceEvents Example SendAllTraceEvents Send all types of trace events ...

Page 47: ... one of the following values Primitive Values Constant Direction _IN Direction is from Host to Device value 2 _OUT Direction is from Device to Host value 3 _ANY Any Direction If this parameter 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 i...

Page 48: ...IRP_K 0 Device K Chirp to notify host of Hi Speed capability _CHIRP_J 1 Device J Chirp to notify host of Hi Speed capability _FS_K_ON_HS 2 Full Speed K signaling on Hi Speed branch _FS_J_ON_HS 3 Full Speed J signaling on Hi Speed branch _SUSPEND 4 Suspend signaling _RESUME 5 Resume signaling _SE1 6 SE1 signaling _SE0 7 SE0 FS or LS signaling can be keep alive for LS _VBUS_VOLTAGE_CHANGE 44 0x2C Ch...

Page 49: ...nst PID_SPLIT 0x1E const PID_PING 0x2D const PID_EXT 0x0F 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 SendUsb...

Page 50: ...ndUsb2DataPackets 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 follofwing PID values apply const PID_DATA0 0xC3 const PID_DATA1 0xD2 const PID_DATA2 0xE1 const PID_MDATA 0xF0 Example Send any Data packet SendUsb2DataPackets Send only MDATA packets SendUsb2DataPackets PID_MDATA ...

Page 51: ...b2HskPackets 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 follofwing PID values apply const PID_ACK 0x4B const PID_NAK 0x5A const PID_STALL 0x78 const PID_NYET 0x69 const PID_ERR 0x3C Example Send any handshake SendUsb2HskPackets Send only STALL handshakes SendUsb2HskPackets PID_STALL ...

Page 52: ... 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 const PID_ACK 0x4B const PID_NAK 0x5A const PID_STALL 0x78 const PID_NYET 0x69 const PID_ERR 0x3C only_with_errors When se...

Page 53: ...pe 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_wi...

Page 54: ...criptions Format 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 Example SendAllChannels Send events from ALL channels SendAllTaceEvents S...

Page 55: ...B Protocol Suite trace view or the View Fields dialog Format GetDecodedPktField fld_name Parameters fld_name Name of the field supposedly existing in the current packet Return Values If the field name is in the current packet the return value is the text value of the decoded field and how to display it in the trace view Otherwise the return value is the empty string Example if in TraceEvent _USB3_...

Page 56: ... field length is greater than 32 bits The raw binary value gives a list of bytes See the CSL Manual for further details about raw binary values o null value if the field was not found Example Link Control Word if in TraceEvent _USB3_TP_PKT in TraceEvent _USB3_DP_PKT ReportText LCW val GetHexPktField Hseq str FormatEx tHseq d val ReportText str val GetHexPktField Hdepth str FormatEx tHDepth d val R...

Page 57: ...nt Transfer the return value is the text value of the decoded field and how to display it in the trace Otherwise the return value is the empty string Example Extract the decoded value of wValue field for a Control transfer that uses a certain Class or Vendor specific decoding str GetDecodedScriptField wValue If the bulk transfer payload decoded by the script decoder has a field named Code i e PTP ...

Page 58: ...h is less than 32 bits o raw binary value if field length is greater than 32 bits The raw binary value gives a list of bytes See the CSL Manual for further details about raw binary values o null value if the field was not found Example Extract the hex value of the LBA field for mass storage val GetHexScriptField Logical Block Addr Extract the hex value of the SomeBig field if GetHexScriptField Som...

Page 59: ...h timers internal routines that repeatedly measure a timing interval between different events 10 1 VSE Time Object A VSE time object presents time intervals in verification scripts The verification script time object is a list object of two elements seconds nanoseconds Note The best way to construct a VSE time object is to use the Time function see below ...

Page 60: ...unction was called Format SendTimer timer_id 0 Parameters timer_id Unique timer identifier Example SetTimer Start timing for timer with id 0 SetTimer 23 Start timing for timer with id 23 Remark If this function is called a second time for the same timer ID it resets the timer and starts timing the calculation again from the point where it was called ...

Page 61: ... 61 of 107 10 3 KillTimer Stops a timing calculation for a specific timer and frees related resources Format KillTimer timer_id 0 Parameters timer_id Unique timer identifier Example KillTimer Stop timing for timer with id 0 KillTimer 23 Stop timing for timer with id 23 ...

Page 62: ...fic timer Format GetTimerTime timer_id 0 Parameters timer_id Unique timer identifier Return values Returns a VSE time object from a timer with id timer_id Example GetTimerTime Retrieve timing interval for timer with id 0 GetTimerTime 23 Retrieve timing interval for timer with id 23 Remark This function when called does not reset the timer ...

Page 63: ...anoseconds Number of nanoseconds in specified time neconds Number of seconds in specified time Return values First function returns 0 nanoseconds second one returns seconds nanoseconds Example Time 50 1000 Create time object of 50 microseconds Time 3 100 Create time object of 3 seconds and 100 nanoseconds Time 3 MICRO_SECS Create time object of 3 microseconds Time 4 MILLI_SECS Create time object o...

Page 64: ...ts 12 1 AddTime Adds two VSE time objects Format AddTime time1 time2 Parameters time_1 VSE time object representing the first time interval time_2 VSE time object representing the second time interval Return values Returns a VSE time object representing a time interval equal to sum of time_1 and time_2 Example t1 Time 100 t2 Time 2 200 t3 AddTime t1 t2 Returns VSE time object 2 sec 300 ns ...

Page 65: ...ctTime time1 time2 Parameters time_1 VSE time object presenting first time interval time_2 VSE time object presenting second time interval Return values Returns a VSE time object representing a time interval equal to subtraction of time_1 and time_2 Example t1 Time 100 t2 Time 2 200 t3 SubtractTime t2 t1 Returns VSE time object 2 sec 100 ns ...

Page 66: ...iplies a VSE time object by an integer value Format MulTimeByInt time mult Parameters time VSE time object mult Multiplier integer value Return values Returns a VSE time object representing a time interval equal to time mult Example t Time 2 200 t1 MulTimeByInt t 2 Returns VSE time object 4 sec 400 ns ...

Page 67: ... Divides a VSE time object by an integer value Format DivTimeByInt time div Parameters time VSE time object div Divider integer value Return values Returns a VSE time object representing time interval equal to time div Example t Time 2 200 t1 DivTimeByInt t 2 Returns VSE time object 1 sec 100 ns ...

Page 68: ... IsEqualTime Verifies that one VSE time object is equal to another VSE time object Format IsEqualTime time1 time2 Parameters time_1 VSE time object representing the first time interval time_2 VSE time object representing the second time interval Return values Returns 1 if time_1 is equal to time_2 Returns 0 otherwise Example t1 Time 100 t2 Time 500 If IsEqualTime t1 t2 DoSomething ...

Page 69: ...less than another VSE time object Format IsLessTime time1 time2 Parameters time_1 VSE time object representing the first time interval time_2 VSE time object representing the second time interval Return values Returns 1 if time_1 is less than time_2 Returns 0 otherwise Example t1 Time 100 t2 Time 500 If IsLessTime t1 t2 DoSomething ...

Page 70: ...er than another VSE time object Format IsGreaterTime time1 time2 Parameters time_1 VSE time object representing the first time interval time_2 VSE time object representing the second time interval Return values Returns 1 if time_1 is greater than time_2 Returns 0 otherwise Example t1 Time 100 t2 Time 500 If IsGreaterTime t1 t2 DoSomething ...

Page 71: ...imum VSE time object Format IsTimeInInterval min_time time max_time Parameters min_time VSE time object representing a minimum interval time VSE time object representing a time interval max_time VSE time object representing a maximum interval Return values Returns 1 if min_time time max_time Returns 0 otherwise Example t1 Time 100 t Time 400 t2 Time 500 If IsTimeInInterval t1 t t2 DoSomething ...

Page 72: ... covers VSE capability to convert VSE time objects into text strings 14 1 TimeToText Converts a VSE time object into text Format TimeToText time Parameters time VSE time object Return values Returns a text representation of a VSE time object Example t Time 100 ReportText TimeToText t See below details for ReportText function ...

Page 73: ...ndow 15 1 ReportText Outputs text in the output window related to the verification script Format ReportText text Parameters text Text variable constant or literal Example ReportText Some text t Some text ReportText t num_of_packets in NumOfPackets text Format Number of frames d num_of_packets ReportText text x 0xAAAA y 0xBBBB text FormatEx x 0x 04X y 0x 04X x y ReportText Text text ...

Page 74: ...Verification Script Engine Reference Manual Page 74 of 107 15 2 EnableOutput Enables showing information in the output window and sending COM reporting notifications to COM clients Format EnableOutput Example EnableOutput ...

Page 75: ...rification Script Engine Reference Manual Page 75 of 107 15 3 DisableOutput Disables showing information in the output window and sending COM reporting notifications to COM clients Format DisableOutput Example DisableOutput ...

Page 76: ...ng processed by VSE Format GetTraceName filepath_compatible Parameters filepath_compatible If this parameter is present and not equal to 0 the returned value may be used as part of the filename Example ReportText Trace name GetTraceName File OpenFile C My Files GetTraceName 1 _log log For trace file with path D Some Traces Data usb GetTraceName 1 returns D_Some Traces_Data usb ...

Page 77: ...ation Script Engine Reference Manual Page 77 of 107 16 2 GetScriptName This function returns the name of the verification script where this function is called Format GetScriptName Example ReportText Current script GetScriptName ...

Page 78: ...pt Engine Reference Manual Page 78 of 107 16 3 GetApplicationFolder This function returns the full path to the folder where the application was started Format GetApplicationFolder Example ReportText Application folder GetApplicationFolder ...

Page 79: ... Engine Reference Manual Page 79 of 107 16 4 GetCurrentTime This function returns the string representation of the current system time Format GetCurrentTime Example Yields current time in format May 18 2006 5 49 PM ReportText GetCurrentTime ...

Page 80: ...he event to jump Remarks If no parameters were specified the application jumps to the current event being processed by VSE If wrong parameters were specified for example index exceeding the maximal index for the specified transaction level the function does nothing and an error message is sent to the output window Example if Something interesting GotoEvent Go to the current event if SomeCondition ...

Page 81: ...pplication sets the marker to the current event being processed by VSE If wrong parameters were specified for example index exceeding the maximal index for the specified transaction level the function does nothing and an error message is sent to the output window Example Set marker to the current event if Something interesting SetMarker Something cool if SomeCondition interesting_level in Level in...

Page 82: ...LeCroy Corporation Verification Script Engine Reference Manual Page 82 of 107 18 File Functions This group of functions covers VSE capabilities to work with external files ...

Page 83: ...file in binary mode _FO_TEXT 1 Opens file in text mode by default Return Values The handle to the file to be used in other file functions Example set file_handle 0 file_handle OpenFile D Log txt Opens file in text mode The previous contents are erased WriteString file_handle Some Text1 Write text string to file WriteString file_handle Some Text2 Write text string to file CloseFile file_handle Clos...

Page 84: ...file Format CloseFile file_handle Parameters file_handle File handle Example set file_handle 0 file_handle OpenFile D Log txt Opens file The previous contents are erased WriteString file_handle Some Text1 Write text string to file WriteString file_handle Some Text2 Write text string to file CloseFile file_handle Closes file ...

Page 85: ...ng Remarks If the file_handle parameter refers to a text file then a trailing End Of Line symbol is added to the text In case of binary files the End Of Line symbol is not added Example set file_handle 0 file_handle OpenFile D Log txt Opens text file The previous contents are erased WriteString file_handle Some Text1 Write text string to file WriteString file_handle Some Text2 Write text string to...

Page 86: ... for text files only if the value parameter is a string of text In that case it is equivalent to the WriteString function and the num_of_bytes parameter is ignored Example set BinFile 0 BinFile OpenFile C data bin 0 _FO_BINARY Write a string to the binary file Write BinFile All we need is love Write a substring All to the binary file Write BinFile All we need is love 3 val 0xBEEF Write BinFile val...

Page 87: ...gistered to open files with extension htm and the file handle passed to ShowInBrowser function belongs to a file with such an extension then this file is opened in the Internet Explorer Format ShowInBrowser file_handle Parameters file_handle File handle Example set html_file 0 html_file OpenFile D Log htm WriteString html_file html head title LOG title head WriteString html_file body WriteString h...

Page 88: ...LeCroy Corporation Verification Script Engine Reference Manual Page 88 of 107 19 Trace File Exporting Functions This group of functions covers VSE capabilities to export data into trace files ...

Page 89: ...n Values The handle to the trace file to be used in other trace file related functions Remarks If file_path contains just a file name such as test usb the trace file is created in the application folder Example set trace_handle 0 Create a trace file in C data_output usb trace_handle CreateTraceFile C data_output usb Add the current trace event frame to the trace file AddEventToTraceFile trace_hand...

Page 90: ...e file are ignored Format CloseTraceFile tracefile_handle Parameters tracefile_handle Trace File handle returned by the CreateTraceFile function Example set trace_handle 0 Create a trace file in C data_output usb trace_handle CreateTraceFile C data_output usb Add the current trace event frame to the trace file AddEventToTraceFile trace_handle CloseTraceFile trace_handle Close the file ...

Page 91: ...race File handle returned by the CreateTraceFile function Remarks If this function is called multiple times for the same event only the first call adds an event to the trace file All the other calls are ignored Example set trace_handle 0 Create a trace file in C data_output usb trace_handle CreateTraceFile C data_output usb Add the current trace event frame to the trace file AddEventToTraceFile tr...

Page 92: ...ath contains just a file name such as test usb VSE looks for a trace file with such a name in the application folder Example set trace_handle 0 Create a trace file in C data_output usb trace_handle CreateTraceFile C data_output usb Add the current trace event frame to the trace file AddEventToTraceFile trace_handle CloseTraceFile trace_handle Close the trace file Instruct the application to open t...

Page 93: ...st Parameters event_id Integer parameter representing event identifier param_list List of parameters to be sent to the client application Each parameter might be an integer string raw data byte chain or list Because the list itself may contain integers strings raw data or other lists it is possible to send very complicated messages Lists should be treated as arrays of VARIANTs Example if SomeCondi...

Page 94: ...f possible values in the table below title Optional String expression displayed in the title bar of the dialog box If title is omited the script name is placed in the title bar The type argument values are Constant Description _MB_OKONLY Display OK button only by Default _MB_OKCANCEL Display OK and Cancel buttons _MB_RETRYCANCEL Display Retry and Cancel buttons _MB_YESNO Display Yes and No buttons...

Page 95: ...on works only for VS Engines controlled via a GUI For VSEs controlled by COM Automation clients it does nothing This function locks the application which means that there is no access to other application features until the dialog box is closed To prevent too many MsgBox calls in case a script is not written correctly VSE keeps track of all function calls demanding user interaction and doesn t sho...

Page 96: ...ut is provided If default_text is omited the text box is displayed empty return_type Optional It specifies the contents of the return object The return_type argument values are Constant Value Description _IB_LIST 0 CSL list object is returned by Default _IB_STRING 1 String input as it was typed in the text box Return Values Depending on the return_type argument this function returns either a CSL l...

Page 97: ...cks the application which means that there is no access to other application features until the dialog box is closed To prevent too many InputBox calls in case a script is not written correctly VSE keeps track of all function calls demanding user interaction and does not show dialog boxes if some customizable limit is exceeded In that case it returns a null object Example if Something v InputBox E...

Page 98: ...mit of user dialogs allowed in the verification script If the script reaches this limit no user dialogs are shown and the script does not stop By default this limit is set to 20 Format GetUserDlgLimit Example result MsgBox Format UserDlgLimit d GetUserDlgLimit _MB_OKCANCEL _MB_EXCLAMATION Some Title SetUserDlgLimit 2 Set the limit to 2 ...

Page 99: ...t of user dialogs allowed in the verification script If the script reaches this limit no user dialogs are shown and the script does not stop By default this limit is set to 20 Format SetUserDlgLimit Example result MsgBox Format UserDlgLimit d GetUserDlgLimit _MB_OKCANCEL _MB_EXCLAMATION Some Title SetUserDlgLimit 2 Set the limit to 2 ...

Page 100: ...characters and field width modifiers are used to define the conversion specifications Format FormatEx format_string argument_list Parameters format_string Format control string argument_list Optional list of arguments to fill in the format string Return Values Formatted string Format conversion characters Code Type Output c Integer Character d Integer Signed decimal integer i Integer Signed decima...

Page 101: ...d i A space inserts a space before a positive signed integer This only works with the conversion characters d and i If both a space and a plus sign are used the space flag is ignored A hash mark prepends a 0 to an octal number when used with the conversion character o If is used with x or X it prepends 0x or 0X to a hexadecimal number A zero 0 pads the field with zeros instead of with spaces Field...

Page 102: ...llaneous Functions 23 1 ScriptForDisplayOnly Specifies that the script is designed for displaying information only and that its author doesn t care about the verification script result Such a script has a result DONE after execution Format ScriptForDisplayOnly Example ScriptForDisplayOnly ...

Page 103: ...o send any events to a script until the timestamp of the next event is greater than the timestamp of the current event plus a sleeping time Format Sleep time Parameters time VSE time object specifying sleep time Example Don t send any event that occurred during 1 ms from the current event Sleep Time 1000 ...

Page 104: ... carriage return symbols with br in a text string Format ConvertToHTML text_string Parameters text_string Text string Example str Hello world n str How are you today html_str ConvertToHTML str html_string Hello nbspworld nbsp br How nbspare nbspyou nbsptoday Note Some other useful miscellaneous functions can be found in the file VSTools inc ...

Page 105: ...otoEvent Jump to the trace view Pause Pause script execution Remark This function works only for a VS Engine controlled via a GUI For VSEs controlled by COM Automation clients it does nothing When script execution is paused the Run Verification Script window looks like Click this button to resume script running Click right mouse button and select Stop verification script s menu item to cancel scri...

Page 106: ...ng files File Description VSTools inc Main VSE file containing definitions of some useful VSE script functions provided by LeCroy must be included in every VS VS_constants inc File containing definitions of some important VSE global constants VSTemplate vs_ Template file for new verification scripts VSUser_globals inc File of user global variables and constants definitions put the definitions of c...

Page 107: ... Contract Call for technical support US and Canada 1 800 909 7112 Worldwide 1 408 653 1260 Fax your questions Worldwide 1 408 727 6622 Write a letter LeCroy Protocol Solutions Group Customer Support 3385 Scott Blvd Santa Clara CA 95054 3115 Send e mail psgsupport lecroy com Visit LeCroy s web site http www lecroy com ...

Reviews: