Teledyne-lecroy Voyager Exerciser Generation Script Language Manua Instrukcja Użytkownika Strona 130

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 167
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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'.
}
Przeglądanie stron 129
1 2 ... 125 126 127 128 129 130 131 132 133 134 135 ... 166 167

Komentarze do niniejszej Instrukcji

Brak uwag