Teledyne-lecroy Voyager Exerciser Generation Script Language Manua Bedienungsanleitung Seite 118

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 167
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 117
Teledyne LeCroy Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
109
10.11 Sizeof Operators
Several kinds of sizeof operators are currently supported:
fld_size (field_name): Returns the length of the field in bits.
pkt_size (template): Returns the length of the template payload in bits.
pkt_size ($pkt_var_name): Returns the length of the structure variable payload in bits.
pttn_size (data_pattern): Returns the length of the data pattern payload in bits.
Note: Fields that are not initialized with a variable length (declared as f : *) have 0 length.
Examples
Main
{
# Examples of using 'sizeof' operators.
# Declare a 'structure' instance based on the template S1.
$S = S1
# Declare a 'structure' instance based on the template S2,
# changing the default value for the S16 field.
$W = S2 { S16 = 2 }
Send TX_PACKET
{
# Set the Len to the size of
# combined payload + the size of the 'Len' field.
Len = ( fld_size( Len ) + pkt_size( $S ) + pkt_size( $W ) ) / 8
# Same as the previous assignment.
Len = ( fld_size( Len ) + pkt_size( S1 ) + pkt_size( S2 ) ) / 8
# Data field contains combined payload of structures S and W.
Data = $S + $W
}
}
Seitenansicht 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 166 167

Kommentare zu diesen Handbüchern

Keine Kommentare