In Ptolemy, domains can be mixed and even nested. Thus, a system-level description can contain multiple subsystems that are designed or specified using different styles. The kernel support for this is shown in figure 1-7
XXXWormhole
in the XXX
domain is derived from XXXStar
, so that from the outside it looks just like a primitive in the XXX
domain. Thus, the schedulers and targets of the XXX
domain can handle it just as they would any other primitive block. However, inside, hidden from the XXX
domain, is another complete subsystem defined in another domain, say YYY
. That domain gets invoked through the setup
, run
, and wrapup
methods of XXXWormhole
. Thus, in a broad sense, the wormhole is polymorphic. The wormhole mechanism allows domains to be nested many levels deep, e.g. one could have a DE domain within an SDF domain within a BDF domain. The FSM domain is designed to always be used in combination with other domains.