Presentation is loading. Please wait.

Presentation is loading. Please wait.

Winter 2007SEG2101 Chapter 111 Chapter 11 Implementation Design.

Similar presentations


Presentation on theme: "Winter 2007SEG2101 Chapter 111 Chapter 11 Implementation Design."— Presentation transcript:

1 Winter 2007SEG2101 Chapter 111 Chapter 11 Implementation Design

2 Winter 2007SEG2101 Chapter 112 Contents What is implementation design? Difference between real systems and SDL systems Implementation descriptions Design considerations

3 Winter 2007SEG2101 Chapter 113 11.1: Implementation Design Goal: to define the mapping from the abstract system defined in functional design to a concrete system made up of hardware and software components. Task: to make all necessary decisions and to document the concrete system in sufficient detail to make implementation well defined. Result: an implementation design description, which explains how the abstract functions are realized.

4 Winter 2007SEG2101 Chapter 114 The Scope of Implementation Design

5 Winter 2007SEG2101 Chapter 115 Example: Implementation alternatives

6 Winter 2007SEG2101 Chapter 116 The Forward Aspect Select among implementation alternatives being functionally equivalent to the SDL system.

7 Winter 2007SEG2101 Chapter 117 The Feedback Aspect Adapt the SDL description in the case when the selected implementation is not functionally equivalent. There are important differences between the abstract world of SDL and the real world.

8 Winter 2007SEG2101 Chapter 118 The Role of Design Constraints Although the realization alternatives for a given functional design are functionally equivalent, the choice of the designer is normally restricted by the non-functional requirements or design constraints. If no constraints exist or all solutions are equivalent, the designer is free to choose among solutions.

9 Winter 2007SEG2101 Chapter 119 11.2: Differences between Real Systems and SDL Systems Fundamental differences –Physical components are rather imperfect compared to the more ideal properties of SDL components. –They develop errors over time, they are subject to noise and they need time to perform their processing tasks. Conceptual differences –In both worlds there are concepts for concurrency, communication, sequential behavior and data, but they are not necessarily the same.

10 Winter 2007SEG2101 Chapter 1110 A Typical Realization

11 Winter 2007SEG2101 Chapter 1111 Fundamental Differences Processing time –CPU power Errors and noise Physical distribution Finite resources

12 Winter 2007SEG2101 Chapter 1112 Processing Time An SDL system is not limited by processing resources. The real world is different. One major issue is to balance the processing capacity of the implementation against the traffic load. When one knows the speed required, the next task is to find hardware-software solutions that will be fast enough. The hardware-software interfaces need special consideration. The receiver has to be fast enough to catch all relevant signal information at the speed it is passed over the channel.

13 Winter 2007SEG2101 Chapter 1113 Errors and Noise In the real world, errors will manifest themselves as faults in the operation of channels and processes. Hardware errors, physical damages and noise are caused by physical phenomena entirely outside the realm of SDL. The effect of errors and noise will often need to be handled explicitly in SDL description. How it can be detected, and damages may be limited? What a process should do if it never gets a response to a request or if it gets erroneous response? …

14 Winter 2007SEG2101 Chapter 1114 Physical Distribution Physically separated processes and channels may fail independently. Channels covering long physical distances are subject to more noise and errors than channels implemented in software within one computer. Transmission equipment and protocols are needed to implement the channel reliably. Physical distance may introduce new functions needed to support the implementation of channels. A positive effect of physical separation is that errors are isolated.

15 Winter 2007SEG2101 Chapter 1115 Finite Resources All resources in a real system are finite. There may be a maximum number of processes the operating system can handle or a maximum number of buffers for sending messages. Memory space… The designer must find ways to implement potentially infinite SDL system using finite resources. –Restrict the use of SDL so that all values are certain to be bounded. –Deal with resource limitations in the implementation.

16 Winter 2007SEG2101 Chapter 1116 Conceptual Differences - Concurrency SDL: independent and asynchronous Real: truly in parallel, the operations of parallel objects are synchronous or asynchronous A “natural” implementation is to map each SDL process to a separate physical object, which is not always cost-effective. An alternative is to implement many process in software sharing the same computer hardware. –Quasi-parallel –Scheduling and multiplexing

17 Winter 2007SEG2101 Chapter 1117 Conceptual Differences - Communication There are two different categories of information: events and states There are two ways to communicate: signal units and continuous signals There are two kinds of communication media: unit- oriented and continuous SDL signal: signal units implemented by unit-oriented medium such as message queue Real signal: sometimes, continuous signals

