23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

202 Modelling <strong>of</strong> Concurrent <strong>Reactive</strong> Behaviour<br />

6.6.2 Object-Orientation and Modelling Dynamic Behaviour<br />

Events in the environment usually initiate the dynamic behaviour <strong>of</strong> a system. Behaviour<br />

is performed by interactions <strong>of</strong> objects. They internally take decisions about<br />

what communication and what actions are to be performed in what order. The exchange<br />

<strong>of</strong> messages can happen in various ways: synchronous, asynchronous, continuous and<br />

interrupt-driven. What happens on what event depends on the system’s history. In<br />

many methods the control <strong>of</strong> sequences <strong>of</strong> actions can be described by the formalism <strong>of</strong><br />

finite state machines (FSMs). The traditional FSM formalism does not <strong>of</strong>fer a communication<br />

concept for communication between independent FSMs. Therefore there have<br />

been attempts to extend the traditional FSM formalism.<br />

Extended FSMs<br />

Statemate [H 90] is an accepted method for the modelling <strong>of</strong> complex reactive systems<br />

based on extended FSMs. Many concepts in Statemate resemble (real-time) structured<br />

analysis and structured design methods such as [WM85, HP88]. These methods typically<br />

unify data flow models and state machine models. Both [WM85] and [HP88] use<br />

conventional finite state machines and do not <strong>of</strong>fer appropriate machine interaction<br />

primitives.<br />

Conventional state diagrams are inappropriate for complex behaviour descriptions since<br />

they suffer from being flat and unstructured, are inherently sequential in nature and<br />

give rise to an exponential growth in the number <strong>of</strong> states [H 90]. These problems are<br />

relieved in Statemate by incorporating the Statecharts formalism [Har87]. Statecharts<br />

extend conventional machines by <strong>of</strong>fering and/or decomposition <strong>of</strong> states and broadcast<br />

communication. Statemate is an example <strong>of</strong> a method and a tool that has a sound formal<br />

foundation.<br />

Unfortunately the Statecharts formalism cannot be used straightforward for an objectoriented<br />

approach. The grain <strong>of</strong> modularisation in Statemate is the activity which is<br />

similar to the concept <strong>of</strong> process or transformation in [WM85] and [HP88]. These<br />

concepts are based on a functional approach where data is visualised in stores and<br />

data transformations in activities. This differs fundamentally from the encapsulation<br />

concept in the object-oriented paradigm. State machines communicate by data-less<br />

broadcast signals, by using shared variables and by monitoring each other’s states.<br />

This is in conflict with encapsulation (see also Paragraph 6.3.3.4). The only way that<br />

objects should monitor each others state is by explicit exchange <strong>of</strong> messages. Objects are<br />

relatively loosely coupled encapsulating autonomous entities in contrast to Statemate’s<br />

activities that are tightly coupled entities that share data stores.<br />

A premise for a method for distributed systems is that the speed <strong>of</strong> computation <strong>of</strong> the<br />

<strong>of</strong>fered modules is independent. We achieved this by <strong>of</strong>fering asynchronous concurrency.<br />

In contrast, Statecharts is based on the synchrony hypothesis [BG85]. This means<br />

that all concurrent entities in a system must proceed in lock-step mode (see Paragraph<br />

6.2.2.6). For hardware designs this is <strong>of</strong>ten acceptable in case the system is synchronised<br />

by a single clock. The model is however not natural for s<strong>of</strong>tware concurrency, since

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

Saved successfully!

Ooh no, something went wrong!