hardware platformThe hardware platform is an expanded version of the design for the Oliver truck terminal. It includes:
In addition to the data stack and return stack used in all other MISC (minimum instruction set computer) processors, the return stack also stores the value of the "self register". The processor has 16 bit wide data paths, but virtual addresses for memory are two groups of 16 bits: the object number (normally from the self register) and the field number (either from register A, R or the PC). The memory controller includes a virtually addressed cache. On a cache miss, a 32 bit physical address is generated and four words are transferred to/from main memory. Instructions in memory are also 16 bits wide. When the top bit is 1, the bottom 15 bits indicate the value to be loaded into the PC for a send instruction. When the top bit is 0, then the bottom 15 bits form three groups of 5 bit primitive instructions. These are the primitive instructions which are present in other MISC chips (see http://www.ultratechnology.com/chips.htm):
Primitive instructions are executed at three times the memory cycle rate. The bottom 5 bits in the 16 bit word (not counting the top bit indicating this as a primitive instruction word) are the first instruction to be executed, then the word is shifted 5 bits so the new bottom 5 bits are executed next and so on. The jump, call and literal instructions use any remaining bits in the instruction register as their argument. The jump and call instructions replace the corresponding bits in the program counter and so don't require the adder for their operation. So if the bottom 5 bits are used for a jump, then the lowest 10 bits in the PC are replaced with the value in the instruction register causing a jump to some location in the same 1 Kword "page" in memory. Using the second instruction as a jump or call will allow destinations in the same 32 byte "page" to be reached. When the last instruction is a literal, jump or call then the next word is used as the data allowing any bit pattern to be placed on the stack or in the PC. And the presence of the self register requires some extra instructions:
Note that the self register can't be directly loaded, but a s! instruction followed by a return will do the trick. The return stack is 32 bits wide and every time a 16 bit word is pushed on it (either a call or push instruction) the value of the self register supplies the other 16 bits. The self register is only changed by a return or send instruction (in the latter case it is loaded with the value on the top of the data stack). In most memory accesses, the self register supplies the object ID for the address. One exception is for the @r+ and !r+ instructions which is the high word of the top of the return stack instead. This was done so that copying blocks of memory from one object to another wasn't too awkward. Another exception is for instruction fetches. In that case a masked version of the self register is used. If the top bit of the self register is zero, then the object ID is also zero (this is used for integer objects), but if it is one then the mask depends on bits 14 and 13 of the self register:
This is used by the software to implement "type objects". The first four words of each object are found in an object table which takes up the first 128Kwords of memory. Just multiply the object ID by four and add the word number. The first two words contain the high and low 16 bits of the physical address of the rest of the object (if it is more than four words long). Besides the processor, the FPGA implements a set of I/O devices:
|