EE 360N - Programming Assignment 3 Clarifications

  1. Exception vector also should be left-shifted.
    e.g. the starting address of the page fault exception handler is found at memory location:

          0x200 + (0x02 << 1) = 0x204


  2. Do we need to translate VM to PM in system mode?
    If we don't translate VM to PM in system mode, do we need to modify the PTE?

    No, you don't need to translate VM to PM in system mode, and if you don't translate, you don't need to change the PTE's at system mode.


  3. Do we need to translate VM to PM for TRAP instruction (when we are accessing memory with the trapvector)?

    No, you don't need to translate.


  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.


  5. All you need to change in the shell code which we provided to you is the enumeration CS_BITS and Get functions (like GetIRD()) (you can also add new Get functions).


  6. During address translation, if a protection exception or page fault occurs should the reference bit of the PTE still be set?

    Reference and modified bits of the PTE should be changed only if the address translation is successful (i.e. only if there are no exceptions during address translation).


  7. Your simulator should generate the timer interrupt once at cycle 500. You can implement this by using the CYCLE_COUNT variable we provided.
  8. 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.


  9. 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.


  10. Who initializes the user stack pointer?

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


  11. 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.


  12. Does the timer interrupt occur every 500 cycles?

    No. It occurs only once at cycle 500.


  13. Should the interrupt service routine clear the reference bits of system pages too?

    Yes, it should clear the reference bits of all virtual pages.


  14. 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 words. You should store the sum of the 20 16-bit two's complement integers as a word at location xC014.


  15. What should be the initial values of modified and reference bits in the page table entries?

    Initialize the modified and reference bits to 0.


  16. Local variable address should be incremented only by 1 in both for loops in the mdump function. Please make this correction in the shell code. The mdump function should look like:
    void mdump(FILE * dumpsim_file, int start, int stop) {
        int address; /* this is a byte address */
    
        printf("\nMemory content [0x%0.4x..0x%0.4x] :\n", start, stop);
        printf("-------------------------------------\n");
        for (address = (start >> 1); address <= (stop >> 1); address++)
            printf("  0x%0.4x (%d) : 0x%0.2x%0.2x\n", address << 1, address << 1, MEMORY[address][1], MEMORY[address][0]);
        printf("\n");
    
        /* dump the memory contents into the dumpsim file */
        fprintf(dumpsim_file, "\nMemory content [0x%0.4x..0x%0.4x] :\n", start, stop);
        fprintf(dumpsim_file, "-------------------------------------\n");
        for (address = (start >> 1); address <= (stop >> 1); address++)
            fprintf(dumpsim_file, " 0x%0.4x (%d) : 0x%0.2x%0.2x\n", address << 1, address << 1, MEMORY[address][1], MEMORY[address][0]);
        fprintf(dumpsim_file, "\n");
    }
    

  17. In our dumpsim file should we dump the contents of physical memory location x3414 or x3814?

    Please dump the contents of location x3814.