Due: Friday, March 19 (after spring
break) at the close of lab (just hand your writeup to a TA).
You will do this lab alone
In this lab you will create some of the storage components for your R372 processor. Specifically, you will create the register file and the instruction and data memory modules. For this assigment you will use both schematics and VHDL.
Exercise 1: 8-entry 16-bit register file (50 points)
Use schematics to design an 8-entry 16-bit register file to the following specifications. First, here are the interface signals and buses:
The register file should have the following behavior:
You may design the internals of the register file as you wish but it would probably help if you used hierarchical design and reused some of the components you built in previous assignments, like decoders, muxes, and tri-state buffers.
Create test inputs and a timing diagram that show that your register file meets specifications. In the first 8 cycles, write the values 8-15 in registers 0-7, respectively. In the next 6 cycles, read the following register combinations: 0/1, 2/3, 4/5, 6/7, 7/6, and 2/2. Finally, show simultaneous reads and writes in the same cycle. First, write the value 16 into register 0, while simultaneously reading registers 2/3. Then, write the value 17 into register 1, while simultaneously reading registers 0/1. Show your design to the TA so that he/she can ask you some questions about it. Turn in your schematics and timing diagram.
Exercise 2: 16-bit Memory Blocks (50 points)
Xilinx provides two tools for creating and initializing small random access memories (RAMs): Core Generator and LogiBLOX. Look through the help files to learn how to use these tools. For this exercise, you will create RAM macros using either CoreGenerator or LogiBLOX and around them build schematics that behave like memories we can use in an R372 processor.
One of the problems with both CoreGenerator and LogiBLOX is that they can only build memories that have 256 (2^8) words. R372 is a 16-bit instruction set which means it can address 64K (2^16) words. The lower 32K (2^15) words are instruction memory, the upper are data memory. Does this mean that the memory implementations you will create will have 128 RAM macros each? No.
Your instruction memory will have a single RAM macro that houses the first 256 instruction words (addresses 0000-00ff). Access to any of the "missing" 127 RAMs will result in an error. This means that your instruction memory will only support programs with fewer than 256 static instructions. So what.
Similarly, your data memory will use two RAM macros. One will house the first 256 data words (addresses 8000-80ff). The other will house the last 256 data words (addresses ff00-ffff). Access to any of the "missing" 126 RAMs will result in an error. This means that your data memory will only support programs that use fewer than 256 heap words and fewer than 256 stack words. Again, so what.
Use one 256-by-16 synchronous RAM primitive and additional schematics to design an instruction memory macro with the following interface:
The instruction memory macro should have the following behavior:
Initialize the RAM using the memory file :eniac:~amir/cse371/r372/mbench/queens/queens.insn.mem. Show that your designs work by reading the following addresses from instruction memory: 0000, 0001, 0002, 0100, and 8000. Turn in your schematics and timing diagrams.
Use two 256-by-16 synchronous RAM primitives and additional schematics to design a data memory macro with the following interface:
The data memory macro should have the following behavior:
Leave DRAM0 and DRAM1 uninitialized. Show that your design works by first writing the following data into the corresponding addresses: aaaa into 8000, bbbb into 80ff, cccc into 8100, dddd into 0000, eeee into ff00, and ffff into ffff and then reading the following addresses. Turn in your schematics and timing diagrams.
Design a finite state machine that will copy the lower 256 words of instruction memory to the lower 256 words of data memory. The simplest way to do this is probably using registers a couple of registers and a couple of incrementers. Show your design to a TA so that he/she can ask you some questions about it. Turn in your schematics.