Giter VIP home page Giter VIP logo

colorlight-riscv-rs's Introduction

colorlight-litex-rs

My adventure on trying to control a

Everything with open-source tools!

Contents

SoC

soc.py builds FPGA bitstream with LiteX containing a simple RISC-V SoC to run firmware.

Dependencies

Build

build bitstream and generate needed files with:

python3 soc.py --build --cpu-type vexriscv --csr-svd "./litex-pac/5a-75e_6.0.svd"

notes:

  • 5a-75e_6.0.svd will be overwritten and used later for the litex pac (peripheral access crate).
  • you can use --memory-x "../litex-pac/memory.x", however, I encountered many issues with the provided memory file, so I created my own one around regions.ld (see #firmware).

Flash

flash fpga with:

python3 soc.py --load --no-compile-software

Firmware

Firmware is built after SoC is also built, because it will depend on the memory regions defined at regions.ld (generated by LiteX).

Build

cd firmware
BUILD_DIR=../build/colorlight_5a_75e cargo build --release

Run / Simulate firmware

When running cargo run, by default, cargo will try to upload the generated .bin via firmware/.cargo/flash.sh. However, if you want to simulate, you can change config.runner to run firmware/.cargo/sim.sh.

DEVICE=/dev/ttyUSB0 cargo run

Make sure to adjust DEVICE to your needs, since firmware .bin is uploaded via UART.

PAC (Peripheral Access Crate)

When building the SoC, LiteX generates the svd file for us. With this, we can use svd2rust to create our PAC in order to access and manipulate the system. The PAC will use its build.rs to do this automatically.

References

colorlight-riscv-rs's People

Contributors

roby2014 avatar

Stargazers

 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.