GithubHelp home page GithubHelp logo

jg-fossh / mdu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeeshanrafique23/mdu

0.0 0.0 0.0 28 KB

M-extension for SERV RISC-V cores.

License: Apache License 2.0

C++ 26.53% Verilog 73.47%

mdu's Introduction

Multiplication and Division Unit -MDU

Join the chat at https://gitter.im/merledu/riscv-mdu

This multiplication and division unit is in compliance with RISC-V standard M-extension, which can be integrated with any existing RISC-V processor.

Two operands, function3, and a valid signal are fetched from the target processor and fed to the MDU. The function3 signal which is named as i_mdu_op, it decides that which operation MDU has to perform on the arrival of a valid signal as shown in the table below.

Instruction i_mdu_op
MUL 000
MULH 001
MULHSU 010
MULHU 011
DIV 100
DIVU 101
REM 110
REMU 111

Instantiation template

mdu_top
#(
  .WIDTH(32)
)i_mdu_top(
  .i_clk,  
  .i_rst,
  .i_mdu_rs1,
  .i_mdu_rs2,
  .i_mdu_op,
  .i_mdu_valid,
  .o_mdu_ready,
  .o_mdu_rd
);

Getting Started

MDU uses FuseSoC, which is a famous package manager and build abstraction tool for FPGA/ASIC development.

If the target core supports FuseSoC then you can easily add mdu as a dependency in .core file and making changes in RTL.

Demo: MDU integration with SERV

SERV is the world smallest bit-serial RISC-V core. It is famous because of its size and lumbering pace. The changes made for this integration can be tracked in PR #60.
SERV uses FuseSoC so it makes our work easier, you can run the SERV with MDU by simply following the steps below.

Create a directory to keep all the different parts of the project together. We will refer to this directory as $WORKSPACE from now on. All commands will be run from this directory unless otherwise stated.

Install FuseSoC

pip install fusesoc 

Add SERV as a separate library into the workspace

fusesoc library add serv https://github.com/olofk/serv

Now add MDU

fusesoc library add mdu https://github.com/zeeshanrafique23/mdu

If Verilator is installed, we can use that as a linter to check the SERV source code

fusesoc run --target=lint serv

If everything worked, the output should look like

INFO: Preparing ::serv:1.1.0
INFO: Setting up project

INFO: Building simulation model
INFO: Running

Now it's time to run SERV with MDU

fusesoc run --target=verilator_tb --flag=mdu servant

Note: All the FuseSoC commands should run from $WORKSPACE.

Acknowledgment

The integration of MDU with SERV was the part of Google Summer of Code 2021 project under the banner of FOSSI Foundation, it is completed by Zeeshan Rafique under the mentorship of Olof Kindgren. Special thanks to Olof Kindgren for helping me throughout the project.

mdu's People

Contributors

zeeshanrafique23 avatar jg-fossh avatar nickolayternovoy avatar gitter-badger 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.