| September 17 | |
| October 19 | |
| October 20 |
Due: 03:30pm, October 22
| From: | Jake Ivring; CTO | UnicationITY, Inc. |
| To: | Cob Bolwell; Principle | FlexGermanica Technical, LLC. |
Dear Cob,
Our revenues are getting hit by the knock-off clones from our low-cost rival, Boatorola Corp. The business strategist from Underson Consulting says our only hope for survival is to patent every aspect of our product. However, since many of the components are standard, there is nothing to patent. We need to redesign each piece so that it explores non-standard parts of the design space, which being new, will give our patent attorneys fodder for patent filings. Then when Boatorola copies us, we litigate for patent infringement!
We are hoping that you can pull together a team that can provide us with a new instruction set architecture that looks novel enough that we will have ample material to patent. We suggest as a start that you use a 17-bit fixed instruction size and 34-bit word size; that combination may help you explore a new design space. Furthermore, Boatorola has access to the MIPS and SPARC patent portfolio, so try not to be too similar to them. Of course, our products still need to be competitive, so the ISA should be general purpose and reasonably efficient. Also, since the fuse is relatively short on this, you will need to keep it simple. Your compensation will be based on the correctness, novelty and efficiency of the end product.
Thanks in advance,
Jake
As you read in Jake's letter, you should save your company by designing a novel processor in one month. You will first focus on the design of your own ISA. Your ISA should be general enough to run all the provided benchmark programs, while being simple enough to allow you to implement a reasonably fast processor in the allotted time frame. Then, you will implement two essential components for architectural validation and verification -- assembler and simulator. An assembler translates your program written in your assembly language into binary code; a simulator performs a simulation upon a provided binary code. Collectively, they form essential infrastructure for your processor design. For the implementation of the assembler and the simulator, you are free to choose any high level language (including scripting languages).
Ultimately your ISA and resulting implementation will be evaluated according to the following criteria:
Is it able to execute the provided benchmark programs, and other general purpose programs?
How much is it different from existing ISAs such as MIPS or SPARC? Creativity will be rewarded. Creativity that leads to a good, clean, and original ISA design, even more so.
How long does it take to run benchmark programs on your processor?
I/O instructions have blocking semantics. If there is no data available to read by the in instruction, the processor simply waits until there is available data. Similarly, upon an out instruction, the processor must wait until the write operation completes; it might need to wait for available buffer space. You can freely use channels for various purposes such as debugging and multicore interface.
MEMORY_INITIALIZATION_RADIX=16; MEMORY_INITIALIZATION_VECTOR= 00000, 00001, 00002, 00003, 00004, 00005, ....., 1DEAD EOF
MEMORY_INITIALIZATION_RADIX=16; MEMORY_INITIALIZATION_VECTOR= 000000000, 000000001, 000000002, 000000003, 000000004, 000000005, ........., 3DEADBEEF EOF
The first line in each output file specifies the numerical format used in the file. We use hexadecimal notation. Note that each entry of the 'MEMORY_INITIALIZATION_VECTOR' is data for each word, starting from address 0x0. Thus an entry of the instruction memory is 17-bit, while that of the data memory is 34-bit. These output files will be used as inputs to your simulator as well as coregen utility which generates SRAM modules in Xilinx ISE.
Since a *.coe file always start out at 0x0, you must fill out unused memory area from 0x0 to -text_addr or -data_addr with arbitrary values (typically 0x0). However, for other unused memory locations, you do not need to specify values; unspecified memory locations will have arbitrary values.
The assembler will generate two files - garbage_i.coe and garbage_d.coe, the function in garbage.s will be directly located at 0x0 of the instruction memory and 0x0 of the instruction memory, respectively.
Now that you have an easy way to generate machine code, it is time to implement a simulator. With a simulator, you can 1) easily verify your ISA without actually implementing hardware, 2) debug your application without having actual hardware, and 3) improve your ISA by spotting performance bottlenecks in benchmark programs. Your simulator operates instruction by instruction; you must be able to execute instructions one by one and watch all the programmer visible states (eg. register, memory, ...) at a certain time when the execution of an instruction is completed.
In this project, we also provide you a simple simulator framework to save your time in developing the simulator running your new ISA. You may find the detailed description about the simulator here. The source for the simulator framework is here
Two benchmarks are provided to help guide your ISA development. You need to write assembly programs based on your ISA for all the benchmarks. Assume that all the addresses (pointers) and data in the benchmark programs are 34 bits.
// Recursive Fibonacci
// get 'n'th fibonacci number
// You should not alter the algorithm
int fib(int n)
{
if (n < 0)
return 0x3DEADBEEF;
else if (n <= 2)
return 1;
else if (n == 29)
return 514229;
else if (n == 30)
return 832040;
else if (n == 48)
return 4807526976;
else if (n == 49)
return 7778742049;
else return fib(n-1) + fib(n-2);
}
// function supergarbage:
// perform various operations
//
// opcodes
// 0: subtract
// 1: right shift
// 2: nor
// 3: swap
// 4: in
// 5: out
// 6: conditional jump with link
// 7: halt
//
// note: int is 34 bits
struct inst {
int op;
int srcA;
int srcB;
int dest;
};
int SuperGarbage(int pc, int *mem)
{
while(1)
{
struct inst *instruction = &(mem[pc]);
int op = instruction->op;
int srcA = instruction->srcA;
int srcB = instruction->srcB;
int dest = instruction->dest;
pc = pc + 4;
switch(op) {
case 0: mem[dest] = mem[srcA] - mem[srcB]; break;
case 1: mem[dest] = mem[srcA] >> 1; break;
case 2: mem[dest] = ~(mem[srcA] | mem[srcB]); break;
case 3: temp = mem[srcB]; mem[dest] = mem[mem[srcA]]; mem[mem[srcA]] = temp; break;
case 4: in mem[dest], mem[srcA]; break; // in mem, channel #
case 5: out mem[srcA], mem[srcB]; break; // out data, channel#
case 6:
mem[dest] = pc;
if (mem[srcA] < 0)
{
pc = mem[srcB];
}
break;
case 7: return pc;
}
}
}
The SuperGarbage benchmark is a virtual machine that can execute SuperGarbage applications. The following table provides some SuperGarbage applications that helps to validate your implementation. Each SuperGarbage applications may get inputs from input channel #2 and #3. You may test your SuperGarbage VM implementation with the following steps:
| Benchmark | Assembly File | Coe File (load it as data) | Input | PC | Reference Output | |
|---|---|---|---|---|---|---|
| Channel #2 | Channel #3 | |||||
| 10, 40 | 0x6, 0x4, 0xb, 0x1 | 0x5, 0x1e | ||||
| 10, 40 | 0x1f | 0x1f, 0x1e, 0x1e,0xcb21e,0x1d,0x1d, 0x7d8b5,0x1f,0x148ad3,0x148ad3,0x1e | ||||
| 10, 40 | 0xfa1, 0x5, 0x4, 0x2, 0x3, 0x5, 0x1 | 0x1,0x2,0x3,0x4,0x5,0x1e | ||||
Before the submission of your report, you should evaluate your instruction set architecture and also revisit your design decisions if necessary.
The first evaluation of your design to pass is a simple instruction test. Write a simple assembly program which uses all the instructions in your ISA. Your ISA will be tested using SuperGarbage and Fibonacci benchmarks. Generate a COE file with your assembler, and verify that benchmark successfully handles all the instructions in a behavioral simulation. Try to make your test program as concise as possible while it covers all the instructions.
Since "instruction count" is one of the three factors affect the execution time, you should run all the benchmark applications and get the dynamic instruction count for each benchmark. You may use the 'count' command of your ISA simulator to get this number.
If you cannot complete you lab on time, you can turn it in late, but your grade will be penalized. The penalty is one letter grade per 24 hours extension. Up to 2 extensions are possible. For example, if the labs are due at 5pm, you have until 5pm the next day to turn it in with one letter grade penalty, and until 5pm the day after to turn it in with a two letter grade penalty, and so on.
| Deliverable |
|
Due: 03:30pm, October 22 |