Giter VIP home page Giter VIP logo

aes_adl2_fpga's Introduction

Single cycle CPU - running on FPGA

Implement all instructions for RISC-V including Branch instructions. This repository will provide the automation flow for running the design into hardware.

Changes to make in cpu.v file:

There is a change in the interface of the cpu.v file in order for the evaluation backend to be able to check the registers via the registers port as shown below:

module cpu (
    input clk, 
    input reset,
    output [31:0] iaddr,
    input [31:0] idata,
    output [31:0] daddr,
    input [31:0] drdata,
    output [31:0] dwdata,
    output [3:0] dwe,
    output [32*32-1:0] registers  // EXTRA PORT

);

IMPORTANT: make sure the registers port is defined in the exact way shown above. Connect this port to the bit vector formed by concatenating all the registers. For example:

assign registers = {r[31], r[30], r[29], r[28], r[27], r[26], r[25], r[24], r[23], r[22], r[21], r[20], r[19], r[18], r[17], r[16], r[15], r[14], r[13], r[12], r[11], r[10], r[9], r[8], r[7], r[6], r[5], r[4], r[3], r[2], r[1], r[0]};

You may need to modify your register file module accordingly.

This change just enables the evaluation script to directly access the registers at the top level.

Steps to run:

  1. Clone this repository:
git clone https://gitlab.com/BalaDhinesh/cpu_fpga
cd cpu_fpga
  1. Update cpu.v and add all additional verilog module files you created (like regfile, alu etc). IMP: Do NOT add your versions of imem, dmem or any other file which was given with the problem statement. Only add cpu.v and other associated modules.

Update the list inside program_file.txt.

  1. Run the python file. This will take care of creating a block design on Vivado and generate bitstream.
python harness.py

Check the entire set of printed messages for any "ERROR" lines. If you see "ERROR" anywhere, that means the implementation failed.

  1. Once the bitstream has been generated successfully, following outputs are generated.
  • harness_axi_ip - IP generation. Leave this for now.

  • harness_axi_proj - Vivado project file.

  • PYNQ_cpu.tar - PYNQ Overlay(bitstream related) files.

  1. Open the FPGA Remote Jupyter server.
  • Upload the PYNQ_cpu.tar tar file
  • Open terminal in server and untar using
cd /home/xilinx/jupyter_notebooks
tar -xvf PYNQ_cpu.tar
  • Now run the cpu.ipynb file.

WARNING: [Vivado 12-8222] Failed run(s) : 'design_1_harness_axi_ip_v1_0_0_0_synth_1' If you get this error from the script, there is some problem in the cpu design. Look into this /harness_axi_proj/harness_axi_proj.runs/design_1_harness_axi_ip_v1_0_0_0_synth_1/runme.log file to debug the issue.

aes_adl2_fpga's People

Contributors

baladhinesh avatar shariethernet 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.