In the case of ocpn, the oc source file must be produced by the automatic parallelizer ocrep. Starting from a centralized oc program and distribution specifications, ocrep automatically produces one oc file for each location specified in the distribution. Each of these files contains special procedure calls that allow communication between the oc programs. Communications take place through a fully connected network of FIFO channels. Sending a value to a FIFO channel is never blocking, while receiving a value is blocking. The ocrep tools insures that the parallel program produced never deadlocks and runs in bounded memory. In particular, the FIFO queues are bounded. Finally, the name of each oc file also indicates how many locations are in the distribution, and what is the number of the current location. For instance, in pingpong.2.0.oc, the 2 indicates that there are 2 locations, and the 0 indicates that the current file contains the program of the first location.
The usage is:
ocpn pingpong.2.0.ocThis command produces a PNpingpong_2_0.pl file that contains the code of the Ptolemy star that implements the oc automaton pingpong.2.0.oc.
ptlang PNpingpong_2_0_plproduces the three files: PNpingpong_2_0.cc, PNpingpong_2_0.h, and PNpingpong_2_0.htm. All the files must be placed in the directory $PTOLEMY/src/domains/pn/stars.
For the communications to take place in the Ptolemy PN domain, the file PutGetParticle.h must also be placed in the same directory. This file implements the subclass PutGetParticle of the class Message.
Each star has the following inputs and outputs:
The problem of interfacing a synchronous program with its environment
is known as the synchronous/asynchronous interface. Indeed, the
environment is intrinsically asynchronous. Since the synchronous
controller is parallel, this means that one part of the controller can
be receiving inputs while at the same time the other part receives
nothing. To reflect this behavior, we provide two stars.
The star SDFTkEntry2.pl is an homogeneous SDF actor. It
pops up a Tk window with one entry and two buttons, as shown below:
Each time one of the two buttons is pressed, the star fires and produces the following tokens on its outputs:
The star PNWhen.pl is a PN actor. It implements the
when operator of the Lustre
synchronous language. Its behavior is the following. Here, "bot" means
that no token is produced:
|X when C||bot||x1||bot||x3||bot||bot||x6||x7|
|-h||Print the help message with the usage and the options.|
|-version||Print the version name on the standard error output stream and terminate ignoring all other arguments.|
|-info||Print various informations about the processor compilation on the standard error output stream and terminate, ignoring all other arguments.|
|-ext||Allow external types, procedures, and functions in the source oc code. However, put and get procedures involving external types are not supported.|