EE 460N: Lab Assignment 4 Clarifications

  1. Are we changing the datapath/state diagram to detect or generate the interrupt or exception?

    As part of this lab, you are changing the datapath and state diagram to detect both the protection exception and the timer interrupt. However, you are only simulating the generation of the timer interrupt.

  2. Should INTV/EXCV be left-shifted by 1 before adding to the interrupt/exception vector base register?

    Yes. INTV/EXCV is an index into the interrupt/exception vector table and as each entry stores an address, INTV/EXCV has to be left-shifted by one to get the correct offset in this table.

  3. You should generate the timer interrupt only once – at cycle 300. You must also take care of setting the global variable INTV to the correct interrupt vector at this time.

  4. What kind of file format should we write for the readme file?

    Please submit a hard copy of your report in class.

  5. You need to change in the shell code which we provided to you the enum CS_BITS and the struct System_Latches.

  6. Your simulator should generate the timer interrupt once at cycle 300. You can implement this by using the CYCLE_COUNT variable we provided.

  7. What should PSR[15] be initialized to?

    You should initialize the privilege mode of the processor (PSR[15]) to 1 (user mode) in your simulator.

  8. Can a user program execute the RTI instruction?

    You can assume that RTI will never be used by a user program. You are not responsible for generating an exception if an RTI instruction is encountered in user mode.

  9. Who initializes the user stack pointer?

    The user stack pointer is initialized in the user program (if the user program makes use of the stack). The supervisor stack pointer is initialized by the shell code we already provided.

  10. Can we assume that we do not get interrupts/exceptions when the processor is in system (supervisor) mode?

    For the purposes of this assignment, you can assume this.

  11. What is the size of the data elements our user program is supposed to add?

    The elements your user program is supposed to add are bytes. You should store the sum of the 20 8-bit two's complement integers as a 16-bit word at location xC014.

  12. Can I execute one cycle of the memory access (for example in state 33) before handling the exception?

    No. You should not access memory if the access causes an exception.

  13. You may declare registers you need as part of the System_Latches struct.

  14. TRAP should be able to execute in user mode, i.e. it must be able to access the trap vector table at x0000 to x01FF without causing a protection exception.

  15. You may add a line to the initialize() function in the shell code to set the initial value of the PSR.

  16. Please note that LEA no longer sets condition codes.