Download
a first look at ptalon n.
Skip this Video
Loading SlideShow in 5 Seconds..
A First Look at Ptalon PowerPoint Presentation
Download Presentation
A First Look at Ptalon

A First Look at Ptalon

49 Views Download Presentation
Download Presentation

A First Look at Ptalon

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Adam Cataldo • Thomas Feng • Edward Lee A First Look at Ptalon Motivation 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. 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. Research Directions 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. Run the model to view the results model HelloWorld() { actors { r = Ramp(), d = Display(columnsDisplayed = "50") } connections { linkr.outputtod.input } attributes { actor ptolemy.actor.lib.gui.Display, actor ptolemy.actor.lib.Ramp, director ptolemy.domains.sdf.kernel.SDFDirector } } “HelloWorld.ptln” 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. Apply the Vergil autolayout feature to see the model <?xml version="1.0" standalone="no"?> <!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd"> <entity name="HelloWorld" class="ptolemy.actor.TypedCompositeActor"> ... <property name="SDF" class="ptolemy.domains.sdf.kernel.SDFDirector"> <property name="iterations" class="ptolemy.data.expr.Parameter" value="0"> </property> ... </property> <entity name="r" class="ptolemy.actor.lib.Ramp"> <property name="firingCountLimit" class="ptolemy.data.expr.Parameter" value="0"> </property> ... </entity> <entity name="d" class="ptolemy.actor.lib.gui.Display"> <property name="rowsDisplayed" class="ptolemy.data.expr.Parameter" value="10"> ... </entity> <relation name="r_output__d_input" class="ptolemy.actor.TypedIORelation"> <property name="width" class="ptolemy.data.expr.Parameter" value="1"> </property> </relation> <link port="r.output" relation="r_output__d_input"/> <link port="d.input" relation="r_output__d_input"/> </entity> “HelloWorld.xml” Generate a Java file compatible with the Ptolemy II API java PtolemyGenerator.class HelloWorld.ptln package ptolemy.actor.ptalon; import ... publicclass HelloWorld extends TypedCompositeActor { HelloWorld() throws ... { super(); setName("HelloWorld"); SDFDirector director = new SDFDirector(this, "SDF"); Ramp r = new Ramp(this, "r"); Display d = new Display(this, "d"); d.columnsDisplayed.setExpression("50"); TypedIORelation r_output__d_input = new TypedIORelation(this, "r_output__d_input"); r.output.insertLink(0, r_output__d_input); d.input.insertLink(0, r_output__d_input); } publicstaticvoid main(final String[] args) { ... } } “HelloWorld.java” java HelloWorld.class vergil HelloWorld.xml Generate a MoML description of the model Open the file in the Vergil editor Center for Hybrid and Embedded Software Systems