Computer Science 237 |
Lecture 29: The WC34000 Computer
Date: November 18, 2005
It's best to contact Mary today to get your Unix group set up, so you'll be ready to set up a repository on Monday or Tuesday.
Remember, sharing passwords is not an acceptable way to share files.
Even if you are not planning to work in a group, keeping your microcode under source code control is a very good idea.
mpc := band(ir,63);
This allows you to branch to any of the first 64 microcode instructions based on the low six bits of ir. This is the equivalent of 64 Tanenbaum-style instructions and saves 5 cycles of execution time. Of course, you cannot perform this in more than one place in your code, unless you can make the target instructions consistent.
If you perform
srcop := band(ir,63); if z then goto DDir; mpc := srcop+mpc; ADir: ... !! Address Reg Direct Mode
It branches to any of the next 63 instructions if the value srcop bits are non-zero, and to the instruction found at DDir if these source bits are zero. This relative branch may appear anywhere in your program, as long as it stays in the same relative position with respect to the target instructions.
If you perform
mpc:=ir;the machine decodes the low 10 bits of your instruction in one step. This could land (almost) anywhere in your microcode. "Branching on 10 bits" is a viable option, but it uses all of the microcode store. It is not clear that the low 10 bits are the correct 10 bits to decode in this manner.
add 4(a6),5(a6)for example, requires 3 instruction words, all of whom must be read, along with two more memory reads and one write. That's a grand total of 12 cycles of reading or writing. If you can prefetch some of this instruction, you may be able to overlap the execution of this instruction with the previous operation.
It is not clear that prefetching is inherently useful. It can take time to maintain the consistency of your buffers and this may introduce speculative or worse, redundant reads. These can slow you down considerably, if your microcode is running fast.
Prefetching must be designed in from a fairly early stage. Retrofitting your code can be painful.