7 tlp field or payload substitution – Teledyne LeCroy PETrainer Scripting Language Reference Manual User Manual
Page 22

Teledyne LeCroy
PETrainer Scripting Language
17
3.1.7 TLP Field or Payload Substitution
(For Summit Z2-16 and Summit Z3-16 Trainers only)
When the Summit Z2-16 and Summit Z3-16 Trainers Are Emulating a PCI Express™ Endpoint
Device
When you use the Summit Z2-16 and Summit Z3-16 Trainers to emulate a PCI Express Endpoint
Device, you must enable automatic handling of the device Configuration space.
You can also enable automatic handling of Memory and IO spaces. If you enable automatic handling of
Memory and IO spaces, and you perform BAR setup for the initial device Configuration Space image, you
can enable up to three memory spaces (Mem64, Mem32 A, and Mem32 B) and up to two IO spaces
(IO A and IO B). The enabled address spaces have a corresponding data image in the internal memory of
the -16 and Summit Z3-16 Trainers. Whatever the system writes into those spaces over PCI Express can
be read back over PCI Express.
For the Summit Z2-16 and Summit Z3-16 Trainers only, the PETrainer script language provides
extensions that allow data written into Configuration, Memory, or IO spaces to modify behavior of the
running script. If the script specifies values of specific fields and/or Payload in the TLPs for transmission,
you can define that the system use the value from a location in a Configuration, Memory, or IO space of
the device that the Summit Z2-16 and Summit Z3-16 Trainers are emulating.
Field payload substitution allows modifying the behavior of running scripts. When a script that has
substitution definitions is running, a test scenario can write new values to specific locations in
Configuration, Memory, or IO spaces. Subsequent TLPs transmitted by the script use the updated values
of the corresponding fields and/or Payload.
A substitution definition has the following format:
...
FieldName = ( address_space_designation, [address_space_offset], [SwapBytes])
...
The address_space_designation parameter specifies the address space from which to take the value
for the field. The defined address-space-ID keywords are:
o
FROM_CFG
o
FROM_MEM64
o
FROM_MEM32_A
o
FROM_MEM32_B
o
FROM_IO_A
o
FROM_IO_B
The address_space_offset parameter is optional. It defines the byte offset into the address space for the
location from which to take the substitution value. If you omit this parameter, the offset is zero and the
system takes the value from the beginning of the specified address space.
The SwapBytes parameter, when present, specifies that the PETrainer Z3 should swap the Endian order
of the bytes in a 2-byte or 4-byte field before copying it into the specified field of the TLP to transmit.
Some example field name substitution definitions are: