15-740 Fall '95
Notes on Assignments
In the following, the term HOME740 refers to the home directory for the course, namely
/afs/cs.cmu.edu/academic/class/15740-f95/public.
The term LIB740 refers to the
library file
HOME740/lib/lib740.a, containing the object code for any runtime support routines supplied for your use.
For your convenience, the sources for the library are available in subdirectory
HOME740/src.
The following information is in reverse order of
assignment, i.e., the most recent assignments appear first.
Assignment 6
Assignment 6 is issued on Nov. 28 and
due on Mon, Dec. 11. The assignment is available in postscript form.
Platforms
The code will not run properly on DEC Alpha's. The problem is that
the code assume pointers and int's require the same amount of storage,
but in the case of the Alpha, pointers take 8 bytes and int's take 4.
Performance Issues
Although the models we're working with aren't big by SMV standards,
they are big enough to consume a fair amount of CPU time and memory if you're not careful. Here are a few techniques to improve the performance
- You can diddle some of the run time flags. These are documented
in the man page for smv, found in
HOME740/public/man/man1. Here is a postscript version. Useful flags
are -c, -k, and -r.
- You can temporarily replace one of the caches with a ``fake
cache'' to reduce the size of the state space. Here's an example SMV description of such
a model. You can do most of your debugging and counterexample
generation using this reduced model, and then run a full 3 cache
version when you're certain everything should work.
- On each run, strip away any verification conditions and any fairness constraints that aren't relevant to the particular task.
Task 1: Generating Interesting Behavior
Item 3 of this asks you to generate a case where a cache performs a
``write-back'' due to a write miss by some other processor. This is
not really proper terminology, since, technically speaking, write-back
refers to the case where a processor evicts a block from its cache to
make room for another block. What is meant here is to demonstrate a
case where one cache supplies the data needed to satisfy the write
request for a different cache's processor. Note that you don't
actually see this happening in the SMV model, since it doesn't model
the data transfers on the bus. But, you can model the control aspects
of this transfer.
Task 3: Implementing LL and SC
This is the hardest task of the assignment. You'll need to augment
the SMV model significantly.
Here are some clarifications
- You do not need to model the data handling part of these
operations, just the control. Note that you don't need to actually
model the lock acquisition code shown in the assignment in SMV.
- Instead of adding another Boolean signal between cache and
processor, you may want to generalize the stall signal to a
three-valued status signal, with values stall,
succeed, and fail
- Note that the MIPS instruction set puts very few restrictions on
the use of LL and SC.
Although these instructions are typically used in a very stylized way, you should not assume a particular usage pattern in your implementation.
In particular:
- There is nothing special about the memory locations referenced by
LL and and SC. They can be used for normal loads and stores.
- The link register will not be disturbed if the connected processor
does a read, write, or store conditional operation on the memory
location. It will also not be disturbed if some other processor reads
the location. It will be cleared only if some other processor writes
(or performs a store-conditional operation on) the memory location.
- You must constrain your processor model so that it will never
attempt an operation for which the behavior is unspecified. [In
general, the environment model should never do anything invalid to the
system].
- Note that the cache may lose its copy of a block between the LL
and SC yet still succeed. You'll need to carefully work out the
updating of the link register.
Here is some advice:
-
Extend the state diagram to include the handling of LL and SC
operations by the processor, as well as the effects different bus
operations can have on the link register.
- Be sure you consider all possible states, and all possible
relations between the addresses specified by the processor, the cache
tag, and the bus address.
- Try to make a failing SC behave as much as possible like a no-op,
i.e., not causing bus traffic or a change in cache state.
- Be sure to document your design well in your writeup. The problem
is challenging, but it's fun to work through all the details.
Assignment 5
Assignment 5 is issued on Nov. 14 and
due on Thu., Nov. 28. The assignment is available in postscript form.
Now, the sample answer is available in postscript form.
Assignment 4
Assignment 4 is issued on Oct. 31 and
due on Thurs., Nov. 9. The assignment is available in postscript form.
Now, the sample answer is available in postscript form.
Assignment 3
Assignment 3 is issued on Oct. 17 and
due on Thurs., Oct. 26. The assignment is available in postscript form.
Now, the sample answer is available in postscript form.
There are also some follow-up clarifications:
- For Task 1.A, the question has been changed. I gave you the answer of the
sign extension method. Now, your task is to justify why this method works.
Here is the modified assignment in
postscript form.
- In Task 1.B, you should write a parameterized multiplier such that
you can fully test your multiplier by resizing it to a 8x8 multiplier
and verifying it with all of the possible input combinations. File
asst3/m_8x8.test is the test cases for a 8x8 multiplier.
Assignment 2
Assignment 2 is issued on Oct. 3 and
due on Thurs., Oct. 12. The assignment is available in postscript form. The class
note about this assignment is available in postscript form.
Now, the sample answer is available in postscript form.
There are also some follow-up clarifications:
I've made changes in the files Makefile, mips.h, and mips_sim.c:
- Makefile: Fixed to allow generation of a .O file from a .c file according to
suggestions by Rob Miller. You should use "gmake" instead of "make",
though.
- mips.h: Old version stored as mips.v1.h. Fixed error in macro GET_I26.
- mips_sim.c: Old version stored as mips_sim.v1.c. Fixed to handle BREAK instruction during EX phase rather than ID.
This will make it possible for you to fetch & decode a BREAK
instruction following a branch that later gets cancelled. The *right*
way to handle this instruction would be to move the exception
condition through pipe registers as discussed in class yesterday. For
the purpose of this assignment, what I've done is good enough.
- mips_sim.c: Set so that BREAK causes stall in EX stage. Old version in mips_sim.v2.c
- In addition, I've added files jtest.{c,O,answer} giving some tests for
jump instructions. Not a comprehensive test set, but reasonably
stressful!
Assignment 1
Assignment 1 is issued on Sept. 19 and
due on Thurs., Sept. 29. The assignment is available in postscript form.
Now, the sample answer is available in postscript form.
There are also some follow-up clarifications:
If you are using the machine which word size is 64 bits, e.g.
Alpha, you can use m100_w64.test file under
HOME740/asst/asst1 directory.