18 Winter 2007SEG2101 Chapter 1118 Conceptual Differences - Synchronization The act of aligning the operations of different concurrent processes in relation to each other In SDL synchronization is achieved by means of the signal queues of processes SDL: time-independent, using an asynchronous medium with infinite buffer capacity, the sender can send infinitely many signals ahead of the receiver, the synchronization of SDL rests on a basic synchronization mechanism – mutual exclusion Real: time-dependent, time-independent, queue will be finite

19 Winter 2007SEG2101 Chapter 1119 11.3: Design Considerations Trade-off between hardware and software Define hardware architecture Define software architecture Restructure and refine the functional design

20 Winter 2007SEG2101 Chapter 1120 Trade-off between Hardware and Software Physical distribution and physical interfaces Time constraints versus process capacity Error handling Security against unauthorized access to information Operation and maintenance of the hardware Cost to develop, produce, modify and maintain (Re)use of existing components

21 Winter 2007SEG2101 Chapter 1121 Example

22 Winter 2007SEG2101 Chapter 1122 Physical Distribution and Physical Interface Distribute processes in a way that minimizes the bandwidth needed over physical channels.

23 Winter 2007SEG2101 Chapter 1123 Time Constraints versus Processing Capacity For each SDL process P, estimate a mean transition time t p =i p *o p *S Calculate the mean number of transition n p, that each SDL process will perform per second at peak load. Calculate the normalized mean peak load for each process: l p =n p *t p Calculate corresponding load for each channel C and signal route R: l C =n C *t C l R =n R *t R Calculate the mean peak load of the system by adding together the channel, signal route, and process load. If the sum is higher than one, the mean load is higher than the processing capacity of a single computer. As a rule of thumb, the mean peak load on a single computer should not exceed 0.3 (typically 0.2-0.3).

24 Winter 2007SEG2101 Chapter 1124 Error Handling Fault tolerance means redundancy. At least two hardware units and facilities for error detection, diagnostics and switch-over are needed to implement fault tolerance. Fault sectioning means distributing the functions over separate hardware units in a way that limits the number of SDL processes that may be blocked by a single hardware error. Fail-safeness means that the system must always fail to a safe state where it does no harm to its environment. Some sort of supervisory hardware will normally be needed. RAID, watch-dog, voting

25 Winter 2007SEG2101 Chapter 1125 11.4 Software Design for RT Systems

26 Winter 2007SEG2101 Chapter 1126 Three Interrelated Problems Input-output: how to handle the communication with the environment across the hardware-software interface. Application: how to implement the functionality of SDL system within the software system of each computer. Concurrency: how to handle the concurrence required by the input-output and application. In short, how to handle time, priorities, scheduling, and synchronization.

27 Winter 2007SEG2101 Chapter 1127 Context of Software Design

28 Winter 2007SEG2101 Chapter 1128 Principles for Priority Assignments External priority: give time-critical external events priority over internal processing Internal processing priority: give the processing of internal signals priority over the processing of external signals Load control: when overload occurs, give priority to service requests already in progress and delay fresh requests

29 Winter 2007SEG2101 Chapter 1129 Implementation of Process Communication Waiting for events –Active waiting –Semi-active waiting –Passive waiting Message passing Buffered communication

30 Winter 2007SEG2101 Chapter 1130 Active Waiting DO FOREVER BEGIN newstate := input(channel); IF newstate NEQ laststate THEN process_event; laststate := newstate; END;

31 Winter 2007SEG2101 Chapter 1131 Semi-Active Waiting DO FOREVER BEGIN newstate := input(channel); IF newstate NEQ laststate THEN process_event; laststate := newstate; DO “something_else”; /* wait(suspend,time) */ END;

32 Winter 2007SEG2101 Chapter 1132 Passive Waiting DO FOREVER BEGIN waitint(channelevent,max_time); process_event; END;

33 Winter 2007SEG2101 Chapter 1133 Message Passing – Procedure Call Procedure calls provide the most straightforward way of communication among software modules.

34 Winter 2007SEG2101 Chapter 1134 Buffered Communication

35 Winter 2007SEG2101 Chapter 1135 Shared Variable

36 Winter 2007SEG2101 Chapter 1136 Implementation of SDL Process Behavior State-oriented

37 Winter 2007SEG2101 Chapter 1137 Action-oriented Implementation of SDL Process Behavior

38 Winter 2007SEG2101 Chapter 1138 Table-driven Implementation of SDL Process Behavior


Download ppt "Winter 2007SEG2101 Chapter 111 Chapter 11 Implementation Design."

Similar presentations


Ads by Google