RealTime Bounded Buffer Problem - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

RealTime Bounded Buffer Problem

Description:

... be stored in each slot ... data items into the buffer, in the first available empty slot ... There are three CRSM machines, one for the producer, one for the ... – PowerPoint PPT presentation

Number of Views:380
Avg rating:3.0/5.0
Slides: 31
Provided by: ITS2
Category:

less

Transcript and Presenter's Notes

Title: RealTime Bounded Buffer Problem


1
Real-Time Bounded Buffer Problem
  • The buffer is an intermediate storage of N slots.
    A data item can be stored in each slot
  • The producer process inserts data items into the
    buffer, in the first available empty slot
  • The consumer removes data items from the full
    slots

2
Timed Producer Consumer
System Interconnection Diagram
3
Channels in the Bounded Buffer
  • There are three CRSM machines, one for the
    producer, one for the consumer, and one for the
    buffer
  • There are two channels defined
  • Deposit, from the producer to the buffer
  • Remove, from the buffer to the consumer

4
Communication Between The Producer and the Buffer
  • In the producer, if the Deposit I/O does not
    occur on time, the producer changes to state P2,
    an error
  • The Deposit I/O may occur if
  • The producer is in state P1
  • The Buffer is in state B1
  • The guard, full lt n
  • If this communication occurs, the two transitions
    occur simultaneously

5
Communication Between The Producer and the Buffer
(2)
  • If the communication from the producer to the
    buffer takes place, the buffer receives the data
    item in its next available slot
  • Bufin data

6
(No Transcript)
7
(No Transcript)
8
Communication Between The Buffer and the Consumer
  • The Remove I/O may occur if
  • The Consumer is in state C1
  • The guard, full gt 0, is true
  • The Buffer is in state B1

9
(No Transcript)
10
Timed Bounded Buffer
  • In the Buffer, the internal computation
    transitions has time constraint 2,3, which
    means the initial transition from state B0 to
    state B1 can take any time between 2 and 3 time
    units
  • The Deposit and Remove transitions could occur at
    any time after entering state B1 provided the
    relevant guard evaluates to true.

11
Time Constraints in Consumer and Producer
  • The Consumer can execute a Remove sometime in the
    interval 8,10 after entering state C1.
  • The Producer can perform a Deposit I/O only in
    the interval 7,12 after entering P1.

12
Timeout in Producer-Consumer
  • At relative time 12, a timeout occurs and the
    transition is taken to state P2, with the
    current time stored in variable now.
  • A message is then sent on channel Error to an
    error-logging machine, and producer starts the
    cycle again.

13
Train Gate System
  • A one-directional railway track crosses a road
  • A gate at the crossing may be lowered or raised
    under computer control
  • A short distance from the crossing a sensor
    detects entering trains
  • A short distance from the crossing a sensor
    detects leaving trains.

14
Physical Requirements
  • The gate must be closed whenever there are trains
    in the area (safety requirement)
  • The gate must be kept open when there are no
    trains in the area (liveness requirement)

15
Timing Requirements
  • The maximum allowed time (period) from the
    instance the train enters the approach zone and
    the instance the gate completes closing must be 8
    time units
  • The maximum allowed period after a correct signal
    is received by the controller and the instance
    the corresponding command is sent to the gate is
    1.2 time units

16
Timing Requirements
  • The period from the instance the train leaves the
    gate to the instance the gate is raised should
    not be greater than 1.75 time units, if there are
    no more trains in the area.

17
Timing Workload
  • The arriving trains have an average inter-arrival
    period, tr_arr
  • The gate takes z time units to close (or open)
  • There is a communication delay in the
    communication of the controller and the gate.

18
Simulation Outputs
  • Trace of events
  • Performance measures
  • Number of trains serviced
  • Worst reaction time
  • Worst response time
  • Number of deadlines missed
  • Gate opening/closing
  • Communication timeouts

19
Train Gate System CRSMCommunication Diagram
20
Train-Gate SystemUML_RT Collaboration Diagram
21
Timeouts
  • Activity timeouts
  • Communications timeout

22
Activity Timeouts
  • The Gate takes a maximum of z time units to close
    or to open
  • The controller process normally waits for the
    Gate to open or close
  • If the Gate takes longer than the maximum
    allocated time, the controller flags a timeout
    for the gate and triggers an alarm

23
Communication Timeouts
  • The real-time systems uses synchronous
    communications
  • In the normal case, one of the processes, either
    the sender or the receiver, will wait for the
    other to establish the communication
  • A communication timer object will interrupt a
    process attempting to communicate, on timeout.

24
Sequence Diagram for Train Arrival
25
Main Class Diagram
26
Entry Sensor
27
Exit Sensor
28
Monitor
29
Controller Process
30
Gate Process
Write a Comment
User Comments (0)
About PowerShow.com