Docsity

Submissions Instructions - Computer Architecture and Operating Systems | ECE 3055, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
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
pf3

Partial preview of the text

Download Submissions Instructions - Computer Architecture and Operating Systems | ECE 3055 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

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

real system, the exception handler will then decide what to do, for example bring the page into memory.

  1. A rte (return from exception) instruction with opcode 0x2F. To provide the support necessary for the above behaviors, your implementation should do the following.
  2. When an exception occurs, the return address for continuing execution after the exception is processed should be saved in a special exception program counter (EPC) register. This register should be added to the datapath. Make sure the values of the contents of this register appears on the simulation trace
  3. The cause of the exception to be saved in an exception status (ES) register. This register should be added to the datapath. The value 0 signifies a trap and the value 1 signifies a page fault. Make sure the value of the contents of this register appears on the simulation trace.
  4. The program counter should be assigned the value of the address of the first instruction in the exception handler โ€“ in this assignment that is address 0x10.
  5. You should have an exception handler at that address that allocates a stack frame (one instruction) and then executes a return from exception (rte) instruction.
  6. The rte instruction causes the program to resume executing from the interrupted instruction (in the case of page fault) or the next instruction following the trap instruction. Note that this means that the actual value saved in the EPC is dependent on the specific type of exception.
  7. To include support for the exceptions, first modify the datapath and determine how this datapath should operate to affect the desired behaviors. Modify the control state machine accordingly specifying all control signals values required of each new state. a. From this specification you can now change the control ROM and associated sequencer (if necessary) to implement the new state machine b. Modify the VHDL models to update the datapath. c. Compile & test

2 Submissions Instructions

There is no submission requirement for the warm-up. For the exception handling extensions submit the following in electronic format.

  1. A figure illustrating the modifications made to the single cycle datapath with all modifications clearly shown and all control signals clearly marked. Associated text describing how this solution works.
  2. A new state machine with all control signal values for each new state listed as well as the update to the control ROM.
  3. Screen shots of traces of test cases along with accompanying text demonstrating that your design does indeed function correctly.
  4. The complete VHDL code for the modified datapath. It should be in a form whereby all that needs to be done is compile & run (as in the case of the model that was provided to you).
  5. Submit a zip file with the preceding to the TA by 11:59 PM, Friday June 22th^. The zip file for this part should be separate from that of Part I of this assignment.