Real-Time Systems Design in Ptolemy II: A Time-Triggered Approach

N. Vinay Krishnan

Memorandum No. UCB/ERL M04/22
July 12, 2004
Electronics Research Laboratory
College of Engineering
University of California, Berkeley 94720




In this report is described a software infrastructure to enable users to design hard real-time systems from Ptolemy II [1]. The Giotto [2] domain within the Ptolemy II design environment is made use of to model systems which are then compiled and executed on KURT-Linux [3], a real time flavor of Linux.

The first stage of the software takes a graphical model as an input to generate intermediate code in the C language. This intermediate code consists of the task-code to be executed, as well as a representation of their timing requirements.

The second stage, called the Embedded Machine [5] reads in the timing information and interprets it to release the tasks for execution as per the stated requirements. The released tasks can either be assigned to a standard scheduler such as EDF, or to a scheduling interpreter called the Scheduling machine, or S Machine.

The S Machine was developed to gain fine grained control over the scheduling of tasks. The S Machine requires as input scheduling information that specifies a time line for the tasks involved thus giving the designer maximum flexibility over task scheduling, and consequently greater resource utilization. The E&S Machines when compiled along with the generated task and timing code for the KURT-Linux platform forms an executable that delivers predictable real-time performance. The benefit this approach offers is that the real-time tasks can run along with ordinary Linux tasks without the timing properties of the real-time tasks being affected.

An audio application was designed to illustrate the effectiveness of this tool-flow, which achieved a timing uncertainty of less than 130 microseconds in its task execution times.

[1] J. Davis, C. Hylands., J. Janneck, E.A. Lee, J. Liu, X.Liu, S. Neuendorffer, S. Sachs, M. Stewart, K. Vissers, P. Whitaker and Y. Xiong, "Overview of the Ptolemy Project", Technical Memorandum UCB/ERL M01/11, EECS, University of California, Berkeley, March 6, 2001.

[2] T.A. Henzinger, B. Horowitz and C.M. Kirsch, "Giotto: A time-triggered language for embedded programming", Proceedings of the IEEE, 91(1):84-99,2003.

[3] R. Hill, B. Srinivasan, S. Pather and D. Nihaus, "Temporal Resolution and Real-Time Extensions to Linux", Techreport, kurt-utime-1998, ITTC-FY98-TR-11510-03, "Information and Telecommunication Technology Center, University of Kansas", June, 1998.

[5] T.A. Henzinger and C. M. Kirsch, "The Embedded Machine: Predictable, portable real-time code". Proceedings of the International Conference on Programming Language Design and Implementation (PLDI). ACM Press, 2002, pp. 315-326.