
Summer 2007 ECE 3055
Assignment 3 โ Part II
Due Date: 11:59 pm, Friday June 22nd, 2007.
1 Purpose:
To understand how datapaths provide hardware support for exception handling, and how
this hardware support may be accessed via a privileged set of instructions. This is an
interface an operating system will use to provide certain types of services.
1.1 Assignment
As with Part I there are two components โ a warm-up component designed to help you
become familiar with the datapath and an extension component.
1.1.1 Warm-up
1. To familiarize yourself with the model, compile and execute a few simple
programs. Study the trace and convince yourself that the programs are indeed
correctly executed. A few simple observations should be made. The warm-up can
be discussed with your classmates.
a. In which VHDL modules are the following components implemented?
Note that this may not exactly correspond to what you have from the
figures in the text.
1. Where is the sign-extended offset computed?
2. Where is the PCSource multiplexor?
3. What are the data word widths?
4. What are the widths of the program counter and branch
addresses? Note how this differs from the datapath for the single
cycle model.
b. Does the model implement one single memory or separate instruction and
data memories?
2. Compiling and executing MIPS instructions is procedurally the same.
1.1.2 Handling Exceptions
This part of the assignment must be done individually. Extend the multi-cycle datapath to
implement the following exceptions and associated instructions.
1. A trap instruction with opcode 0x3F: If an instruction with this opcode is
executed, program execution should continue at byte address 0x10 with the
appropriate exception behavior as discussed in your text and described below.
Note this requires you to increase the size of instruction memory and modify how
instruction memory is addressed by the PC (MS_IFETCH.VHD).
2. An address exception: Certain types of addresses create exceptions, for example,
page faults, where an address refers to a virtual page on disk rather than in
memory (more on this later in the operating system part of the class). Simulate
such an occurrence by detecting addresses above 0x40 as page faults. In this case
an exception occurs and execution continues at address byte address 0x10. In a