Giter Site home page Giter Site logo

riscv-hs's Introduction

RISCV-HS

A logical model of a minimal RISC-V CPU written in Haskell.

This is an exercise to learn Nix, Haskell, and RISC-V. It is not intended to be useful, fast, or even complete.

The goal is to understand the inner workings of the RISC-V architecture from the bottom-up and learn Haskell concepts on the way. A possible outcome would be an emulator that can run RV32I assembly.

Requirements

Project structure

  • The structure of the project is dictated by the tools we are using, namely Nix and Cabal. This repository is both a Nix flake and a Cabal package and as such contains the following folders/files:
    • app/: Haskell source code for an executable that can be built and run by cabal run.
    • src/: Haskell library folder, each file inside is a Haskell module.
    • test/: Haskell source code for an executable that is built and run by cabal test, used to test the functions defined in src/.
    • CHANGELOG.md: This file will only become relevant in case of a release.
    • flake.nix: This is a Nix flake providing dependencies for the project.
    • flake.lock: File specifying the exact versions of dependencies, created by the nix flake lock command.
    • LICENSE: The Apache 2.0 license.
    • riscvs-hs.cabal: Cabal package description.
    • shell.nix: For compatibility with Nix without flakes as well as other tools.

Notes

References

The RISC-V Instruction Set Manual

riscv-hs's People

Contributors

kirschmet2 avatar gschult avatar ners avatar fricklerhandwerk avatar joto314 avatar

Stargazers

 avatar  avatar Dragos avatar

Watchers

 avatar  avatar

riscv-hs's Issues

Add boolean implication function

Implication is a binary function (e.g. a `implies` b)

  • add the function to the Bits library
  • test the function using property testing

Add project structure to readme

Please add a section in the readme that describes the project structure. This section should help people new to the project understand what each file and directory is for.

Test binary adders

Once #9 is merged, implement tests for the binary adders.

Let's put the tests to a separate file, test/Adders.hs, but call them from Main.hs.

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.