Teledyne-lecroy Voyager Exerciser Generation Script Language Manua Manual de usuario Pagina 130

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 167
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 129
Teledyne LeCroy Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
121
10.19.3 Nested Calls Using Global Variables
You can call another generation procedure inside a generation procedure. This is called
"nested calls". During such calls, the current values of global variables are used when the called
generation procedure is parsed.
Example
z = 18
SOME_PKT_TEMPLATE $Z # Declare a global structure variable 'Z'
# based on the template 'SOME_PKT_TEMPLATE'.
Main
{
$Y = SOME_PKT_TEMPLATE # Declare a local structure variable 'Y'
{
Field0 = z + 12 # Use a global variable 'z'.
}
z++ # Increment the global variable 'z'.
Send Y # Send packet based on the local structure variable 'Y'.
Call Block1( $Y, 12, 10 ) # Call 'Block1'.
}
Block1( SOME_PKT_TEMPLATE $p, x, y )
{
$p # Change the local structure variable 'p'.
{
Field0 = 2*(x + y) + z # Use local variables 'x', 'y' and global
# variable 'z' here.
}
Send Z # Send packet based on the global variable 'Z'.
$Z # Change the global structure variable 'Z'.
{
Field0 = 0x0000BEEF
}
$Z[0, 4] = 0xA # Change the 4 bits of structure variable 'Z'
# at offset 0 bits.
Call Block2( $p ) # Call 'Block2'.
}
Block2( SOME_PKT_TEMPLATE $p )
{
Send p # Send packet based on the local structure variable 'p'.
Send Z # Send packet based on the global structure variable 'Z'.
}
Vista de pagina 129
1 2 ... 125 126 127 128 129 130 131 132 133 134 135 ... 166 167

Comentarios a estos manuales

Sin comentarios