Giter Club home page Giter Club logo

mtkcpu's Introduction

Alt text

mtkCPU

mtkCPU is as simple and as clear as possible implementation of RiscV ISA in Amaranth HDL. There is one main file cpu.py, that is including specific units (i.a. decoder, adder etc.)

Features

  • implements basic ISA rv32i
  • Machine mode and User mode
  • traps and interrupts
  • CSR registers support
  • optional Virtual Memory System - allows for memory translation in User mode
  • Debug Module - can connect openOCD and GDB, compatible with Risc-V Debug Spec
  • bsp (board specific files) generation - based on RTL code it generates proper .h and .cc files

Supported hardware

The design was tested on ice40 FPGA on the iCEBreaker board.

Quick Start

See Quick Start Page and find out how simple it is to deploy fully functional mtkCPU with one command! We provide one-liner that generates a bitstream with Block RAM memory initialized with a specified .elf's content!

Test coverage

  • pure-assembly unit tests (more than 80 tests present, each instruction covered)
  • single-block testbenches
  • co-simulation with openOCD and GDB testing Debug Module
  • randomized tests (arithmetic and MMU) using riscv-dv framework from Google

Running simulation tests

pip3 install .
pytest -x -n4 mtkcpu/tests/

For more information about how tests work, please refer to that file.

About Amaranth HDL (previously nMigen)

Amaranth HDL is a Python framework for digital design, it can compile either to netlist understandable by yosys or Verilog code (that you can place and route using vendor tools, e.g. Vivado)

Amaranth HDL docs/tutorials

Acknowledgements

Some parts of mtkCPU were inspired by minerva CPU parts (LambdaConcept's property).

mtkcpu's People

Contributors

bieganski avatar styczynski avatar piotrstyczynski 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.