PDL
Programmable Driver Language (PDL) enables the development of drivers for specialized needs. The programmable driver module acts as a single driver programmable through PDL, a language specifically designed for writing drivers.
A PDL program usually consists of two main sections, which the user writes:
- The first section’s phrases specify the structure of messages that are transmitted and received through the device. These phrases make up the vocabulary that the driver uses to communicate with its counterpart.
- The second section is plain Tcl code, which defines the entry points that handle protocol-level read, write, and other operations. The Tcl section can incorporate extensions and Tcl code for regular functionality.
Tcl enables the user to write the driver’s program structure, and uses an existing language to define arbitrary protocols.
This section describes PDL version 1.2 and addresses the interface between the engine and the programmable driver module and the programmable driver module’s internal structure.
How Tcl interacts with the protocol driver (PD) runtime system
With a PDL driver, an operation such as reading or writing a complete message starts with an invocation to one of the Tcl entry-points.
Only one operation can be in progress at a time, although it might involve reading and writing several phrases.
This exclusivity is enforced by the driver’s state.
Flow of control
PDL driver flow of control is based on the processing of events generated by the device and system itself.
Because of the architecture of the thread system, the programmable driver returns control to the engine when performing a long-running I/O operation.
The Tcl fragments used to construct a PDL driver cannot maintain control across these I/O operations.