Description
Introduction:
In this class we will develop and simulate a simple, pipelined ARM microprocessor. Labs #1 & #2 build some basic components of the processor, then labs #3 and #4 create full processors from these pieces.
Building on what you learned from 271, we will use Quartus II and Modelsim for development and testing of your designs. Your processor will mostly be structural (explicit gates and Boolean equations), though the control logic in labs #3 and #4 can be done in RTL (always blocks).
Getting Started:
Also on the website is the 271/469 Verilog Tutorial – although I use it for 271, it is set up to contain everything 469 students need to know about Verilog. Go through the tutorial and refresh your memory on each of the elements in there. There are some you might not have used before, such as generate statements, which will come in very handy in this class.
Register File:
Read Register 1 and Read Register 2 select the registers whose values are output on the Read Data 1 bus and Read Data 2 bus respectively. The Write Register input bus selects the target of the write; when RegWrite is true at the rising edge of the clock, the information on the Write Data bus is written into that register.
Implementation:
A simple implementation of the 32 by 64 ARM register file can be made using registers composed of D flip-flops, a 5:32 enabled decoder, and two large 32×64 to 64 multiplexors. This is shown in the following block diagram (note that the clock is omitted for clarity).
Each register is simply an array of 64 D flip-flops with enables:
Where the D input of each D flip-flop corresponds to a single bit in the 64 bit data input bus and the Q output of each D flip-flop corresponds to the appropriate bit in the 64 bit data output bus. The enable of every D flip-flop is connected to the same write enable input signal. This element will also receive a clock input, which synchronizes the registers. Note that the clock and the write enable are separate signals. The clock is a pure, periodic signal with no glitches or other weird behaviors.
The decoder selects which register receives the RegWrite control signal as its enable input. When a register is not selected its enable input should be false. Also note that the most significant output line of the decoder is disconnected in the block diagram for the register file. This is because the 31 register is hardwired to zero so it does not need a write enable input. In fact, instead of using a register, you can just hard-code the inputs to the output muxes for register 31 to all zeroes.
The most difficult part of this lab is constructing the large 64×32:1 multiplexors. One way to do this is to first construct a 32:1 multiplexor and use 64 of these 32:1 multiplexors to construct the larger 64×32:1 mux.
Note that your code for this unit (and in fact all elements of your CPU unless stated otherwise in the lab) CANNOT have any RTL code in it. You can use generate statements (and in fact this is the perfect time to use generate statements..)., You can use “always” blocks for strictly wiring purposes (connecting one signal to another), but no always statements with logic, no always with if statements, etc. All logic in the datapath must be in basic gates, like AND, OR, NAND, NOR, XOR, etc. You cannot even do math operations (+, -, *), nor equality tests (==, !=) – in lab #2 we will build these elements from scratch.
Lab Requirements (applies to all labs)
1.) Use the file “regstim.v” as your testbench. You should alter the testing as necessary to make sure your unit works. The TAs will have their own testbench for use during the demos, so you must make sure your register file takes the same inputs & outputs, in the same order, as is presented in the provided testbench.
3.) All gates must have at most 4 inputs. You can have procedures with more inputs (and can build larger gates up this way), but the basic gates you will build your circuit out of cannot have more than 4 inputs.
4.) All gates must be given a delay of 50ps. Processor performance won’t be a grading criteria for the class (unless you do really ridiculous things), but you need delay to show how things behave.
always_ff @(posedge clk) if (reset)
q <= 0; // On reset, set to 0 else
q <= d; // Otherwise out = d endmodule
6.) Use this structure to build up all the other stateholding elements and registers in your project.
7.) When we get to labs 3 and 4, you can do the control logic in RTL, or as dataflow (assign statements). The datapath cannot be behavioral at all, except for the DFF, but the control can be built any way you choose.
8.) Your submission should include the files needed to run ModelSim on your design, including a runlab.do file that executes the entire design, and a wave file that sets up the windows properly to illustrates all register contents, output and input ports, clock and reset.
Turn In:
** DEMOS ARE REQUIRED, WHETHER YOUR LAB WORKS OR NOT ** If you do not demo your assignment, you automatically get a 0. Missing your demo slot without prior approval will impose a late penalty on your entire lab.
1. Submit your project folder as a .zip file to the canvas assignment page. (Include all design, runlab, wave, benchmark, etc. files)
2. For labs done in partners, join an assignment group on Canvas (Navigate to the People tab in Canvas —> Click on the Lab Assignment Number —> Teammates should join an open group number e.g. Lab #2 Group 10) and submit one assignment as a group.
3. Make certain that your runlab and associated wave file for the demo includes waveforms for inputs and outputs as stated in the lab specification.




Reviews
There are no reviews yet.