EE 360N - Programming Assignment 3 Clarifications

  1. What could be the cause of "Warning: Extra bit(s) in control store file ucode."?

    This means that the ucode file has more than 35 columns. One reason why this can happen is if you've transferred the ucode file from Windows to Unix. Run dos2unix program on UNIX machines to remove the extra control characters inserted by Windows. You can do this by typing:

    dos2unix ucode ucode
    on any LRC SunOS or Linux machine. If this doesn't work, check to make sure that your ucode file has at most 35 columns.

  2. What is CYCLE_COUNT? Is this the counter for memory access?

    CYCLE_COUNT is a global variable used by the simulator to count the number of machine cycles elapsed since the program started execution. Do not change this variable. You will need to use another variable for simulating memory latency.

  3. How do we handle Memory Mapped I/O for this lab?

    You do not need to implement Memory Mapped I/O for this lab.

  4. You do not have to implement the RTI instruction for this lab. You can assume that the input file to your simulator will not contain any RTI instructions.

  5. For this assignment, you can assume that the programmer will always give aligned addresses, and your simulator does not need to worry about unaligned cases.

  6. You may assume that the code running on your simulator has been assembled correctly and that the instructions your simulator sees comply with the ISA specifications, i.e. all instructions are valid and there are no unaligned accesses.

  7. In your code that you write for lab 3, do not assign the current latches to the next latches. This is already done in the shell code.

  8. I am getting values like xFFFFFFFF in my registers when they should be xFFFF instead, why is this?
    The variables in your c program are 32 bit values, so the nubmer -1 is xFFFFFFFF. You need to make sure that when you store values in a variable you mask them properly. For instance you would need to assign the var1 from var2 the statment var1 = var2 & 0xFFFF, or its equivalent var = Low16bits(var2). This zeros out the top 16 bits before writing it into var1.

  9. Do we need to implement the TRAP routines?

    No. Whenever a TRAP instruction is processed, after the last state, PC will be set to 0, if you implement the TRAP instruction correctly. The simulator halts whenever PC becomes 0.
    You are still implementing states 15,28,30 associated with the TRAP instruction.

  10. Why am I not getting the result I expect from a C expression?

    Please read and make sure you understand the precedence of C operators. Examples:

    1. "a & b == 0" means "a & (b == 0)", therefore you might want to write "(a & b) == 0"
    2. "a >> 1 + b" means "a >> (1 + b)", therefore you might want to write "(a >> 1) + b"
    3. "a = b + c? d : e" means "a = (b + c)? d : e", therefore you might want to write "a = b + (c? d : e)"
    4. there are other examples from some lab 2 implementations... If you do not want to remember or to think too much about this, just use parenthesis!