In this paper, we describe a software architecture supporting code generation from within Ptolemy II. Ptolemy II is a componentbased design tool intended for embedded and real-time system design. The infrastructure described here provides a platform for experimentation with synthesis of embedded software or hardware designs from high-level, Java-based specifications. A specification consists of a set of interconnected actors whose functionality is defined in Java. The provided infrastructure parses the existing Java code for the actors and presents a simple API, using the Visitor pattern, for transforming the abstract syntax tree and writing code transformers and back-end code generators. A code transformer is described that performs generic optimizations, such as specialization of polymorphic data types, and domain-specific optimizations, such as static buffer allocation for communication between dataflow actors. The back end resynthesizes the transformed Java code. We describe a simple example where the generated Java code runs on a PalmOS handheld computer, and a more elaborate example where significant performance improvements are achieved by transformations.
[1]
Edward A. Lee,et al.
Synthesis of Embedded Software from Synchronous Dataflow Specifications
,
1999,
J. VLSI Signal Process..
[2]
Katherine A. Yelick,et al.
Titanium: A High-performance Java Dialect
,
1998,
Concurr. Pract. Exp..
[3]
Tsay Jeff,et al.
A Code Generation Framework for Ptolemy II
,
2000
.
[4]
Edward A. Lee,et al.
Software synthesis for DSP using ptolemy
,
1995,
J. VLSI Signal Process..
[5]
Ralph Johnson,et al.
design patterns elements of reusable object oriented software
,
2019
.
[6]
Edward A. Lee,et al.
Ptolemy II, Heterogeneous Concurrent Modeling and Design in JAVA
,
2001
.
[7]
Heinrich Meyr,et al.
Code Generation and Optimization Techniques for Embedded Digital Signal Processors
,
1996
.
[8]
Edward A. Lee,et al.
An Extensible Type System for Component-Based Design
,
2000,
TACAS.