Exercises
The lecture notes (in the form of PowerPoint "handouts") can be
downloaded from the course home page. It is the responsibility of each
student to download and print out the material before each lecture! The
material will be available on the home page at least 48 hours before the
lecture in question.
Exercise 1 - Introduction to Ada 95, tasks and protected objects
Thu study week 1, 15.15 - 17.00 in HA3
In this exercise, we will familiar ourselves with the basic building blocks of
the Ada95 programming language. We will learn about identifiers, literals,
keywords, types, program flow control and, more importantly, tasks and
protected objects of Ada95. Two example Ada programs will be demonstrated to
show how shared resources are handled in Ada. This exercise class is
important to get ourselves started with the laboratory assignment
(Assignment 1) of designing a resource handler in study week 2.
Slides
[
PDF
]
Exercise 2 - Low-level programming and exception handling in Ada
95
Thu study week 2, 15.15 - 17.00 in HA3
In this exercise, we will first go through an Ada programming example of a
resource handler that manages three distinct resources. Then, we will
discuss some low-level programming issues and exception handling in Ada.
Solutions to some example problems related to these topics will be
demonstrated. Finally, some important assumptions and issues for the
laboratory assignment will be discussed.
Slides
[ PDF ]
Exercise 3 - Interrupts in Ada 95; The laboratory assignment:
model, description and specification
Thu study week 3, 15.15 - 17.00 in HA3
In this exercise, first we will go through a mini lecture on "interrupts" in
Ada95. We will discuss the steps a programmer needs to think of when
implementing an interrupt handler in Ada. Then, an example will be
demonstrated to show how these steps are carried out when writing the code.
Finally, some important issues regarding the laboratory assignment and its
interrupt handler will be discussed.
Slides
[
PDF ]
Exercise 4 - Low-level synchronization + the 'requeue'
statement
Thu study week 4, 15.15 - 17.00 in HA3
In this exercise, we will first give a mini lecture on different
synchronization constructs (i.e. monitors, semaphores). Examples will be
demonstrated to show how these synchronization constructs are used in Ada95.
Finally, some important issues regarding the laboratory assignment and
"requeue" statement in Ada95 will be discussed.
Slides
[ PDF
]
Exercise 5 - Interfacing Ada 95 to C and assembly language;
Worst-case execution times
Thu study week 5, 15.15 - 17.00 in HA3
In this exercise, we will first give a mini lecture on interfacing foreign
languages (e.g. C programming/assembly) with Ada95. Example programs will be
demonstrated to show how C/Assembly languages can be interfaced with Ada95.
Then, two example problems on worst-case execution time (WCET) analysis
will be presented. Finally, questions and issues (if any from the students)
regarding the laboratory assignment and report will be discussed.
Slides
[ PDF
]
Exercise 6 - Scheduling
Thu study week 6, 13.15 - 15.00 in HA3
In this exercise, we will solve scheduling problems from the exercise
compendium regarding Rate-Monotonic (RM) and Deadline-Monotonic (DM)
scheduling. The solutions to the problems are based on processor utilization
test and/or response time analysis. Finally, solutions to some scheduling
problems that uses the information of blocking in the extended response time
analysis (due to shared resources) will be demonstrated.
Slides
[ PDF ]
Exercise 7 - Scheduling (cont'd)
Thu study week 7, 15.15 - 17.00 in HA3
In this exercise, we will first solve one scheduling problem regarding
resource sharing using the ICPP protocol. Then, we will solve scheduling
problems from the exercise compendium regarding Earliest-Deadline-First (EDF)
scheduling. The solution of the problems for EDF scheduling are based on
processor-utilization test and/or processor-demand analysis.
Slides
[ PDF ]