

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


In this project you will implement an instruction inter- preter for the KURM09 (KU RISC Machine 2009 ) CPU that will serve as your semester project. This device is a simple 16 -instruction RISC-style CPU. As is traditional in a RISC ar- chitecture, a small number of highly efficient instructions and addressing modes will be defined. The ISA for the KURM is defined in a separate design document.
An instruction interpreter is a behavioral model of a CPU that is frequently used early in the design cycle to prototype the device. In many cases, the instruction interpreter will be used by software developers to start coding activities even before hard- ware prototypes or emulators are available. Your instruction in- terpreter will be used to familiarize yourself with the KURM design and to develop a test entity for use throughout the design process.
We will use a single VHDL entity activated by the clock signal to process instructions. Your entity should support a clock input and communication with a memory device. Parameters function as named. The datain and dataout ports are used to input and output data respectively. The address port is used to specify a source or destination address, depending on the opera- tion performed. The rd and wr ports are strobes that instruct the memory to output (rd) or store (wr) data respectively. The ready port is an input from memory that indicates when a memory op- eration has completed. The VHDL skeleton in figure 1 gives a template for implementing the interpreter.
entity cpu is port (datain: in word ; dataout: out word ; address: out word ; rd,wr: out bit; ready: in bit; reset,clk: in bit); end entity cpu;
Figure 1 : Entity template for the instruction interpreter. Items in italics are things you must implement.
To write to memory:
To read from memory:
eecs 443 – digital systems design laboratory 2 2
The clk input implements a standard clock and causes the ma- chine to read and execute the next instruction. The reset input is used to set the program counter to 0 , implementing a reset action.
A behavioral memory model is available on the course website under the Resources Page. There are two files you must include, a behavioral model of memory and a collection of memory utili- ties. See the source file for an example of how to use the memory model. It is extremely important to read the documentation in the memory model before you use it. You will find memory initializa- tion and dumping capabilities to help you test your system.
Your architecture should use variables to represent reg- isters and define each instruction over those registers. It should repeatedly fetch instructions from memory and execute them us- ing a case statement that uses the instruction to determine what option to select. Figure 2 provides a template for how your archi- tecture should be structured. First, define variables for registers and program counters. Then within a process, fetch, decode, and execute an instruction after waiting for a rising clock edge. This should be repeated indefinitely.
architecture interpreter of cpu is begin update: process Variables for registers and program counter begin Wait on a rising clock edge Fetch instruction from memory Decode the instruction Execute the instructions in a case statement end process update; end architecture interpreter;
Figure 2 : Architecture template for the instruction interpreter. Items in italics are things you must implement.
Exercise 1 Develop an entity model for the interface of KURM09. This entity should define all inputs into the KURM09 and outputs generated. This must include the interface to memory, the system clock, and the CPU reset. A template for this entity is provided in the lab description.
Exercise 2 Develop behavioral instruction interpreter architecture for KURM09. The instruction interpreter should be structured and behave like the instruction interpreter defined in the lab description. It should execute 1 instruction per clock cycle.
Exercise 3 Integrate the behavioral model with a memory module in a test entity. Create a test entity that includes your CPU model, a clock model, and the memory model provided. Define the interconnections between these components.
Exercise 4 Exercise the model to demonstrate correctness. Load one or more program into memory, reset the CPU and start the clock. When your program has terminated, dump the memory to assure correct execu- tion of the program. Note that your test programs should exercise your CPU model thoroughly.