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

Verification Script Structure

Writing verification scripts is easy, if you understand how the application interacts with running scripts and if you follow 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. 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 verification script operation...    #
set DecoderDesc = "<Your Verification Script description>"; # Optional
#
# Include main Verification Script Engine definitions.
#
%include  "VSTools.inc" 		 # Should be set for all verification scripts.
######################################################################################
#                            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.                                       #
#                                                                                    #
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 Functions’.                                          #
  #                                                                                    #
  # OPTIONAL.                                                                         #
  ######################################################################################

  # Uncomment the line below if you want to disable output from
  # ReportText()-functions.
  #
  # DisableOutput();
}

######################################################################################
#   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()
{
  # 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 script functions.                                                     #
#                                                                                    #
# Write your own script-specific functions here.                                     #
#                                                                                    #
MyFunction(arg)
{
  if(arg == "Blah") return 1;
  return 0;
}