Coder Social home page Coder Social logo

ctopal / ibex_demo_system Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lowrisc/ibex-demo-system

0.0 0.0 0.0 2.91 MB

A demo system for Ibex including debug support and some peripherals

License: Apache License 2.0

Shell 0.71% Python 31.57% C 9.10% Tcl 23.66% Assembly 2.23% SystemVerilog 31.43% CMake 1.31%

ibex_demo_system's Introduction

Ibex Demo System

This an example RISC-V SoC targeting the Arty-A7 FPGA board. It comprises the lowRISC Ibex core along with the following features:

  • RISC-V debug support (using the PULP RISC-V Debug Module)
  • A UART (transmit only for now)
  • GPIO (output only for now)
  • Timer

Debug can be used via a USB connection to the Arty-A7 board. No external JTAG probe is required.

Software Requirements

To install python dependencies use pip, you may wish to do this inside a virtual environment to avoid disturbing you current python setup (note it uses a lowRISC fork of edalize and FuseSoC so if you already use these a virtual environment is recommended)

# Setup python venv
python3 -m venv .
source ./bin/activate

# Install python requirements
pip3 install -r python-requirements.txt

You may need to run the last command twice if you get the following error: ERROR: Failed building wheel for fusesoc

Building

First the software must be built. This is provide an initial binary for the FPGA build.

cd sw
mkdir build
cd build
cmake ../
make

Note the FPGA build relies on a fixed path to the initial binary (blank.vmem) so if you want to create your build directory elsewhere you need to adjust the path in ibex_demo_system.core

FuseSoC handles the FPGA build. Vivado tools must be setup beforehand. From the repository root:

source /path/to/vivado/settings64.sh
fusesoc --cores-root=. run --target=synth --setup --build lowrisc:ibex:demo_system

To program the FPGA, either use FuseSoC again

fusesoc --cores-root=. run --target=synth --run lowrisc:ibex:demo_system

Or use the Vivado GUI

make -C ./build/lowrisc_ibex_demo_system_0/synth-vivado/ build-gui

Inside Vivado you do not have to run the synthesis, the implementation or generate the bitstream. Simply click on "Open Hardware Manager", then on "Auto Connect" and finally on "Program Device".

Loading a program

The util/load_demo_system.sh script can be used to load and run a program. You can choose to immediately run it or begin halted, allowing you to attach a debugger.

# Run demo
./util/load_demo_system.sh run ./sw/build/demo/demo

# Load demo and start halted awaiting a debugger
./util/load_demo_system.sh halt ./sw/build/demo/demo

To view terminal output use screen:

# Look in /dev to see available ttyUSB devices
screen /dev/ttyUSB1 115200

If you see an immediate [screen is terminating], it may mean that you need super user rights. In this case, you may try using sudo.

Debugging a program

Either load a program and halt (see above) or start a new OpenOCD instance

openocd -f util/arty-a7-openocd-cfg.tcl

Then run GDB against the running binary and connect to localhost:3333 as a remote target

riscv32-unknown-elf-gdb ./sw/build/demo/demo

(gdb) target extended-remote localhost:3333

ibex_demo_system's People

Contributors

gregac avatar marnovandermaas 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.