Transcript Slide 1

A First Look at Ptalon
Adam Cataldo
Thomas Feng
Edward Lee
http://chess.eecs.berkeley.edu/
Motivation
Research Directions
As computation becomes increasingly distributed, the architecture description languages (ADLs) developed over the past decade are
helping software designers shift focus from lines-of-code to the interconnection structure between components. This is necessary in a world
of large-scale distributed systems. Interconnection structure alone will do little to make programming tens of thousands of components
manageable. In addition to “standard” ADL features like hierarchical composition and parameterization, we think that supporting
“interconnection inheritance” and “high-order interconnections” will be key to the success of ADLs. The ACME ADL already supports
limited interconnection inheritance, and high order functions are standard to distributed programmers on the Google File System.
In the near future, we plan to identify useful
mechanisms for model inheritance and high
order models in Ptalon. In this attempt, we
hope to find a generic implementation
strategy, so we can target multiple output
formats, like C and Java.
Consider a distributed sort example. A high order interconnection structure might be determined by two parameters, a sort component and
the number of sort components. A subclass of such a model might add a merge component as a third parameter. A designer need only
specify the structural building blocks and a rule for extending the structure, rather than specify thousands of connections manually.
model HelloWorld() {
“HelloWorld.ptln”
actors {
r = Ramp(),
d = Display(columnsDisplayed = "50")
}
connections {
link r.output to d.input
}
attributes {
actor ptolemy.actor.lib.gui.Display,
actor ptolemy.actor.lib.Ramp,
director ptolemy.domains.sdf.kernel.SDFDirector
}
Ptalon
Ptalon is an ADL with a simple goal: Make it easier for programmers to build
large models. It is in the very early stages of development; we are still debating
what the core features of the language, like the inheritance and high order
mechanisms, should look like. To the left is our first model written in Ptalon. Here
the components are defined outside of Ptalon in a Java format compatible with
Ptolemy II. This is intentional; Ptalon should only specify the interconnection
structure, not define the components, so that it can target many platforms. Our
prototype compiler generates code that is launched in Vergil to the right.
<?xml version="1.0" standalone="no"?>
“HelloWorld.xml”
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
}
"http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
Generate
a
Java
java PtolemyGenerator.class
<entity name="HelloWorld" class="ptolemy.actor.TypedCompositeActor">
file compatible with the
HelloWorld.ptln
Ptolemy II API
...
“HelloWorld.java”
package ptolemy.actor.ptalon;
<property name="SDF" class="ptolemy.domains.sdf.kernel.SDFDirector">
import ...
<property name="iterations" class="ptolemy.data.expr.Parameter" value="0">
</property>
public class HelloWorld extends TypedCompositeActor {
...
HelloWorld() throws ... {
</property>
java
super();
<entity name="r" class="ptolemy.actor.lib.Ramp">
HelloWorld.class
setName("HelloWorld");
<property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="0">
SDFDirector director = new SDFDirector(this, "SDF");
</property>
Ramp r = new Ramp(this, "r");
...
Generate a MoML
Display d = new Display(this, "d");
</entity>
description of the
d.columnsDisplayed.setExpression("50");
<entity name="d" class="ptolemy.actor.lib.gui.Display">
model
TypedIORelation r_output__d_input =
<property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10">
new TypedIORelation(this, "r_output__d_input");
...
r.output.insertLink(0, r_output__d_input);
</entity>
d.input.insertLink(0, r_output__d_input);
<relation name="r_output__d_input" class="ptolemy.actor.TypedIORelation">
}
<property name="width" class="ptolemy.data.expr.Parameter" value="1">
</property>
public static void main(final String[] args) {
</relation>
...
<link port="r.output" relation="r_output__d_input"/>
}
<link port="d.input" relation="r_output__d_input"/>
}
</entity>
February 23, 2006
Run the model to
view the results
Center for Hybrid and Embedded Software Systems
Apply the Vergil
autolayout feature
to see the model
vergil
HelloWorld.xml
Open the file in the
Vergil editor