Skip to content

davidcpp-ython/RISC-Processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ RISC Processor Project

๐Ÿ“ Overview

This project implements a simple RISC (Reduced Instruction Set Computer) processor without pipelining. The processor operates with 32-bit instructions and 16-bit data. The design includes key components such as:

  • ๐Ÿงฎ ALU (Arithmetic Logic Unit)
  • ๐Ÿ“œ Register File (16 registers, 16-bit each)
  • ๐ŸŽฏ Program Counter (PC)
  • โš™๏ธ Control Units for Instruction Execution

The processor executes instructions stored in instruction memory and interacts with a data memory module.

This project is implemented using ๐Ÿ› ๏ธ Vivado for RTL synthesis and schematics, and the design is written in ๐Ÿ“œ SystemVerilog syntax.


๐Ÿ“– Instruction Set Architecture (ISA)

The processor supports 16 different instructions, each encoded in 32 bits with the following format:

Field Bits Description
๐ŸŽฏ Opcode 4 bits Operation Code
๐Ÿ“ Dest Addr 4 bits Destination Register
๐Ÿ”ข Operand0 Addr 4 bits First Operand Register
๐Ÿ”ข Operand1 Addr 4 bits Second Operand Register
๐Ÿ“ฆ Immediate Value 16 bits Immediate or Jump Address

๐Ÿ› ๏ธ Supported Instructions

Opcode Instruction Operation
0 NOP No operation
1 ADD R[dest] = R[op0] + R[op1]
2 SUB R[dest] = R[op0] - R[op1]
3 MULT R[dest] = R[op0] * R[op1]
4 SHIFT RIGHT R[dest] = R[op1] >> 1
6 AND R[dest] = R[op0] & R[op1]
7 OR `R[dest] = R[op0]
8 XOR R[dest] = R[op0] ^ R[op1]
10 VALUE LOAD R[dest] = immediate
11 JUMP PC = immediate
12 JUMP IF ZERO if Z_flag: PC = immediate
13 STORE (WRITE MEM) mem[R[op1]] = R[op0]
14 LOAD (READ MEM) R[dest] = mem[R[op0]]
15 HALT Stop execution

๐Ÿ’พ Memory Organization

  • ๐Ÿ—‚๏ธ Instruction Memory: 256 locations, each 32-bit wide.
  • ๐Ÿ“€ Data Memory: 65,536 locations, each 16-bit wide.

Instructions are pre-loaded into instruction memory using an initial block in the testbench.


๐Ÿงช Testing

The processor is verified using a testbench that initializes instruction memory with a simple program performing arithmetic and logical operations, followed by a conditional jump and halt.


About

Implementation of a RISC Processor without pipelining using SystemVerilog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published