Instruction set design is hard. Prof. Dietz has designed dozens of instruction sets in the three decades he's been a professor, and it still isn't easy for him to get things right. Thus, rather than giving you complete freedom to design your own instruction set, we're going to walk through the design logic for a reasonably well-crafted one that he built specifically for Spring 2019 CPE480. However, this design is not complete -- each student must devise their own encoding of the instructions implement their own assembler using AIK: the Assembler Interpreter from Kentucky (which is also discussed here).
The instruction set for this semester is a rather strange thing called TACKY: the twin accumulator computer from Kentucky. Basically, it's a 16-bit VLIW machine and the two accumulators are just a sneaky way to compress the encoding of two instructions in one instruction word. Field 0 implicitly works on register $0 and field 1 implicitly works on register $1. The details of the instruction set are presented here.
TACKY is a completely 16-bit machine. Everything is 16 bits wide: instruction words, addresses, data, and each of the eight registers. It isn't even byte-addressed for memory. However, it is a fairly beefy processor in that it even supports floating-point arithmetic. Well, 16-bit floats. In sum, it's small enough to be feasibly implemented inside a single not-too-exotic FPGA... which we will not make you do, but again, is a nice possibility for the future.
I'm not going to repeat TACKY's instruction set here. Instead, again I'll simply point you at this TACKY reference. You will need to read and understand that document very thoroughly. Here are some things to keep in mind:
.inst $.r0 , .inst $.r1
.inst $.r0 , .inst $.r1 := .this:4 .r0:4 .inst:4 .r1:4 .alias .inst a b c d
z: a $5, b $6 c $3, d $2 b $4, a $4 c $3, 42-39 $2
//generated by AIK version 20180920 @0000 0516 2332 1404 2332 //end
It really isn't hard to deal with specifying the TACKY assembly language for AIK, but I strongly recommend you try to factor-out classes of instructions to single AIK specifications. For example, listing all possible pairs of instructions would otherwise produce a huge AIK specification. There are 17 types of pairable instructions, so there would be approximately 17*17 possible types of paired instructions -- there are over 250 different types of paired instructions!
Your project is simply to design the instruction set encoding and implement an assembler using AIK. Here's a simple test case:
.text .origin 0x0000 start: a2r $2, add $3 and $4, cvt $5 cf8 $6, here+0 ci8 $7, here+1 div $r0, jr $r1 jnz8 $r2, here+2 jp8 here+3 .data ; switch to data segment .origin 0x0080 here: .word 42 .text ; continue where we left off jz8 $r3, here+3 lf $r4, mul $ra li $rv, not $sp or $0, r2a $1 pre here+4 sh $2, slt $3 st $4, sub $5 sys here+5 xor $6, a2r $7
No, the above isn't a useful program. Worse still, I obviously can't show you sample output without giving-away how I've encoded the instructions....
The recommended due date for this assignment is before class, Friday, February 15, 2019. This submission window will close when class begins on Monday, February 18, 2019. I do not recommend that you spend Valentine's Day working on this project. You may submit as many times as you wish, but only the last submission that you make before class begins on Monday, February 18, 2019 will be counted toward your course grade.
Note that you can ensure that you get at least half credit for this project by simply submitting a tar of an "implementor's notes" document explaining that your project doesn't work because you have not done it yet. Given that, perhaps you should start by immediately making and submitting your implementor's notes document? (I would!)
For each project, you will be submitting a tarball (i.e., a file with the name ending in .tar or .tgz) that contains all things relevant to your work on the project. Minimally, each project tarball includes the source code for the project and a semi-formal "implementors notes" document as a PDF named notes.pdf. It also may include test cases, sample output, a make file, etc., but should not include any files that are built by your Makefile (e.g., no binary executables). For this particular project, name the AIK source file tacky.aik.
Submit your tarball below. The file can be either an ordinary .tar file created using tar cvf file.tar yourprojectfiles or a compressed .tgz file file created using tar zcvf file.tgz yourprojectfiles. Be careful about using * as a shorthand in listing yourprojectfiles on the command line, because if the output tar file is listed in the expansion, the result can be an infinite file (which is not ok).