Top Up Prev Next Bottom Contents Index Search

13.5 Interface Issues

In Ptolemy 0.6 and later, we have developed a framework for interfacing code generation targets with other targets (simulation or code generation). In this section we will detail how to support this new framework for a code generation target. To learn how to develop applications within Ptolemy that use multiple targets that support this new framework, refer to the Interface Issues section in the User's Manual - CG Domain chapter.

As with Wormholes, we have developed a way to interface N targets without requiring N2 specialized interfaces. We do this by generating a customized interface (analogous to the universal EventHorizon in wormholes) that is automatically built by using communication stars supplied by each code generation target. This interface is generated in C (using the CGC domain) and runs on the Ptolemy host workstation.

To support this infrastructure, a target writer needs to define two pairs of communication stars and add target methods which return each of these pairs. The framework will then build the interface by splicing in these stars as is shown in figure 13-1. These same actors are used when constructing an interface to a Ptolemy simulation target as shown in figure 13-2.

These communication stars, described in section 13.4.2, are a specialized form of send/receive stars. In addition to the previous assumptions in section 13.4.2, send/receive for this infrastructure must also define C code to control the target for operations such as downloading, initializing and (if applicable) terminating the generated executable.

One pair of communication stars must communicate from the target to the CGC code that will run on the Ptolemy host workstation. The other pair must communicate in the opposite direction. The CGC send/receive stars are typically defined from a common base communication star specific for each target. This common base defines the C code to control a target that was discussed in the previous paragraphs. Examples of send/receive stars that support this infrastructure can be found in:

For the S56XTarget (Ariel S-56X DSP card):

$PTOLEMY/src/domains/cg56/targets/CGCXBase.pl
$PTOLEMY/src/domains/cg56/targets/CGCXSend.pl
$PTOLEMY/src/domains/cg56/targets/CGCXReceive.pl
$PTOLEMY/src/domains/cg56/targets/CG56XCSend.pl
$PTOLEMY/src/domains/cg56/targets/CG56XCReceive.pl
For the SimVSSTarget (Synopsis VSS Simulator):

$PTOLEMY/src/domains/vhdl/targets/CGCVSynchComm.pl
$PTOLEMY/src/domains/vhdl/targets/CGCVSend.pl
$PTOLEMY/src/domains/vhdl/targets/CGCVReceive.pl
$PTOLEMY/src/domains/vhdl/targets/VHDLCSend.pl
$PTOLEMY/src/domains/vhdl/targets/VHDLCReceive.pl
After defining both pairs of communication stars, methods to instantiate these stars must be defined in the target:

CommPair fromCGC(PortHole&);
CommPair toCGC(PortHole&);
A CommPair is a communication pair, where one of the communication stars in a CGC star. The S56XTarget::fromCGC method, illustrates the typical code needed for these methods:

CommPair S56XTarget::fromCGC(PortHole&) {
CommPair pair(new CGCXSend,new CG56XCReceive);
configureCommPair(pair);
return pair;
}
The configureCommPair function is defined in the S56XTarget.cc file and configures the S56XTarget communication stars.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.