Design of RISC Processor Using VHDL and Cadence
Design of RISC Processor Using VHDL and Cadence
Cadence
Saeid Moslehpour#1, Chandrasekhar Puliroju#2, Akram Abu-aisheh#3
#1,#2#3
Department of Electrical and Computer Engineering, University of Hartford, West Hartford, CT
#1
[email protected]
#2
[email protected]
#[email protected]
programs. It is also important to show that a VHDL model can
Abstract— The project deals about development of a basic be represented in a working PSpice schematic. Each part of a
RISC processor. The processor is designed with basic processor, whether it be an Arithmetic Logic Unit or a simple
architecture consisting of internal modules like clock generator, Program Counter- has a specific set of input and output logic
memory, program counter, instruction register, accumulator,
that can be emulated from PSpice. If the logic is already
arithmetic and logic unit and decoder. This processor is mainly
used for simple general purpose like arithmetic operations and known to the user, then the user does not have to build the part
which can be further developed for general purpose processor by using each individual logic gate. Instead, a circuit designer can
increasing the size of the instruction register. The processor is create a PSpice part that gives the desired logical outputs.
designed in VHDL by using Xilinx 8.1i version. The present Most importantly, this study can help bridge a gap between
project also serves as an application of the knowledge gained those who simulate with VHDL and those who use PSpice.
from past studies of the PSpice program. The study will show
how PSpice can be used to simplify massive complex circuits
designed in VHDL Synthesis. The purpose of the project is to III. METHODOLOGY
explore the designed RISC model piece by piece, examine and The following VHDL synthesis model provided is an
understand the Input/ Output pins, and to show how the VHDL attempt toward a RISC processor. First, a data path module of
synthesis code can be converted to a simplified PSpice model. The the processor will be shown which clearly shows how the
project will also serve as a collection of various research
materials about the pieces of the circuit.
individual modules are going to send the data from one
module to the other and then a screenshot will be shown of the
top-module view to show each piece of the processor from an
I. INTRODUCTION
outside perspective (with view of all modules)
The present project serves as an application of the
knowledge gained from past studies of the PSpice program.
The study will show how PSpice can be used to simplify
massive complex circuits. In other words, the study will
involve the breakdown of a complex circuit designed by a
graduate student at the University of Hartford. The circuit is a
VHDL Synthesis Model of an 8-bit processor. The purpose of
the project is to explore the designed processor model piece by
piece, examine and understand the Input/ Output pins, and to
show how the VHDL synthesis code can be converted to a
simplified PSpice model. The project will also serve as a
collection of various research materials about the pieces of the
circuit. Background information will be given to give the
reader a basic understanding of the parts to support the further
exploration in the project methods. This report is useful for
students who would like to know more about the PSpice
program and how it is useful for many educational purposes.
A. CLOCK GENERATOR
Figure 2 Screenshot of VHDL synthesis top module
C. ACCUMULATOR
F. MULTIPLEXER
Figure 6 Memory
A decoder provides the proper sequencing of the system. It
has clock, fetch, clock2, reset, zero instructions and opcode as
inputs and load_ir, load_pc, mem_rd, mem_wr, load_acc as
outputs. The zero bit should be set whenever the accumulator
is zero.
The decoder issues a series of control and timing signals.
Depending on the opcode it decodes after it receives from the
instruction register. The decoder is a simple finite state
machine which consists of states. During the first state it
generates control signal for address setup. The address bus is
setup and the contents of the program counter are transferred
on to the address bus. The instruction fetch is generated in the
Figure 8 Multiplexer second state and the instruction is read from the memory with
the memory read signal and transferred on to the data bus.
The address multiplexer decides one output out of the two When the third state starts the instruction is loaded with the
given inputs. When the fetch signal is high, the address of the ld_ir being high into the instruction register. The opcode is
program counter is transferred on to the address buses and sent to the decoder and the appropriate control and timing
hence instruction is fetched. But if low, the operand address signals are initiated for the execution cycle. This is done in the
specified in the address field of the instruction register is next state in which it remains idle during the decoding of the
transferred onto the address bus and consequently fetched. opcode.
The fetch cycle ends and the program counter is
G. PROGRAM COUNTER incremented with the inc_pc signal. The execution cycle starts
and the address is again setup in the fifth state, but this time
instruction registers address field is loaded onto the address
bus. The operand is fetched in the sixth state with the mem_rd
signal being high and the data id is transferred onto the data
bus and given to the ALU for processing. In the seventh state
the ALU is given its alu_clock amd in synchronization with
the falling edge of the clock the respective operation is
performed. In the last state the decoder issues an ld_acc signal
to store the result into the accumulator.
It is a 5-bit general purpose register. The program counter This section will cover how to successfully convert a
points to the next micro instruction to be fetched from the VHDL synthesis model to a working PSpice part. First, the
memory. In case of an unconditional branch the said address is user would have to extract the program to C:\Program Files.
loaded into the program counter for fetching of that This part is important because the program will not work
instruction. Normally, after the fetch cycle is completed the unless it is extracted to the specified directory. It will create a
program counter is incremented and now thus points to the directory in C:\Program Files called VHDL2PSpice. The
next instruction. contents of the folder will show all the necessary files.
The folders created are Capture Symbols, DelphiExamples,
Library, and Source. These folders are necessary for the
H. DECODER program to save the appropriate Capture Model symbols and
library files.
- Now, the user should open the Lattice Synplify program.
Once in the program, click FILE -> NEW -> and start a new
project.
The window shown above should pop-up onto the screen.
- Click Project File and give the project a name.
- NEXT, a project interface screen will show up. Right click
on the project and click add source file.
IO B U F F E R
U5
Figure 18 Input/ Output Buffer, [10]
1 11
2 C LK ALO U T0 12
3 RST ACO U T7 13 MRD: Memory Read, allows the data held in the buffer to be
4 LD AC ACO U T6 14 passed out of MDAT 7:0.
5 ALO U T7 ACO U T5 15 FCH: Allows the device to be written to with the 8-bit data
6 ALO U T6 ACO U T4 16 word of ALOUT 7:0
7 ALO U T5 ACO U T3 17 CLK2: Clock signal that runs the part (rising clock edge)
8 ALO U T4 ACO U T2 18
ALO U T3 ACO U T1 H. CONVERTED MULTIPLEXER
9 19
10 ALO U T2 ACO U T0
ALO U T1 U8
1 9
ACCUMULATOR 2 A D PC 4 A D IR 1 1 0
Figure 16 Accumulator, [10] 3 A D PC 3 A D IR 0 1 1
4 A D PC 2 F C H 1 2
CLK: clock pin runs the accumulator, since in theory the 5 A D PC 1 A D M EM 4 1 3
6 A D PC 0 A D M EM 3 1 4
accumulator is made up of latches.
7 A D IR 4 A D M EM 2 1 5
RST: Resets the accumulator to an ‘empty state’ A D IR 3 A D M EM 1
LDAC: When this pin is asserted the accumulator is loaded 8 1 6
A D IR 2 A D M EM 0
with the value that flows through ALOUT (input pins)
ALOUT: This 8-bit set of pins is the data passed from the MUX
ALU Figure 19 Multiplexer, [10]
ACOUT: This 8-bit set of output pins sends a value to the ADPC 4:0: PC address to be sent to memory and Instruction
ALU for operation. register.
F. CONVERTED DECODER
I. CONVERTED MEMORY
U9
1 16
2 MRD ED AT6 17
3 MW R ED AT5 18
4 EW R ED AT4 19
5 RST ED AT3 20
6 MAD4 ED AT2 21
7 MAD3 ED AT1 22
8 MAD2 ED AT0 23
9 MAD1 MD AT7 24
10 MAD0 MD AT6 25
11 EAD4 MD AT5 26
12 EAD3 MD AT4 27
EAD2 MD AT3 Figure 22 Output I
13 28
14 EAD1 MD AT2 29
15 EAD0 MD AT1 30
E D A T7 MD AT0
MEMORY
Figure 20 Memory, [10]
M D [7 -0]
IR [4 -0 ] U 4
U 1 P [4-0 ] U 2 1 16 A C 4
1 8 1 4 U 11 M D 7 2 A C L K AC O U T 4 17 A C 3
2 P C LK A D IR 0 9 P 4 2 R S TR EQ C LK 2 5 A L[7 -0] 1 11 M D 6 3 M D A T7 AC O U T 3 18 A C 2
3 R ST A D PC 4 10 P 3 3 C LK F C H 6 2 C LK A LO U T0 12 A C 7 M D 5 4 M D A T6 AC O U T 2 19 A C 1
IR 4 4 LD P C A D P C 3 11 P 2 C LK 1 R S T 3 R ST A C O U T7 13 A C 6 M D 4 5 M D A T5 AC O U T 1 20 A C 0
IR 3 5 A D IR 4 A D P C 2 12 P 1 A L7 4 LD A C A C O U T6 14 A C 5 M D 3 6 M D A T4 AC O U T 0 21 A L7
IR 2 A D IR 3 A D P C 1 P 0 C LK G EN A L6 A LO U T7 A C O U T5 A C 4 M D 2 M D A T3 A L O U T 7 A L6
6 13 5 15 7 22
IR 1 7 A D IR 2 A D P C 0 A L5 6 A LO U T6 A C O U T4 16 A C 3 O C [2 -0 ] M D 1 8 M D A T2 A L O U T 6 23 A L5
A D IR 1 A L4 7 A LO U T5 A C O U T3 17 A C 2 M D 0 9 M D A T1 A L O U T 5 24 A L4
IR 0 A L3 8 A LO U T4 A C O U T2 18 A C 1 O C 2 10 M D A T0 A L O U T 4 25 A L3
P RO G R A M C O U N T E R A L2 9 A LO U T3 A C O U T1 19 A C 0 O C 1 11 O P C D 2 A L O U T 3 26 A L2
A L1 10 A LO U T2 A C O U T0 O C 0 12 O P C D 1 A L O U T 2 27 A L1
A LO U T1 13 O P C D 0 A L O U T 1 28 A L0
A C [7 -0] 14 A C O U T7 A L O U T 0 29 O U T
A L0 A C C U M U LATO R A C O U T6 Z R
15
A C O U T5
AL U
O F F TIM E = 5u S D S T M 1 A C 5
O N T IM E = 5 u S A C 6
C LK
D E LA Y = 0 A C 7
S TA R T V AL = 0
O P P VAL = 1
D S TM 4
S 1 R ST
0s 0
Figure 22 Output II
R E P E A T 1 T IM E S
+ 4 u s IN C R B Y 1
E N D R E PE AT
M EM O R Y
E D A T7
D S TM 2 E AD [4 - 0 ]
S 8
0 s 000 000 00
R E P E A T 2 4 T IM E S
+ 2 u s IN C R b y 0 0 0 0 0 0 0 1
E N D R EP EA T
D STM 3 E D AT[7 - 0 ]
S 8
0s 0000 000 0
R E P E A T 2 4 T IM E S
+ 2u s IN C R by 0 00 00 00 1
E N D R E PE AT
U 6
1 1 1
2 M R D A LO U T0 1 2 M D 7
3 F C H M D A T7 1 3 M D 6
A L7 4 C LK 2 M D A T6 1 4 M D 5
A L6 5 A LO U T7 M D A T5 1 5 M D 4
A L5 6 A LO U T6 M D A T4 1 6 M D 3
A L4 7 A LO U T5 M D A T3 1 7 M D 2
A L3 8 A LO U T4 M D A T2 1 8 M D 1
A L2 9 A LO U T3 M D A T1 1 9 M D 0
A L1 10 A LO U T2 M D A T0
A LO U T1
A L0 IO B U F F ER
U 7
1 11
2 C LK M D A T0 12 IR 4
3 R S T A D IR 4 13 IR 3
M D 7 4 LD IR A D IR 3 14 IR 2
M D 6 5 M D AT7 A D IR 2 15 IR 1
M D 5 6 M D AT6 A D IR 1 16 IR 0
M D 4 7 M D AT5 A D IR 0 17 O C 2
M D 3 8 M D AT4 O P C D 2 18 O C 1
M D 2 9 M D AT3 O P C D 1 19 O C 0
M D 1 10 M D AT2 O P C D 0
M D AT1
M D 0 IN S R E G
U 8
1 8
2 C LK 1 LD IR 9
3 C LK 2 LD A C 1 0
4 F C H M R D 1 1
O C 2 5 R S T M W R 1 2
O C 1 6 O P C D 2 LD P C 1 3
O C 0 7 O P C D 1 PC L K 1 4
O P C D 0 AC L K
D EC O D E R
U 9
P4 1 9 IR 1
P3 2 A D PC 4 A D IR 1 1 0 IR 0
P2 3 A D PC 3 A D IR 0 1 1
P1 4 A D PC 2 F C H 1 2 AM 4
P0 5 A D PC 1 A D M EM 4 1 3 AM 3
6 A D PC 0 A D M EM 3 1 4 AM 2
7 A D IR 4 A D M EM 2 1 5 AM 1
8 A D IR 3 A D M EM 1 1 6 AM 0
A D IR 2 A D M EM 0
IR 2
IR 3 M U X
IR 4
VI. RESULTS
REFERENCES
[1] mackido.com – What is Risc. Retrieved November 2006
http://www.mackido.com/Hardware/WhatIsRISC.html
Figure 21 Output IV [2] Risc Architecture. Retrieved: November 2006
http://www.geocities.com/SiliconValley/Chip/5014/arch.html
VII. CONCLUSION [3]aallison.com – Brief History of RISC. Retrieved:
November 2006
The first problem to note was that halfway through the
http://www.aallison.com/history.htm
components; the synthesis program gave “warnings” yet still
[4] VHDL and Verilog. Retrieved November 2006
synthesized the files. These warnings only existed with the IO
http://course.wilkes.edu/Engineer1/
BUFFER, MULTIPLEXER, and MEMORY. The program
[5] IEEE.ORG – Vhdl Synthesis model. Retrieved November
stated that there were illegal statements/declarations.
2006
However, the parts of the project that were successfully
http://www.ewh.ieee.org/soc/es/Nov1997/01/INDEX.HTM
synthesized proved to work with the CAPTURE program just
[6] RCore54 Processor. Retrieved: November 2006
fine. Another problem lies in the program’s disregard to the
http://www.ht-lab.com/freecores/risc/risc.html
synthesis errors. When a part is created from the synthesis file,
[7] PSpice (Copyright © 1985 - 2004 Cadence Design
the running part will crash the software. This error was not
Systems, Inc)
fixed, as it wasn’t a PSpice software error, or an error with the
-PSpice Online Manual Retrieved: September 2006 (As
VHDL2PSpice program. The problem existed in the VHDL
shown in Appendices)
errors. It is not known whether the errors are small or large, or
(Copyright © 1985 - 2004 Cadence Design Systems, Inc)
whether or not the parts are complete. However, the project
[8] Sreeram Rajagopalan – Mixed Level and Mixed Signal
goal has still been met. VHDL parts can successfully be
Simulation using PSpice A/D and VHDL
converted to PSpice and can be displayed and simulated in a
VHDL2PSpice Utility.
schematic. Given fully functional code, a complete processor
VHDLPSpice_CDNLive_Sreeram.pdf
would have been assembled and simulated. It is possible to
[9] Chandrasekhar Puliroju –VHDL synthesis models used in
connect all of the modules just as the VHDL top module,
this study.
however without working code; there is no reason to attempt
[10] Christopher L Spivey , “Creating PSpice Parts with
to simulate the modules. Also, the RISC design provided
VHDL Models.” EL 482: Senior Project Report, Fall 2006.
contained no set of pre-programmed code or language. The
model seemed to only be an empty shell of what a RISC
processor looks like from an outside perspective. The project
can be deemed a failure in terms of building a fully functional
processor, however the bridge between PSpice and VHDL has
been met. The knowledge has been gained on how to convert
the VHDL modules to PSpice. However the VHDL
programmer must be sure that the code is fully functional.
There is no software known as of yet that will convert PSpice
to VHDL.