Code Monkey home page Code Monkey logo

virgule-cpu-racket's Introduction

Virgule - A minimal RISC-V core

Virgule is a 32-bit RISC processor core that implements most of the base instruction set of the RISC-V specification (RV32I). It was initially designed and implemented in VHDL for educational purposes, but the VHDL source code is not publicly available. You can read more about Virgule in the documentation of its web-based simulator emulsiV.

The architecture of Virgule favours simplicity over completeness, speed or size. If you are looking for an optimized, production-ready RISC-V core, there are plenty of other implementations to choose from.

This repository contains an RTL model of Virgule written in Racket using the techniques exposed in the blog post Simulating digital circuits in Racket. When executed, the Racket code performs a cycle-accurate simulation of the model.

This work is part of an ongoing experiment where Racket could serve as a platform for the development of a future hardware description language. There is currently no plan to generate Verilog or VHDL from Racket itself.

Content of this repository

The processor core is implemented in the following files in folder src:

  • opcodes.rkt: constant definitions and basic instruction field decomposition.
  • datapath-components.rkt: component descriptions for the datapath (ALU, comparator, registers, etc).
  • virgule.rkt: the main processor description.

It makes use of these modules:

  • signal.rkt: an implementation of hardware signals as data streams.
  • logic.rkt: helpers to manipulate fixed-width binary data.

To integrate Virgule in a system, you can use these modules:

  • memory.rkt: memory component descriptions.
  • device.rkt: helpers to represent devices in the address map.

RISC-V programs can be created using this module:

  • assembler.rkt: functions to generate machine code from assembly programs written as S-expressions.

The examples folder shows how a simple computer system can be described and run with a small program:

racket examples/fibonacci.rkt
racket examples/hello.rkt

Dependencies

This project depends on the following Racket libraries:

  • collections-lib
  • pvector

virgule-cpu-racket's People

Contributors

aumouvantsillage 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.