Multi-Cycle TACKY

The following is a barely-tested sample solution that Prof. Dietz created for the multi-cycle implementation of this TACKY processor. It uses the slightly-mutant 16-bit top-half-of-32-bit-single floating-point implementation given here.

To begin, notice that the instruction encoding is slightly tricky. Basically, the idea was to separate-out the instructions into three easily recognized groups: ALU register operations, register operations not using the ALU, register with 8-bit immediate, and 8-bit immediate. The first two groups allow packing two instructions into one instruction word, the last two don't. The encoding was arranged so that the top 2 bits of the 5-bit first opcode field must be 2'b11 if the instruction stands alone. Those instructions are handled by their own unique states. The packed instructions are handled by the sequence of two states, Pack0 and Pack1, which is slower than it needs to be, but works with just one instance of the ALU -- and the ALU is pretty large, so that's not unreasonable. Note that the ALU also determines if the ALU operation was legal, and treats other packed operations as NOPs. Thus, every instruction word is processed fairly straightforwardly in either 3 or 4 cycles with Start and Decode common to all.


The following is the AIK assembler specification for how the opcodes are mapped in the Verilog code of the sample solution.

AIK source code:


And here's the Verilog code itself. Notice that VMEM 0 is used to initialize the reciprocal lookup table -- it needs to be there. The Harvard-style separate memories for instructions and data should normally be initialized to hold your test program, but here I've just explicitly intinialized a few registers and placed a few instructions in the instruction memory. This is a pretty sad test, and certainly not how you were supposed to test your code... but I want you to be working that out for yourselves. In fact, I don't promise this code is 100% correct, because I've semi-deliberately done very little testing of it. I don't want you blindly copying what I do: you can and should do better just using this as a starting point. ;-)

Verilog source code:

VMEM file contents:

VMEM 0:


The C program that generated this page was written by Hank Dietz using the CGIC library to implement the CGI interface.


The Aggregate. Advanced Computer Architecture.