|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.copernicus.kernel.KernelMain
public abstract class KernelMain
Base class that provides common functionality to be used by various code generators. Particular code generators should extend this class and generally override the addTransforms method to instantiate the correct transforms and the _parseArgs method to extract arguments. These subclasses should be not be instantiated directly, but will instead be instantiated by the Copernicus class according to a selected code generator.
Red (cxh) |
Red (cxh) |
Nested Class Summary | |
---|---|
static class |
KernelMain._IgnoreAllApplicationClasses
|
Field Summary | |
---|---|
protected java.lang.String |
_momlClassName
The name of the MoML class, either as a top level model or as an xml file that we are generating code for. |
protected CompositeActor |
_toplevel
The CompositeActor we are generating code for. |
Constructor Summary | |
---|---|
KernelMain()
|
Method Summary | |
---|---|
protected java.lang.String[] |
_parseArgs(GeneratorAttribute attribute)
Parse any code generator specific arguments. |
static void |
addStandardOptimizations(soot.Pack pack,
int time)
Add transforms corresponding to the standard soot optimizations to the given pack. |
static void |
addTransform(soot.Pack pack,
java.lang.String name,
soot.Transformer transformer)
Add a new transform to the given pack, dealing properly with options specified in the transformer. |
static void |
addTransform(soot.Pack pack,
java.lang.String name,
soot.Transformer transformer,
java.lang.String defaultOptions)
Add a new transform to the given pack, dealing properly with options specified in the transformer. |
abstract void |
addTransforms()
Add transforms to the Scene. |
void |
compile(java.lang.String modelName,
CompositeActor toplevel,
GeneratorAttribute attribute)
Compile the given model with the given name. |
void |
generateCode(java.lang.String[] args)
Call soot.Main.main(), which does command line argument processing and then starts the transformation. |
void |
initialize(CompositeActor toplevel)
Read in a MoML class, sanitize the top level name, initialize the model. |
CompositeActor |
toplevel()
Return the model that we are generating code for. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String _momlClassName
protected CompositeActor _toplevel
Constructor Detail |
---|
public KernelMain()
Method Detail |
---|
public static void addTransform(soot.Pack pack, java.lang.String name, soot.Transformer transformer, java.lang.String defaultOptions)
public static void addTransform(soot.Pack pack, java.lang.String name, soot.Transformer transformer)
public abstract void addTransforms()
public void compile(java.lang.String modelName, CompositeActor toplevel, GeneratorAttribute attribute) throws java.lang.Exception
java.lang.Exception
public void generateCode(java.lang.String[] args)
args
- Soot command line arguments to be passed
to soot.Main.main().public void initialize(CompositeActor toplevel) throws IllegalActionException, NameDuplicationException
If the director is an SDF director, then the number of iterations is handled specially. If the director is an SDF director and a parameter called "copernicus_iterations" is present, then the value of that parameter is used as the number of iterations. If the director is an SDF director, and there is no "copernicus_iterations" parameter but the "ptolemy.ptII.copernicusIterations" Java property is set, then the value of that property is used as the number of iterations.
toplevel
- The model we are generating code for.
IllegalActionException
NameDuplicationException
public CompositeActor toplevel()
public static void addStandardOptimizations(soot.Pack pack, int time)
protected java.lang.String[] _parseArgs(GeneratorAttribute attribute) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |