EE 360N - Programming Assignment 4 FAQ

  1. Are we changing the datapath/state diagram to DETECT or GENERATE the interupt 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 the EXCV register be left-shifted by 1 before adding to the interrupt vector base register?

    Yes. EXCV is an index into this table and as each entry stores an address, 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 file format should we write for readme file?

    We prefer txt, pdf, ps file formats. You can submit jpg, or bmp file format for figures.
    If you feel that a word document (or any other format) is more convenient, make sure that you convert it into a form which can be viewed on unix . An easy way of doing this is to print the word document, and choose the "print to file" option - this will create a postscript file which can be viewed on unix.

    You are welcome to submit a hard copy if it will be simpler.

  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?

    User stack pointer is initialized in the user program (if the user program makes use of the stack).

  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 0x0000 to 0x01FF 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.