03.08.2013 Views

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

PTOLEMY II - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Introduction<br />

SR models are excellent for applications with concurrent and complex control logic. Because of<br />

the tight synchronization, safety-critical real-time applications are a good match. However, also<br />

because of the tight synchronization, some applications are overspecified in the SR model, limiting the<br />

implementation alternatives. Moreover, in most realizations, modularity is compromised by the need<br />

to seek a global fixed point at each clock tick. The SR domain implementation in Ptolemy <strong>II</strong> is similar<br />

to the SR implementation in Ptolemy Classic by Stephen Edwards[33].<br />

1.3.14 Timed Multitasking - TM<br />

The timed multitasking (TM) domain, created by Jie Liu [92], supports the design of concurrent<br />

real-time software. It assumes an underlying priority-driven preemptive scheduler, such as that typically<br />

found in a real-time operating systems (RTOS). But the behavior of models is more deterministic<br />

than that obtained by more ad hoc uses of an RTOS.<br />

In TM, each actor executes (conceptually) as a concurrent task. It is a timed domain, meaning that<br />

there is a notion of “model time” that advances monotonically and uniformly. Each actor has a specified<br />

execution time T, and it delays the production of the outputs until it has had access to the CPU for<br />

that specified amount of time (in model time, which may or may not match real time). Actors execute<br />

when they receive new inputs, so the execution is event driven. Conceptually, the actor begins execution<br />

at some time t, and its output is produced at time t + T + P, where T is the declared execution time,<br />

and P is the amount of time where the actor is suspended due to being preempted by a higher priority<br />

actor. At any given model time t, the task with the highest priority that has received inputs but not yet<br />

produced its outputs has the CPU. All other tasks are suspended.<br />

TM offers a way to design real-time systems that is more deterministic than ad hoc uses of an<br />

RTOS. In particular, typically, a task produces outputs at a time that depends on the actual execution<br />

time of the task, rather than on some declared parameter. This means that consumers of that data may<br />

or may not see updates to the data, depending on when their execution occurs relative to the actual execution<br />

time. Thus, the computational results that are produced depend on the actual execution time.<br />

TM avoids this by declaring the time that elapses before production of the outputs. By maintaining<br />

model time correctly, TM ensures that the data computation is deterministic, irrespective of actual execution<br />

time.<br />

1.3.15 Wireless<br />

The wireless domain, described in [10], is an extension of the discrete-event domain that supports<br />

modeling and simulation of wireless and sensor network systems. An example model is shown in figure<br />

1.11. Notice that the syntax is very different from that in figure 1.2.<br />

This example models a SoundSource (whose icon is large, transparent concentric circles) moving<br />

through a field of sensors (SoundSensor actors, which have translucent blue circle icons) that detect<br />

the sound and communicate with a Triangulator actor (whose icon consists of overlapping ellipses).<br />

The Triangulator is a composite, shown at the bottom of the figure, that uses the DE domain to perform<br />

sensor fusion to triangulate the location of the sound source. It generates a plot with estimated locations.<br />

When this model is executed, the sensors’ icons turn red when they detect a sound. Upon detecting<br />

a sound, they transmit the time at which they detect the sound and their current location. If a<br />

location can be found, then the model plots that location.<br />

The wireless domain generally uses channel models to mediate communication. A library of channel<br />

models is provided, but it is expected that users will create their own channel models. The domain<br />

can model such effects as propagation delay, packet losses, directional gain (such as antenna gain),<br />

22 Ptolemy <strong>II</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!