LeCroy USB Protocol Suite Reference Manual

Verification script engine
Table of Contents

Advertisement

Quick Links

P
S
G
ROTOCOL
OLUTIONS
3385 S
B
COTT
LVD
S
C
, CA 95054
ANTA
LARA
Verification Script Engine
LeCroy USB Protocol Suite™
ROUP
Reference Manual
Manual Version 1.2
For USB Protocol Suite version 3.71
December 2009
for

Advertisement

Table of Contents
loading

Summary of Contents for LeCroy USB Protocol Suite

  • Page 1 ROTOCOL OLUTIONS ROUP 3385 S COTT , CA 95054 ANTA LARA Verification Script Engine LeCroy USB Protocol Suite™ Reference Manual Manual Version 1.2 For USB Protocol Suite version 3.71 December 2009...
  • Page 2 The information contained in this document has been carefully checked and is believed to be reliable. However, no responsibility can be assumed for inaccuracies that may not have been detected. LeCroy reserves 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.
  • Page 3: Table Of Contents

    LeCroy Corporation Verification Script Engine Reference Manual Contents INTRODUCTION ..............................6 VERIFICATION SCRIPT STRUCTURE ......................7 INTERACTION BETWEEN APPLICATION AND VERIFICATION SCRIPT ..........10 RUNNING VERIFICATION SCRIPTS FROM APPLICATION..............12 ......................14 UNNING ERIFICATION CRIPTS VSE GUI S ..........................16 ETTINGS VERIFICATION SCRIPT ENGINE INPUT CONTEXT MEMBERS............... 17 ..................
  • Page 4 LeCroy Corporation Verification Script Engine Reference Manual PACKET AND SCRIPT DECODED FIELDS RETRIEVING FUNCTIONS........... 55 ()........................55 ECODED IELD () ..........................56 IELD ()........................57 ECODED CRIPT IELD () .......................... 58 CRIPT IELD TIMER FUNCTIONS..........................59 10.1 VSE T ..........................59 BJECT 10.2...
  • Page 5 MISCELLANEOUS FUNCTIONS ......................102 23.1 ()........................102 CRIPT ISPLAY 23.2 () ............................... 103 LEEP 23.3 HTML() ..........................104 ONVERT 23.4 ()............................... 105 AUSE THE IMPORTANT VSE SCRIPT FILES ....................106 HOW TO CONTACT LECROY ........................... 107 Page 5 of 107...
  • Page 6: Introduction

    The VSE allows you to ask the application to send “events” (currently only frame-level events are available) that occur in the recorded trace to a verification script written using LeCroy script language. This script then evaluates the sequence of events (timing, data, or both) in accordance with user-defined conditions and performs post-processing tasks;...
  • Page 7: Verification Script Structure

    LeCroy Corporation Verification Script Engine Reference Manual Verification Script Structure Writing verification scripts is easy, if you understand how the application interacts with running scripts and if you follow some rules imposed by the verification script syntax. The main file with the text of the verification script must have extension .vse. It must be located in the subfolder ..\Scripts\VFScripts of the main folder.
  • Page 8 LeCroy Corporation Verification Script Engine Reference Manual ###################################################################################### Global Variables and Constants # Define your verification script-specific global variables and constant in this section. # (Optional) const MY_GLOBAL_CONSTANT = 10; set g_MyGlobalVariable = 0; OnStartScript() # Main intialization routine for setting up all necessary # script parameters before running the script.
  • Page 9 LeCroy Corporation Verification Script Engine Reference Manual ###################################################################################### ProcessEvent() # Main script function called by the application when the next waited event # occurs in the evaluated trace. # !!! REQUIRED !!! MUST BE IMPLEMENTED IN THE VERIFICATION SCRIPT ProcessEvent() # The function below shows the specified message only once, # no matter how many times ProcessEvent is called.
  • Page 10: Interaction Between Application And Verification Script

    LeCroy Corporation Verification Script Engine Reference Manual Interaction between Application and Verification Script The following steps describe the interaction between the application and a verification script run over a recorded trace: 1. Before sending any information to the script main processing function ProcessEvent() (which must be present in any verification script),VSE looks for function OnStartScript() and calls it if it is found.
  • Page 11 LeCroy Corporation Verification Script Engine Reference Manual Verification Script Application (Run verification script) Call.. OnStartScript() Starting VSE running … Call.. ProcessEvent() (If expected event ) Call.. ProcessEvent() (If expected event ) Call.. ProcessEvent() (If expected event ) Call.. ProcessEvent() (If expected event ) Data…...
  • Page 12: Running Verification Scripts From Application

    LeCroy Corporation Verification Script Engine Reference Manual 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 LeCroy Corporation Verification Script Engine Reference Manual The Run verification scripts dialog opens where you choose then run one or several verification scripts: Verification Script List. Verification Script description. Name for scripts are file names Descriptions for scripts are defined in without extension.
  • Page 14: Running Verification Scripts

    LeCroy Corporation Verification Script Engine Reference Manual 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 LeCroy Corporation Verification Script Engine Reference Manual Right-clicking the script list displays some additional operations over selected scripts: Run verification script(s): Start running selected script(s). Edit script: Edit selected scripts in the editor application specified in Editor settings. New script: Create a new script file using the template specified in Editor settings.
  • Page 16: Vse Gui Settings

    LeCroy Corporation Verification Script Engine Reference Manual VSE GUI Settings After choosing Settings, the following dialog appears: This option (if set) allows editor applications supporting multi-document interface (MDI) to edit all script files related to the selected scripts in one application instance.
  • Page 17: Verification Script Engine Input Context Members

    LeCroy Corporation Verification Script Engine Reference Manual Verification Script Engine Input Context Members All verification scripts have input contexts, special structures that can be used inside of the scripts. The application fills their members. The verification script input contexts have two sets of members: •...
  • Page 18: Trace Event-Dependent Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual Trace Event-dependent Set of Members This set of members is defined and can be used only for a specific event or after calling functions that provide values of variables: 5.2.1 USB Packet-specific Set of Members Members of this set are valid for all USB packet events: in.RawPacket: Bit source of the whole packet.
  • Page 19: Usb Bus Condition-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.1 USB Bus Condition-specific Set of Members Note: Valid for Bus Condition trace events only, undefined for other events. In.BusCondition: Type of Bus Condition events. The table below describes the current list of possible Bus Condition events and values of in.BusCondition: Bus Condition in.BusCondition...
  • Page 20: Usb2 Packet-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.2 USB2 Packet-specific Set of Members Note: Valid for USB2 packets only, undefined for other events. The following input context members apply to most of the USB2 packets. In.Pid: Packet Identifier value for the packet. It is the full PID value, the following constants are defined in the VS_constants.inc include file and can be used by scripts:...
  • Page 21 LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.2.1 USB2 Token Packet Members in.Addr: Value of the Address (ADDR) field of the Token packet. In.Endp: Value of the Endpoint (ENDP) field of the Token packet. 5.2.1.2.2 USB2 Start Of Frame Packet Members in.FrmNum: Frame number for the current USB2 frame.
  • Page 22 LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.2.5 Link Power Management Extended Token Members Value of the Host Initiated Resume Duration field. in.HIRD: Value of the bLinkState field for the LPM extended token. In.bLinkState: Value of the bRemoteWake bit for the LPM extended token.
  • Page 23: Usb3 Packet-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.3 USB3 Packet-specific Set of Members Note 1: Valid for USB3 packets only, undefined for other events. Note 2: The system does not pass all possible fields of USB3 packets as members of Input Context. If a script...
  • Page 24 LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.3.6 SKIP Packet Members Count of symbols in the SKIP sequence in.Count: 5.2.1.3.7 Logical Idle Packet Members Count of symbols in the Logical Idle sequence in.Count: 5.2.1.3.8 Link Management Packet Members SubType value for LMP. Use constant definitions in VS_constants.inc.
  • Page 25 Value of CRC32 protecting the payload for this Data Packet in.CRC32: Note: In USB Protocol Suite software versions earlier than 3.71 (namely, 3.60 and 3.70), Data Packet Header and Data Packet Payload were two separate packet types with input context members split accordingly between them.
  • Page 26 LeCroy Corporation Verification Script Engine Reference Manual 5.2.1.3.12 Getting Values of the Fields not present in Input Context As mentioned earlier, not all the possible fields of USB3 packets are passed as members of Input Context. The following are examples of using...
  • Page 27 LeCroy Corporation Verification Script Engine Reference Manual # Hex Value val = GetHexPktField ( “NumP” ); str = FormatEx( “\tNumP(hex) = 0x%X\n”, val ); ReportText( str ); if( in.TraceEvent == _USB3_DP_PKT ) # Example of using decoded packet information for DPs.
  • Page 28: Transaction-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.2 Transaction-specific Set of Members in.TraToken: Token PID for the transaction. Possible values are: const PID_OUT = 0x87; const PID_IN = 0x96; const PID_SETUP = 0xB4; const PID_SPLIT = 0x1E; const PID_PING = 0x2D;...
  • Page 29 LeCroy Corporation Verification Script Engine Reference Manual in.Split: Signals that the transaction is a start-split or complete-split. 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.
  • Page 30: Split Transaction-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.3 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: Indicates that this split transaction was halted.
  • Page 31: Transfer-Specific Set Of Members

    LeCroy Corporation Verification Script Engine Reference Manual 5.2.4 Transfer-specific Set of Members in.XferType: Type of transfer. Repeats the trace event value for the transfer. In.Addr: Device Address value for this USB transfer. In.Endp: Device Endpoint Number value for this USB transfer.
  • Page 32: Verification Script Engine Output Context Members

    LeCroy Corporation Verification Script Engine Reference Manual Verification Script Engine Output Context Members All verification scripts have output contexts, special structures that can be used inside of the application. The scripts fill their members. The verification script output contexts have only one member: out.Result: Result of the whole verification program defined in the verification script.
  • Page 33: Verification Script Engine Events

    LeCroy Corporation Verification Script Engine Reference Manual Verification Script Engine Events VSE defines a large group of trace “events” that can be passed to a verification script for evaluating, retrieving, and displaying some contained information. The information about the type of event can be seen in the in.TraceEvent...
  • Page 34: Packet Level Events

    LeCroy Corporation Verification Script Engine Reference Manual Packet Level Events The table below describes the current list of packet level (lowest level of transactions) events and values (application-defined constants) for in.TraceEvent: Types of packets in.TraceEvent USB2 packet events All USB2 packet events...
  • Page 35: Transaction Level Events

    LeCroy Corporation Verification Script Engine Reference Manual Transaction Level Events The table below describes the current list of transaction level events and values (application-defined constants) for in.TraceEvent: Types of transactions in.TraceEvent Setup transactions _T_SETUP In transactions _T_IN Out transactions _T_OUT...
  • Page 36: Sending Functions

    LeCroy Corporation Verification Script Engine Reference Manual Sending Functions This topic contains information about the special group of VSE functions that specify the events the verification script should expect to receive. SendLevel() This function specifies that events of specified transaction level should be sent to the script.
  • Page 37: Sendlevelonly()

    LeCroy Corporation Verification Script Engine Reference Manual SendLevelOnly() This function 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. Format: SendLevelOnly(level) Parameters: level...
  • Page 38: Dontsendlevel()

    LeCroy Corporation Verification Script Engine Reference Manual DontSendLevel() This function 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. Format: DontSendLevel(level) Parameters: level...
  • Page 39: Sendchannel()

    LeCroy Corporation Verification Script Engine Reference Manual SendChannel() This function specifies that events on the specified channel should be sent to the script. Format: SendChannel(channel) Parameters: channel Can be one of following values: _USB2: USB2 traffic (value = 1) _USB3_RX:...
  • Page 40: Sendchannelonly()

    LeCroy Corporation Verification Script Engine Reference Manual SendChannelOnly() This function specifies that ONLY events occuring on a specified channel should be sent to the script. Format: SendChannelOnly(channel) Parameters: channel Can be one of following values: _USB2: USB2 traffic (value = 1)
  • Page 41: Dontsendchannel()

    LeCroy Corporation Verification Script Engine Reference Manual DontSendChannel() This function specifies that events occuring on a specified channel should NOT be sent to the script. Format: DontSendChannel (channel) Parameters: channel Can be one of following values: _USB2: USB2 traffic (value = 1)
  • Page 42: Sendallchannels()

    LeCroy Corporation Verification Script Engine Reference Manual 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 42 of 107...
  • Page 43: Sendtraceevent()

    LeCroy Corporation Verification Script Engine Reference Manual SendTraceEvent() This function specifies the events to be sent 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: …...
  • Page 44: Dontsendtraceevent()

    LeCroy Corporation Verification Script Engine Reference Manual DontSendTraceEvent() This function specifies that the event specified in this function should not be sent to a script. Format: DontSendTraceEvent (event) Parameters: event SendTraceEvent() for all possible values. Example: … SendTraceEvent(_PACKET); # Send all packets.
  • Page 45: Sendtraceeventonly()

    LeCroy Corporation Verification Script Engine Reference Manual 8.10 SendTraceEventOnly() This function specifies that ONLY the event specified in this function is sent to the script. Format: SendTraceEventOnly(event) Parameters: event 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.
  • Page 46: Sendalltraceevents()

    LeCroy Corporation Verification Script Engine Reference Manual 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: Senddirection()

    LeCroy Corporation Verification Script Engine Reference Manual 8.12 SendDirection() This function specifies more precise tuning for sending events only for a specified direction of the link. Format: SendDirection (direction) Parameters: direction Can have one of the following values: Primitive Values...
  • Page 48: Sendusb2Busconditions()

    LeCroy Corporation Verification Script Engine Reference Manual 8.13 SendUsb2BusConditions() This function specifies more precise tuning for USB2 Bus Condition events. Only selected bus condition events are sent. Format: SendUsb2BusConditions (condition) Parameters: condition Specifies bus condition. This parameter can have one of the following values:...
  • Page 49: Sendusb2Tokenpackets()

    LeCroy Corporation Verification Script Engine Reference Manual 8.14 SendUsb2TokenPackets() This function specifies more precise tuning for USB2 Token packets. Format: SendUsb2TokenPackets (pid, address, endpoint) Parameters: Specifies that only Token packets with the specified PID value are sent. The value _ANY means any PID is accepted.
  • Page 50: Sendusb2Datapackets ()

    LeCroy Corporation Verification Script Engine Reference Manual 8.15 SendUsb2DataPackets () This function specifies more precise tuning for Data packets. Format: SendUsb2DataPackets(pid) Parameters: Specifies that only Data packets with the specified data PID are sent. The value _ANY means any data packet is accepted.
  • Page 51: Sendusb2Hskpackets()

    LeCroy Corporation Verification Script Engine Reference Manual 8.16 SendUsb2HskPackets() This function specifies more precise tuning for Handshake packets. Format: SendUsb2HskPackets(pid) Parameters: Specifies that only Data packets with the specified data PID are sent. The value _ANY means any data packet is accepted.
  • Page 52: Sendtransaction()

    LeCroy Corporation Verification Script Engine Reference Manual 8.17 SendTransaction() This function works on the Transaction level and allows specifying more precise tuning for the transaction events that are sent to the script. Format: SendTransaction(tra_type, xfer_type, address, endpoint, completion_flag, only_with_errors) Parameters:...
  • Page 53: Sendtransfer()

    LeCroy Corporation Verification Script Engine Reference Manual 8.18 SendTransfer() This function works on the Transfer level and allows specifying more precise tuning for the transfer events that are sent to the script. Format: SendTransfer(xfer_type, address, endpoint, completed, only_with_errors) Parameters: xfer_type...
  • Page 54: Sendpktswithbadcrc()

    LeCroy Corporation Verification Script Engine Reference Manual 8.19 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...
  • Page 55: Packet And Script Decoded Fields Retrieving Functions

    CATC Script Language (CSL) at Transfer level and all decoded fields at Packet level for USB3 packets. 9.1 GetDecodedPktField() Extracts information about a USB3 packet field and determines how it is shown in the USB Protocol Suite trace view or the "View … Fields" dialog.
  • Page 56: Gethexpktfield()

    LeCroy Corporation Verification Script Engine Reference Manual 9.2 GetHexPktField() Extracts the raw hexadecimal value of the USB3 packet field. Format : GetHexPktField ( 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 function returns the hex value of the decoded field: integer value if field length is less than 32 bits raw binary value if field length is greater than 32 bits.
  • Page 57: Getdecodedscriptfield()

    LeCroy Corporation Verification Script Engine Reference Manual 9.3 GetDecodedScriptField() Extracts information about the script decoded field and determines how it is shown in the USB Protocol Suite trace view or the “View … Fields” dialog. Format : GetDecodedScriptField ( fld_name )
  • Page 58: Gethexscriptfield()

    LeCroy Corporation Verification Script Engine Reference Manual 9.4 GetHexScriptField() Extracts the raw hexadecimal value of the script decoded field. Format : GetHexScriptField ( fld_name ) Parameters fld_name Name of the field supposedly existing in the current Transfer Return Values If the field name is in the current Transfer, the function returns the hex value of the decoded field: integer value if field length is less than 32 bits raw binary value if field length is greater than 32 bits.
  • Page 59: Timer Functions

    LeCroy Corporation Verification Script Engine Reference Manual 10 Timer Functions This group of functions covers VSE capability to work with 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”...
  • Page 60: Settimer()

    LeCroy Corporation Verification Script Engine Reference Manual 10.2 SetTimer() Starts a timing calculation from the event at which this function was called. Format: SendTimer(timer_id = 0) Parameters: timer_id Unique timer identifier. Example: SetTimer(); # Start timing for timer with id = 0.
  • Page 61: Killtimer()

    LeCroy Corporation Verification Script Engine Reference Manual 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.
  • Page 62: Gettimertime()

    LeCroy Corporation Verification Script Engine Reference Manual 10.4 GetTimerTime() Retrieves a timing interval from the specific 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.
  • Page 63: Time Construction Functions

    LeCroy Corporation Verification Script Engine Reference Manual 11 Time Construction Functions This group of functions is used to construct VSE time objects. 11.1 Time() Constructs a verification script time object. Format: Time(nanoseconds) Time(seconds, nanoseconds) Parameters: nanoseconds Number of nanoseconds in specified time...
  • Page 64: Time Calculation Functions

    LeCroy Corporation Verification Script Engine Reference Manual 12 Time Calculation Functions This group of functions covers VSE capability to work with “time”, the VSE time objects. 12.1 AddTime() Adds two VSE time objects. Format: AddTime(time1, time2) Parameters: time_1 VSE time object representing the first time interval...
  • Page 65: Subtracttime()

    LeCroy Corporation Verification Script Engine Reference Manual 12.2 SubtractTime() Subtracts two VSE time objects. Format: SubtractTime (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);...
  • Page 66: Multimebyint()

    LeCroy Corporation Verification Script Engine Reference Manual 12.3 MulTimeByInt() Multiplies 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: = Time(2, 200);...
  • Page 67: Divtimebyint()

    LeCroy Corporation Verification Script Engine Reference Manual 12.4 DivTimeByInt() Divides a VSE time object by an integer value. Format: DivTimeByInt (time, div) Parameters: time VSE time object Divider, integer value Return values: Returns a VSE time object representing time interval equal to time / div.
  • Page 68: Time Logical Functions

    LeCroy Corporation Verification Script Engine Reference Manual 13 Time Logical Functions This group of functions covers VSE capability to compare VSE time objects. 13.1 IsEqualTime() Verifies that one VSE time object is equal to another VSE time object. Format: IsEqualTime (time1, time2)
  • Page 69: Islesstime()

    LeCroy Corporation Verification Script Engine Reference Manual 13.2 IsLessTime() Verifies that one VSE time object is 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...
  • Page 70: Isgreatertime()

    LeCroy Corporation Verification Script Engine Reference Manual 13.3 IsGreaterTime() Verifies that one VSE time object is greater 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...
  • Page 71: Istimeininterval()

    LeCroy Corporation Verification Script Engine Reference Manual 13.4 IsTimeInInterval() Verifies that a VSE time object is greater than a minimum VSE time object and less than a maximum VSE time object. Format: IsTimeInInterval(min_time, time, max_time) Parameters: min_time VSE time object representing a minimum interval...
  • Page 72: Time Text Functions

    LeCroy Corporation Verification Script Engine Reference Manual 14 Time Text Functions This group of functions 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...
  • Page 73: Output Functions

    LeCroy Corporation Verification Script Engine Reference Manual 15 Output Functions This group of functions covers VSE capability to present information in the output window. 15.1 ReportText() Outputs text in the output window related to the verification script. Format: ReportText (text)
  • Page 74: Enableoutput()

    LeCroy Corporation Verification Script Engine Reference Manual 15.2 EnableOutput() Enables showing information in the output window and sending COM reporting notifications to COM clients. Format: EnableOutput () Example: EnableOutput (); Page 74 of 107...
  • Page 75: Disableoutput()

    LeCroy Corporation Verification Script Engine Reference Manual 15.3 DisableOutput() Disables showing information in the output window and sending COM reporting notifications to COM clients. Format: DisableOutput () Example: DisableOutput (); Page 75 of 107...
  • Page 76: Information Functions

    LeCroy Corporation Verification Script Engine Reference Manual 16 Information Functions 16.1 GetTraceName() This function returns the filename of the trace file being 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.
  • Page 77: Getscriptname()

    LeCroy Corporation Verification Script Engine Reference Manual 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 77 of 107...
  • Page 78: Getapplicationfolder()

    LeCroy Corporation Verification Script Engine Reference Manual 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 78 of 107...
  • Page 79: Getcurrenttime()

    LeCroy Corporation Verification Script Engine Reference Manual 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 79 of 107...
  • Page 80: Navigation Functions

    LeCroy Corporation Verification Script Engine Reference Manual 17 Navigation Functions 17.1 GotoEvent() This function forces the application to jump to some trace event and shows it in the main trace view. Format: GotoEvent(level, index) GotoEvent() Parameters: level Transaction level of the event to jump...
  • Page 81: Setmarker()

    LeCroy Corporation Verification Script Engine Reference Manual 17.2 SetMarker() This function sets a marker for some trace event. Format: SetMarker(marker_text) SetMarker(marker_text, level, index) Parameters: marker_text Text of the marker level Transaction level of the event to jump index Transaction index of the event to jump...
  • Page 82: File Functions

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

    LeCroy Corporation Verification Script Engine Reference Manual 18.1 OpenFile() This function opens a file for writing. Format: OpenFile(file_path, append, mode) Parameters: file_path Full path to the file to open. (For ‘\’ use ‘\\’) append This parameter (if present and not equal to 0) specifies that VSE should append the following write operations to the contents of the file;...
  • Page 84: Closefile()

    LeCroy Corporation Verification Script Engine Reference Manual 18.2 CloseFile() This function closes an opened 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.
  • Page 85: Writestring()

    LeCroy Corporation Verification Script Engine Reference Manual 18.3 WriteString() This function writes a text string to the file. Format: WriteString(file_handle, text_string) Parameters: file_handle File “handle” text_string Text string 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.
  • Page 86: Write()

    LeCroy Corporation Verification Script Engine Reference Manual 18.4 Write() This function writes data to the file. Format: Write(file_handle, value, num_of_bytes) Parameters: file_handle "handle" to the file previously opened by OpenFile() value Data to write num_of_bytes Optional parameter specifying how many bytes to take from the...
  • Page 87: Showinbrowser()

    LeCroy Corporation Verification Script Engine Reference Manual 18.5 ShowInBrowser() This function opens a file in the Windows Explorer. If the extension of the file has the application registered to open files with such extensions, it is launched. For instance, if Internet Explorer is registered to open files with extension .htm and the file handle passed to ShowInBrowser() function...
  • Page 88: Trace File Exporting Functions

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

    LeCroy Corporation Verification Script Engine Reference Manual 19.1 CreateTraceFile() This function creates a trace file. Format: CreateTraceFile( file_path ) Parameters: ‘\’ ‘\\’ file_path Full path to the trace file to be created. (For Return Values: The “handle” to the trace file to be used in other trace-file-related functions.
  • Page 90: Closetracefile()

    LeCroy Corporation Verification Script Engine Reference Manual 19.2 CloseTraceFile() This function closes an open trace file. All attempts to add trace data to a closed trace file are ignored. Format: CloseTraceFile( tracefile_handle ) Parameters: tracefile_handle Trace File “handle” returned by the CreateTraceFile() function.
  • Page 91: Addeventtotracefile()

    LeCroy Corporation Verification Script Engine Reference Manual 19.3 AddEventToTraceFile() This function adds the current trace event (such as frames) to the trace file. Format: AddEventToTraceFile ( tracefile_handle ) Parameters: tracefile_handle Trace 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.
  • Page 92: Opentracefile()

    LeCroy Corporation Verification Script Engine Reference Manual 19.4 OpenTraceFile() This function opens a trace file in the application. Format: OpenTraceFile (tracefile_path) Parameters: tracefile_path Path to a trace file to open. Remarks: If tracefile_path contains just a file name (such as test.usb), VSE looks for a trace file with such a name in the application folder.
  • Page 93: Com/Automation Communication Functions

    LeCroy Corporation Verification Script Engine Reference Manual 20 COM/Automation Communication Functions This group of functions covers VSE capabilities to communicate with COM/Automation™ clients connected to the application. (See the Automation Manual for details about how to connect to the application and VSE.) 20.1 NotifyClient()
  • Page 94: User Input Functions

    LeCroy Corporation Verification Script Engine Reference Manual 21 User Input Functions 21.1 MsgBox() Displays a message in a dialog box, waits for the user to click a button, and returns an Integer indicating which button the user clicked. Format: MsgBox(prompt, type, title)
  • Page 95 LeCroy Corporation Verification Script Engine Reference Manual Return Values: This function returns an integer value indicating which button was clicked. Constant Description _MB_OK OK button was clicked. _MB_CANCEL Cancel button was clicked. _MB_YES Yes button was clicked. _MB_NO No button was clicked.
  • Page 96: Inputbox()

    LeCroy Corporation Verification Script Engine Reference Manual 21.2 InputBox() Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns a CSL list object or string containing the contents of the text box.
  • Page 97 LeCroy Corporation Verification Script Engine Reference Manual Note: Although the dialog box input text parser tries to determine a type of list item automatically, text enclosed in quote signs " " is always considered to be a string. Remark: This function works only for VS Engines controlled via a GUI. For VSEs controlled by COM/Automation™ clients, it does nothing.
  • Page 98: Getuserdlglimit()

    LeCroy Corporation Verification Script Engine Reference Manual 21.3 GetUserDlgLimit() This function returns the current limit 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.
  • Page 99: Setuserdlglimit()

    LeCroy Corporation Verification Script Engine Reference Manual 21.4 SetUserDlgLimit() This function sets the current limit 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.
  • Page 100: String Manipulation/Formating Functions

    LeCroy Corporation Verification Script Engine Reference Manual 22 String Manipulation/Formating Functions 22.1 FormatEx() Writes formatted data to a string. Format is used to control the way that arguments print out. The format string may contain conversion specifications that affect the way in which the arguments in the value string are returned.
  • Page 101 LeCroy Corporation Verification Script Engine Reference Manual Remarks: A conversion specification begins with a percent sign (%) and ends with a conversion character. The following optional items can be included, in order, between the % and the conversion character to further control argument formatting.
  • Page 102: Miscellaneous Functions

    LeCroy Corporation Verification Script Engine Reference Manual 23 Miscellaneous 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.
  • Page 103: Sleep()

    LeCroy Corporation Verification Script Engine Reference Manual 23.2 Sleep() Asks VSE not to 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:...
  • Page 104: Converttohtml()

    LeCroy Corporation Verification Script Engine Reference Manual 23.3 ConvertToHTML() This function replaces spaces with “&nbsp” and 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?”;...
  • Page 105: Pause()

    LeCroy Corporation Verification Script Engine Reference Manual 23.4 Pause() Pauses script running. Later, script execution can be resumed or cancelled. Format: Pause() Example: … If(Something_Interesting()) GotoEvent(); # 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™...
  • Page 106: The Important Vse Script 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 Template file for new verification scripts VSTemplate.vs_ VSUser_globals.inc...
  • Page 107: How To Contact Lecroy

    LeCroy Corporation Verification Script Engine Reference Manual How to Contact LeCroy Type of Service 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 …...

Table of Contents