Top Up Prev Next Bottom Contents Index Search

17.1 Introduction

One of Ptolemy's strengths is the ability to combine heterogeneous models of computation into one system. In Ptolemy, a model of computation corresponds to a Domain. The code for each Domain interacts with the Ptolemy kernel. This overview describes the general structure of the various classes that are used by a Domain in its interaction with the kernel. The Ptolemy User's Manual has a more complete overview of this information.

A functional block, such as an adder or an FFT, is called a Star in Ptolemy terminology, (see "Writing Stars for Simulation" on page 2-1 for more information). A collection of connected Stars form a Galaxy (see Chapter 2 of the User's Manual for more information). Ptolemy supports graphical hierarchy so that an entire Galaxy can be formed and used as a single function block icon. The Galaxy can then be connected to other Stars or Galaxies to create another Galaxy. Usually, all the Stars of a Galaxy are from the same Domain but it is possible to connect Stars of one domain to a Galaxy of another domain using a WormHole.

A Universe is a complete executable system. A Universe can be either a single Galaxy or a collection of disconnected Galaxies. To run a Universe, each Galaxy also needs a Target. In simulation domains, a Target is essentially a collection of methods to compute a schedule and run the various Stars of a Galaxy. Some Domains have more than one possible scheduling algorithm available and the Target is used to select the desired scheduler. In code generation domains, a Target also computes a schedule and runs the individual Stars, but each Star only generates code to be executed later. Code generation Targets also handle compiling, loading, and running the generated code on the target architecture.

At a lower level are the connections between Blocks. A Block is a Star or Galaxy. Each Block has a number of input and output terminals which are attached to a Block through its PortHoles. A special PortHole, called a MultiPortHole, is used to make multiple connections but with only one terminal. Two Blocks are not directly connected through their PortHoles. Rather, their PortHoles are connected to an intermediary object called a Geodesic. In simulation domains, data is passed between PortHoles (through the Geodesic) using container objects called Particles. Ptolemy uses a system where Particles are used and recycled instead of created and deleted when needed. Particles are obtained from a production and storage class called a Plasma, which creates new Particles if there are no old ones to reuse. Particles that have completed their task are returned to the Plasma, which may reissue them at a later request. Graphically, the Star to Star connection is depicted below:

The classes defined above provide most of the functionality necessary for a working domain. One additional class needed by all domains is a Scheduler to compute the order of execution of the Stars in the Galaxy.

Therefore, creating a new Ptolemy simulation domain will typically involve writing new classes for Stars, PortHoles, WormHoles, Targets, and Schedulers.

Creating a new domain is a fairly involved process, and not to be done lightly. The first thing that many users want to do when they see Ptolemy is create a new domain. However, it is often the case that the functionality they need is already in either the SDF or DE domains, or they can merely add a Target or Scheduler rather than an entire domain.

Top Up Prev Next Bottom Contents Index Search

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