1. To specify the component targets , we first set
childTypesstate of the target class that must be derived from class CGMultiTarget. We may add special resources to the processors by setting
resourcesstate, a list of items separated by ';'. An item starts with the target index followed by a list of strings identifying resources. The relative computing speed of processors are specified by
2. An application program for a heterogeneous target uses wormholes. In pigi, all stars in a universe should be in the same domain. To overcome this restriction, we use wormhole representation to distinguish stars for different targets, or domains, but still in the same universe. Once the graph is read into the Ptolemy kernel, all wormholes of code generation domain are flattened to make a single universe:
flattenWormmethod of CGMultiTarget class. Currently, we manually partition the stars to different kinds of processors. For example, if we have three "default-CG96" targets and one "default-CG56" target, we partition the stars to two kinds: CG96 or CG56. This partitioning is based on the original wormhole representation. If we ignore this partitioning, we can apply an automatic scheduling with the flattened graph. This feature has not been tested yet even though no significant change is required in the current code.
3. When we schedule a star in the scheduling phase, we first obtain the list of processors that can schedule the star:
CGMultiTargetclass. The execution time of the star to a processor is computed in
CGMultiTargetclass considering the relative speed of processors.
4. After scheduling is performed, we create sub-universes for child targets. In case manual partitioning is performed, we just clone the stars from the original graph in the sub-universes. In case we use automatic partitioning, we need to create a star in the current target with the same name as the corresponding star in the original graph:
cloneStarprivate method of
UniProcessorclass. We assume that we use the same name for a star in all domains.