Module 5
Module 5
DESIGN OF RTS
The approach to the design of real-time computer systems is no different in outline from
that required for any computer-based system or indeed most engineering systems. The work can be
divided into two main sections:
• The planning phase; and
• The development phase.
It is concerned with interpreting use requirements to produce a detailed specification of the system
to be developed and an outline plan of the resources - people, time, equipment, costs - required to
carry out the development. At this stage preliminary decisions regarding the division of functions
between hardware and software will be made. A preliminary assessment of the type of computer
structure - a single central computer, a hierarchical system, or a distributed system - will also be
made. The outcome of this stage is a specification or requirements document. (The terminology
used in books on software engineering can be confusing; some refer to a specification requirement
document as well as to specification document and requirements document. It clearer and simpler
to consider that documents produced by the user or customer describe requirements, and
documents produced by the supplier or designer give the specifications.) It cannot be emphasized
too strongly that the specification document for both the hardware and software which results from
this phase must be complete, detailed and unambiguous. General experience has shown that a large
proportion of errors which appear in the final system can be traced back to unclear, ambiguous or
fault) specification documents. There is always a strong temptation to say 'It can be decided later';
MITMysore | Dept of Electronics and Communication Engineering
deciding it later can result in the need to change parts of the system which have already been
Option 2: is putting a processor that includes a display and keyboard on each unit an expensive
solution? Will communication between processors be required? (Almost certainly the answer to
this is yes; operators and managers will not want to have to use separate displays and keyboards.)
Option 3: what sort of communication linkage should be used? A shared high speed bus? A local-
area network? Where should the microcontrollers be located? At each blower unit or together in a
central location? Each option needs careful analysis and evaluation in terms of cost and
performance. The analysis must include consideration of development costs, performance
operating and maintenance costs. It should also include consideration of reliability and safety. To
provide a basis for consideration of the widest range of approaches to software design we will
assume that option 1 above is chosen.
Examining the specification shows that the software has to perform several different functions:
1. DDC for temperature control;
2. Operator display;
3. Operator input;
4. Provision of management information;
5. System start-up and shut-down; and
6. Clock/calendar function.
The various functions and type of time constraint are shown in Figure. The control module has a
hard constraint in that it must run every 40 ms. In practice this constraint may be relaxed a little to,
say, 40 ms ± 1 ms with an average value over 1 minute of, say, 40 ms ± 0.5 ms. In general the
sampling time can be specified as Ts ± es with an average value, over time T, of Ts ± ea. The
MITMysore | Dept of may
requirement Electronics and Communication
also be relaxed Engineering
to allow, for example, one sample in 100 to be missed. These
constraints will form part of the test specification. The clock/calendar module must run every 20
Dept. of ECE, GSSSIETW, Mysuru Page 97
Real Time Systems (15EC743)
Module 5 Real time systems(15EC743) Design of RTS
ms in order not to miss a clock pulse. The operator display, as specified, has a hard constraint in
that an update interval of 5 seconds is given. Common sense suggests that this is unnecessary and
an average time of 5 seconds should be adequate; however, a maximum time would also have to be
specified, say10 seconds.. These would have to be decided upon and agreed with the customer.
They should form part of the specification in the requirements document. The start-up module does
not have to operate in real time and hence can be considered as a standard interactive module. The
sub-problems will have to share a certain amount of information and how this is done and how the
next stages of the design proceed will depend upon the general approach to the implementation.
The single-program approach can be used for simple, small systems and it lead to a clear and
easily understandable design, with a minimum of both hardware and software. Such systems are
usually easy to test.. In the above example the management output requirement makes it unsuitable
for the single-program approach; if that requirement is removed the approach could be used. It
may, however, require the division of the display update module into three modules: display date
and time; display process values; and display controller parameters.
The foreground task is written as an interrupt routine and the background task as a standard
program. If you use a PC you are in practice using a foreground/background system. The
application program that you are using (a word processor, a spreadsheet, graphics package or some
program which you have written yourself in a high-level language) is, if we use the terminology
given above, running in the background. In the foreground are several interrupt-driven routines -
the clock, the keyboard input, the disk controller - and possibly some memory-resident programs
which you have installed - a disk caching program or an extended memory manager. The
terminology foreground and background can be confusing; literature concerned with non-real-time
software uses foreground to refer to the application software and background to refer to interrupt
routines that are hidden from the user.
5.6 INTRODUCTION
The production of robust, reliable software of high quality for real-time computer control
applications is a difficult task which requires the application of engineering methods. During the
last ten years increasing emphasis has been placed on formalizing the specification, design and
construction of such software, and several methodologies are now extant. All of the methodologies
address the problem in three distinct phases. The production of a logical or abstract model - the
process of specification; the development of an implementation model for a virtual machine from
the logical model - the process of design; and the construction of software for the virtual machine
together with the implementation of the virtual machine on a physical system - the process of
implementation. These phases, although differently named, correspond to the phases of
development generally recognized in software engineering texts. Abstract model: the equivalent of
a requirements specification, it is the result of the requirements capture and analysis phase.
Implementation model: this is the equivalent of the system design; it is the product of the design
stages - architectural design and the detail design.
The Yourdon methodology has been developed over many years. It is a structured methodology
based on using data-flow modeling techniques and junctional decomposition. It supports
development from the initial analysis stage through to implementation. Both Ward and Mellor
(1986) and Hatley and Pirbhai (1988) have introduced extensions to support the use of the
Yourdon approach for the development of real-time systems and the key ideas of their
methodologies are:
1. Subdivision of system into activities;
2. Hierarchical structure;
3. Separation of data and control flows;
MITMysore | Dept
4. of Electronics and
No early Communication
commitment Engineering
to a particular technology; and
5. Traceability between specification, design and implementation.
Components are dried by being passed through an oven. The components are placed on a
conveyor belt which conveys them slowly through the drying oven. The oven is heated by three
gas-fired burners placed at intervals along the oven. The temperature in each of the areas heated by
the burners is monitored and controlled. An operator console unit enables the operator to monitor
and control the operation of the unit. The system is presently controlled by a hard wired control
system. The requirement is to replace this hard wired control system with a computer-based
system. The new computer-based system is also to provide links with the management computer
over a communication link.
Operator Inputs
The operator sends the following command inputs: Start, Stop, Reset, Re-start, and Pause. The
operator can also adjust the desired set point for each area of the dryer.
Operator Outputs
The operator VDU displays the temperature in each area, the conveyor belt speed, and the alarm
status. It should also display the current date and time and the last operator command issued.
The outline of the Ward and Mellor method is shown in Figure. The starring point is to
build, from the analysis of the requirements, a software model representing the requiremel1ls in
terms of the abstract entities. This model is called the essential model. It is in two parts: an
environmental model which describes the relationship of the system being modeled with its
environment; and the behavioral model which describes the internal structure of the system. The
second stage the design stage - is to derive from the essential model an implementation model
which defines how the system is implemented on a particular technology and shows the allocation
of parts of the system to processors, the subdivision of activities allocated to each processor into
tasks, and the structure of the code for each task. The essential model represents what the system is
required to do; the implementation model shows how the system will do what has to be done. The
implementation model provides the design from which the implementers of the physical system
can work. Correct use of the method results in documentation that provides traceability from the
physical
MITMysore | Deptsystem to the abstract
of Electronics andspecification
Communicationmodel. Engineering
The analysis procedures are minimal and adequate checking for consistency can be
performed only with the support of a CASE tool. However, the methodologies are still useful in
that the procedures they recommend provide a sensible way of preparing both a specification and a
design in that they encourage the development of hierarchical, modular structures. the two, the
Hatley and Pirbhai method is the more structured and formalized in its approach. Its diagrams are
less cluttered than those of the Ward and Mellor method and, once the separation is understood,
are easier to follow. Many CASE tools provide alternative displays which allow a choice of either
separate diagrams or a combined diagram with switching between the two forms. The weakness of
both methods lies in the allocation of processors and tasks. The suggestion that one allocates
activities to processors and then subdivides the activities into tasks allocated to each processor
appears at first sight a sensible way to proceed. However, when it is tried one soon realizes that the
information required to do this is not available.
2. Real-Time Systems Design and Analysis, Phillip. A. Laplante, Second Edition, PHI,
MITMysore | Dept of Electronics and Communication Engineering
2005.