ECE5881 Real Time System Design
Revision Questions
Q1. Write a NIOS-II assembly language program to achieve the following:
• Saturating addition of two 32 unsigned integers.
• Saturating subtraction of two 32 signed integers.
• A memory test program that writes a complete set of different values to each
memory location before reading them back to check correctness. Use a
pseudo random sequence based on a Linear Feedback Shift Register structure.
The test program should be able to run continuously.
Q2. Suppose a 32 data width bus bridge is interfaced to a 512 kbyte SRAM with 16 bit
data lines. Draw timing diagrams involving all relevant bus signals for read and write
cycles that illustrate 8 bit odd address, a 16 bit address that is 2 mod 4, and 32 bit
transactions. List the assembly language instructions and register values that would give
rise to these bus cycles.
Q3. In which ECE5881 lab experiments can you find examples of hard and soft real time
deadlines? Explain the consequences in detail of a missed deadline in each case.
Q4. What different software structures are used in the implementation of real time
embedded systems. What are the merits and disadvantages of each structure?
Q5. Give an example of an embedded system where cost and reliability are more
important than development time?
Q6. Give an example of an embedded system where reliability is more important than
the final cost and development time?
Q7 When are FPGA devices more appropriate than dedicated microcomputer chips in an
implementation of an embedded system?
Q8 How can the increased power consumption of an FPGA device compared to a
dedicated microcomputer chip be offset in a design?
Q9 If power consumption was an important design criterion, why would an accelerated
hardware solution be considered?
Q10 Describe a set of tests that could be prescribed for embedded systems used in the
automotive industry.
Q11 Discuss the importance of documentation of an embedded system design in an
industrial context.
Q12 What “good” software engineering practices are used in embedded system design?
Motivate the need for these practices.
Q13 How can symmetry be used to manipulate common household objects with a robot
manipulator?
Q14 Describe the steps for determining a line of symmetry using real time computer
vision.
Q15 Describe a set of tests that could be prescribed for embedded systems that are to be
used in aeronautical and space applications.
Q16 Give an example of an embedded system peripheral that can be implemented with
primarily software or primarily hardware and compare the merits of each approach.
Outline the solutions in each case.
Q17 Describe a small alteration that could be used to determine the direction of the
pendulum swing in the pendulum lab if no slot is employed in the optical beam sensor
mask – that is a simple rectangular mask is to be used to block the light beam at the
bottom of the pendulum. (Hint: think about symmetry and position of the sensor. You do
not need any additional hardware for this solution). How would this affect the latency of
the determination of pendulum swing direction?
Q18 Write a simple Verilog interface for the beam sensor that measures the high pulse
time width in microseconds. Assume that you are using a system clock of 50 MHz on a
DE2 board. Show how this could be interfaced to the NIOS-II processor using a PIO
module and the configuration of that PIO module so that an interrupt is generated when a
new pulse width is determined by the Verilog module. Are there any metastability
considerations needed in this module design and how would these be addressed?
Q19 What are the consequences of a much faster PID servo sample rate than is
necessary? Describe how this would affect the proportional, integral and differential
feedback gain terms. Do this in terms of the parameter T=the servo sample time interval
and define the number of bits needed relative to say 8.8 for Kp and Kd, and 0.16 for Ki
used in the pendulum laboratory exercise.
Q20 In a PID controller, what is integral windup and how can it be avoided?
Q21 Suppose you suspect that motor currents are inducing high frequency noise into the
beam sensor digital signal in the pendulum lab. Firstly describe how you could
experimentally confirm this hypothesis. Describe different approaches to removing this
noise based on:
Analogue electronics
Digital hardware
Software
Compare the merits and disadvantages of each approach.
Q22. Design a three input synchronous arbiter using Verilog that could be used for the
Avalon bus bridge interface used in lab 6. Ensure that your design uses round robin to
rotate the priority order should simultaneous requests occur. Identify whether the design
is vulnerable to metastable failure if it were used in an extension of Lab 6 – that to
arbitrate a shared SRAM between three NIOS-II processors CPU_0, CPU_1 and CPU_2.
Q23 Suppose a 3 input asynchronous arbiter has requests lines REQ1, REQ2 and REQ3
and corresponding acknowledge lines ACK1, ACK2 and ACK3. Show how this arbiter
is susceptible to metastable failure by drawing timing diagrams of two or more scenarios
with different outputs and a continuum of possibilities between them that can occur in
practice.
Q24 Define Rate Monotonic Scheduling (RMS). Is it a static or dynamic scheduling
algorithm? Can we do better than RMS with static schedulers? What sort of processes
are scheduled with RMS? At what utilization level can we guarantee that RMS will
succeed for n processes? What does the limit as n approaches infinity of this utilization
represent? Do we need to modify the internal task scheduler in uC/OS-II to implement
RMS?
Q25 Why is dynamic scheduling more costly computationally than a static scheduler?
How could we create a dynamic scheduler using a fixed priority real time operating
system similar to uC/OS-II?
Q26 In the Real Time Scheduling lab EDF implementation, why are the priorities for the
periodic processes always either all odd or all even? Write a simple scheduler for EDF
that can be used in uC/OS-II and work on any number of processes. Describe
improvements that would allow your code to run as fast as possible. Profile your code to
determine which parts are the slowest.
Q27 Give an example of a problem (ie a set of process periods and runtimes) where the
Earliest Deadline Scheduler (EDF) works and RMS does not work. Justify your answer.
Is it always true that EDF works “better” than RMS? What does “better” really mean
here?
Q28 Two approaches can be used for implementing RMS – one based on suspending the
processes and another using one semaphore per process to block processes. Draw timing
diagrams showing an example of scheduling of the three processes described in the lab
and where each is suspended or blocked by a semaphore. Which of these two approaches
can fail and how? Which approach runs faster?
Q29 How can rounding be implemented when integer division is being used in an
embedded system (ie we do not have access to floating point arithmetic)?
Q30 How is CPU utilisation measured in uC/OS-II? In your answer consider the
initialisation process and frequency of update. Is there an issue with the way this is done
in uC/OS-II when 100% utilisation occurs? Could you improve the measurement and if
so at what cost?
学霸联盟