Giter Site home page Giter Site logo

ahmad-zaklouta / pipeline-risc-cpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mido3ds/pipeline-risc-cpu

0.0 1.0 0.0 27.67 MB

Design and VHDL implementation of RISC CPU with 5 stages pipeline

Python 2.61% Assembly 3.33% Shell 1.36% VHDL 47.05% Stata 45.65%

pipeline-risc-cpu's Introduction

Pipelined RICS Processor

Design and VHDL implementation of RISC CPU with 5-stage pipeline.

Team #4

Name Section B. N
Evram Youssef 1 9
Remonda Talaat 1 20
Mahmoud Adas 2 21
Mohamed Shawky 2 16

Requirements

  • docker 19.03.6
  • GNU bash 4.4.19(1)-release
  • gtkwave (only to view simulation output) 3.3.93
  • python3

After Installing Docker

  1. Run Docker Daemon

    $ sudo systemctl enable --now docker

  2. To run docker without sudo (https://docs.docker.com/engine/install/linux-postinstall/):

$ sudo groupadd docker
$ sudo usermod -aG docker $USER
$ newgrp docker

Run vunit tests

  • To compile and run all vunit tests:

    $ ./run-test

  • To compile and run vunit test y.vhdl in directory test :

    $ ./run-test y

View waveform

  • If file y.vhdl has test case with name some_test_name , you can view its waveform (after ./run-test ) with:

    $ ./wave y.some_test_case

$ ./list-tests lists all available test cases.

  • If y.vhdl is not vunit test file, then type $ ./wave y

View vunit logs

To view logs of test case some_test_name of file y.vhdl :

$ ./logs y.some_test_case

Playground

Run any assembly you want on the cpu simulation, just give it to playgournd script from the stdin, and it will compile test/main_tb.vhdl and run the cpu till hlt (you should add 'end' instruction at the end).

playground script dumps the ccr, reg-file and data-mem at the end to out/{ccr,data_mem,reg_file}.playground.out.

$ printf 'and r0, r1, r2 \n end' | ./playgournd

$ ./playgournd <input/full_test/Branch.asm

Assembler

$ ./scripts/asm < /path/to/input.asm > /path/to/output.binary

Modelsim Folder Structure

  • modelsim_tests_do : contains the following :
  1. cases : the provided test cases assembly. An END instruction is added to mark the end of each section, in order to end the simulation.
  2. cases_binary : the file that contains binary code from assembler.
  3. cases_do_memory : do files to initially load instructions in memory one by one.
  4. cases_hex : same as cases_binary but in hex.
  5. cases_mem : modelsim memory files to be loaded directly to the simulation.
  6. cases_with_NOP : same as cases but with NOPs added to test disabled hazard handling.
  7. do_files : contains do files for all provided test cases inside MAIN folder. However, MAIN with NOP folder contains do files for cases tested with NOPs.
  8. scripts : some python scripts to automate memory loading do files.
  9. waves : screenshots of the waves produced by all provided test cases.

Modelsim Usage

  • For using modelsim with provided test cases :
  1. Copy all vhdl files to a new modelsim project and compile them.
  2. Run the do file corresponding to the cases from modelsim_tests_do/do_files/MAIN/*.
  3. You might need to change the path of the .mem file in do file to correspond to memory files in modelsim_tests_do/cases_mem or simply add cases_mem folder to your modelsim project.
  • For using modelsim with other test cases :
  1. Copy all vhdl files to a new modelsim project and compile them.
  2. Create the binary file from assembler.
  3. Load memory file to modelsim one by one.
  4. Execute the desired do file.

pipeline-risc-cpu's People

Contributors

darkgeekms avatar evraa avatar mido3ds avatar remondatalaat avatar

Watchers

 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.