Hapter, Odules, Module functions – Teledyne LeCroy CATC Scripting Language Reference Manual User Manual

Page 54

Advertising
background image

C

HAPTER

13

Modules

CATC Scripting Language

50

C

HAPTER

13: M

ODULES

Modules are a collection of functions and global data dedicated to decoding a
certain type of transaction. Each module consists of one primary file (.dec), and
possibly several included files (.inc).

Module Functions

Three functions are used as entry-points into a decoding module. They are called
by the application and are used both in the initial transaction decoding phase, and
each time that a transaction needs to be displayed.

ProcessData()

Called repeatedly with input contexts representing transactions of the specified
input types. Decides if input transaction is a member of this transaction, or if it
begins a new transaction. This function will be called first using incomplete output
transactions. If the input transaction is not accepted into any of the pending trans-
actions, it will be called with an empty output transaction to see if it starts a new
transaction.

CollectData()

Called with each input transaction that was previously accepted by the function
ProcessData

. Generates all output context data that would be required for input

into a higher level transaction.

BuildCellList()

Called with the output context generated by the call to CollectData, and no
input context. This function is responsible for adding display cells based on the data
collected by CollectData.

Note that there is some flexibility in the use of these functions. For example, if it is
easier for a particular protocol to build cells in CollectData, cells could be
generated there, and BuildCellList could be left empty. Another approach
would be to have ProcessData do everything (generate output data, and build
cell lists) and then implement CollectData as a pass-thru to ProcessData.
This will be less efficient in the decoding phase but may reduce some repetition of
code. These decisions are dependent on the protocol to be decoded.

Advertising