Code Monkey home page Code Monkey logo

32-bit-risc-pipelined-processor's Introduction


Logo

32-bit Pipelined Processor Implementation

Implementation of a simple 5-stage 32-bit pipelined RISC processor and its assembler using VHDL and Python

Table of Contents

About The Project

The processor in this project has a RISC-like instruction set architecture. There are eight 4-byte general purpose registers, R​0​, till R7. Another two general purpose registers, one works as program counter (PC) and the other works as a stack pointer (SP), and hence, points to the top of the stack. The initial value of SP is (​2^11-1​). The memory address space is ​4 KB of 16-bit ​width and is word addressable. The bus between memory and the processor is 16-bit widths for instruction cache and 32-bit widths for data cache. When an interrupt occurs, the processor finishes the currently fetched instructions (instructions that have already entered the pipeline), then the address of the next instruction (in PC) is saved on top of the stack, and PC is loaded from address [2-3] of the memory (the address takes two words). To return from an interrupt, an RTI instruction loads PC from the top of stack, and the flow of the program resumes from the instruction after the interrupted instruction.

Assembler

A program written in Python that compiles sample assembly programs and generate the equivalent machine code hex files to be loaded into the CPU memory.

Running:

Open a terminal in the Assembler directory, then write the following command:

./assembler.exe "<.asm file relative path>"

Example:

./assembler.exe "test cases/Branch.asm"

Common Circuitry

The Common directory contains components that are used in most if not all the processor stages.

Data Hazard Detection Unit:

data-hazard-detection-unit

Fetching Stage

Dynamic Branch Fetching:

dynamic-branch-fetch

Register Fetching:

fetching-reg-fetch

Interrupt Fetching:

interrupt-fetch

PC Fetching:

pc-fetch

Decoding Stage

Control Unit Decoder:

control-unit-decode

Register File Decoder:

reg-file-decode

Execution Stage

ALU Execution:

alu-execute

Branch Detection Unit:

branch-detection

Memory Stage

sp-memory

Write Back Stage

write-back

Built With

Contributors

32-bit-risc-pipelined-processor's People

Contributors

mmmacmp avatar muhanadatef avatar naderabdalghani avatar sarahraafat15 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.