All Projects → mhyousefi → MIPS-pipeline-processor

mhyousefi / MIPS-pipeline-processor

Licence: other
A pipelined implementation of the MIPS processor featuring hazard detection as well as forwarding

Programming Languages

Verilog
626 projects
python
139335 projects - #7 most used programming language
Coq
218 projects

Projects that are alternatives of or similar to MIPS-pipeline-processor

Icarus Verilog
This repo contains code snippets written in verilog as part of course Computer Architecture of my university curriculum
Stars: ✭ 28 (-69.57%)
Mutual labels:  verilog, computer-architecture
WebRISC-V
WebRISC-V: A Web-Based Education-Oriented RISC-V Pipeline Simulation Environment [PHP]
Stars: ✭ 74 (-19.57%)
Mutual labels:  pipeline, computer-architecture
doepipeline
A python package for optimizing processing pipelines using statistical design of experiments (DoE).
Stars: ✭ 18 (-80.43%)
Mutual labels:  pipeline
bitbucket-push-and-pull-request-plugin
Plugin for Jenkins v2.138.2 or later, that triggers job builds on Bitbucket's push and pull request events.
Stars: ✭ 47 (-48.91%)
Mutual labels:  pipeline
nanoseq
Nanopore demultiplexing, QC and alignment pipeline
Stars: ✭ 82 (-10.87%)
Mutual labels:  pipeline
targets-minimal
A minimal example data analysis project with the targets R package
Stars: ✭ 50 (-45.65%)
Mutual labels:  pipeline
k3ai-core
K3ai-core is the core library for the GO installer. Go installer will replace the current bash installer
Stars: ✭ 23 (-75%)
Mutual labels:  pipeline
blueocean-pipeline-editor-plugin
Jenkins Blue Ocean pipeline editor
Stars: ✭ 30 (-67.39%)
Mutual labels:  pipeline
Apos.Content
Content builder library for MonoGame.
Stars: ✭ 14 (-84.78%)
Mutual labels:  pipeline
cloud-native-pipelines
Cloud-native pipelines leveraging Concourse, Pivotal Build Service and Spinnaker to deploy apps
Stars: ✭ 15 (-83.7%)
Mutual labels:  pipeline
formal hw verification
Trying to verify Verilog/VHDL designs with formal methods and tools
Stars: ✭ 32 (-65.22%)
Mutual labels:  verilog
FPGA RealTime and Static Sobel Edge Detection
Pipelined implementation of Sobel Edge Detection on OV7670 camera and on still images
Stars: ✭ 14 (-84.78%)
Mutual labels:  verilog
pipen
pipen - A pipeline framework for python
Stars: ✭ 82 (-10.87%)
Mutual labels:  pipeline
pypiper
Python toolkit for building restartable pipelines
Stars: ✭ 34 (-63.04%)
Mutual labels:  pipeline
hyperdrive
Extensible streaming ingestion pipeline on top of Apache Spark
Stars: ✭ 31 (-66.3%)
Mutual labels:  pipeline
Geoweaver
a web system to allow users to automatically record history and manage complicated scientific workflows in web browsers involving the online spatial data facilities, high-performance computation platforms, and open-source libraries.
Stars: ✭ 32 (-65.22%)
Mutual labels:  pipeline
vim-hdl
Vim plugin to aid VHDL development (for LSP, see https://github.com/suoto/hdl_checker)
Stars: ✭ 59 (-35.87%)
Mutual labels:  verilog
open-solution-googleai-object-detection
Open solution to the Google AI Object Detection Challenge 🍁
Stars: ✭ 46 (-50%)
Mutual labels:  pipeline
SeqTools
A python library to manipulate and transform indexable data (lists, arrays, ...)
Stars: ✭ 42 (-54.35%)
Mutual labels:  pipeline
DFFRAM
Standard Cell Library based Memory Compiler using FF/Latch cells
Stars: ✭ 54 (-41.3%)
Mutual labels:  verilog

MIPS-pipeline-processor

Thanks for visiting this repository!

Developed during the Fall 2017 Computer Architecture Laboratory course at the University of Tehran, this project is an implementation of a pipelined MIPS processor featuring hazard detection as well as forwarding. This implementation is based on a limited ISA, the details for which are present in docs/MIPS_ISA.png. This code is synthesizable and can be run on an FPGA. We used Altera DE2 units for testing purposes. The implemtation has been verified using a relatively complex test program (found in instructions/example_source_code.txt).

MIPS pipelened processor

Getting Started

Download or clone the project, write your machine code to run (there already exists a default test program in the instruction memory), compile the Verilog files and and run testbench.v in a Verilog simulation environment such as ModelSim from Mentor Graphics.

Instruction format

Instructions should be provided to the instruction memory in reset time. We avoided the readmemb and readmemh functions to keep the code synthesizable. The instruction memory cells are 8 bits long, whereas each instruction is 32 bits long. Therefore, each instruction takes up four memory cells, as shown bellow.

For example, an add instruction: 10000000001000000000000000001010 or Addi r1,r0,10 will need to be given as

instMem[0] <= 8'b10000000;
instMem[1] <= 8'b00100000;
instMem[2] <= 8'b00000000;
instMem[3] <= 8'b00001010;

Converting your raw machine codes

A python script is provided under the instructions/rearrange_instructions.py directory which simply takes your machine code (in a specified format) and converts it to the format illustrated above.

Enable/disable forwarding

An instance of the top-level circuit is taken in testbench.v. The inputs of the MIPS_Processor include clk, rst, and forwarding_EN. Forwarding will be enabled if forwarding_EN is set to 1, and disabled otherwise.

Under the hood

There are five pipeline stages:

  1. Instruction Fetch
  2. Instruction Decode
  3. Execution
  4. Memory
  5. Write Back

Modular design

All modules are organized under the modules directory. The top level description can be found under topLevelCircuit.v. It contains a modular design of the processor and encompasses five pipe stages and four pipe registers, the description for which are present under modules/pipeStages and modules/pipeRegisters respectively. The register file, the hazard detection and the forwarding units are also instantiated in topLevelCircuit.v. Pipe stages are made of and encapsulate other supporting modules.

Constants

defines.v contains project-wide constants for opcodes, execution commands, and branch condition commands. It also contains constants for wire widths and memory specifications. You can change memory size values to suit your needs.

Wire naming convention

To maintain conformity, most wire names follow the format {wire description}_{wire stage}, where the second part describes the stage where the wire is located. For example, MEM_W_EN_ID is the memory write enable signal present in the instruction decode stage.

Contributions

Contributions are welcomed, both general improvements as well as new features such as a more realistic memory heirarchy or branch prediction. However, please follow the coding styles and the naming convention. Another useful contribution would be more comprehensive testing and verification and bug report.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].