Giter VIP home page Giter VIP logo

cobalt's Introduction

Cobalt

Hi there, welcome to Cobalt. Cobalt is a collection of Bluespec interfaces and modules, used by Oxide Computer to implement custom logic for its new computer. Since we developed some of these pieces on readily available development boards using a fully open source synthesis toolchain, we figured this work and the implementation of its build system may serve as practical examples for others on how to use Bluespec in their own projects.

Getting Started

To get started with the examples found in this repo you may want to follow the following steps to get up and running.

Clone the Repo

To clone the repo, including its Cobble dependency, run the following. Use the URL [email protected]:oxidecomputer/cobalt if SSH is your transport of choice.

git clone --recursive https://github.com/oxidecomputer/cobalt

If you happen to have cloned the repo without the submodules, you can initialize them like so:

git submodule update --init --recursive

Install the Bluespec Compiler

The Bluespec compiler is currently only available in source form. Please head over to the build instructions and install yourself a copy.

Install the Synthesis Toolchain

The easiest way to get the Yosys/nextpnr synthesis toolchain installed is by heading over to YosysHQ and downloading a build for your favorite OS. Alternatively, the Yosys and nextpnr repos have build instructions if you'd rather build from source.

Additional Dependencies

Finally, Cobble requires a Python 3 (version 3.6+ is probably sufficient, we do not actually know). Please install a copy if your system does not already have one.

Set BUILD.vars

In order to point Cobble at the right toolchain pieces, copy BUILD.vars.example and edit the paths in this file to match your installed toolchain:

cp BUILD.vars.example BUILD.vars
$EDITOR BUILD.vars

Initialize Build Graph, Build Examples

And at long last we are ready to initialize the build graph and build one of the examples like so:

mkdir build; cd build
../vnd/cobble/cobble init ..

To build and run one of the test benches:

./cobble build latest/hdl/examples/uart_loopback_test && latest/hdl/examples/uart_loopback_test

The output of the command above should be the following, indicating successful "transmission" of two bytes:

% latest/hdl/examples/uart_loopback_test
'h55
'haa

To build the Blinky example Lattice ECP5 EVN board and flash the SRAM of the FPGA:

./cobble build latest/hdl/boards/ecp5_evn/blinky_ecp5_evn.bit
ecpprog -S latest/hdl/boards/ecp5_evn/blinky_ecp5_evn.bit

Finally, to build all possible targets simply run:

./cobble build

If you are wondering where to go from here, we suggest heading over to the examples directory or building and trying one of the bitstreams for the other supported boards. Happy hacking!

FAQ

Q: Bluesim test benches fail with the following error:

latest/hdl/examples/uart_loopback_test: line 3: bluetcl: command not found
latest/hdl/examples/uart_loopback_test: line 12: /tcllib/bluespec/bluesim.tcl: No such file or directory
latest/hdl/examples/uart_loopback_test: line 12: exec: /tcllib/bluespec/bluesim.tcl: cannot execute: No such file or directory

A: Make sure the bluetcl can be found using the $PATH variables. If the Bluespec compiler was installed outside the usual system paths, because its bin direction is present in $PATH.

cobalt's People

Contributors

arjenroodselaar avatar cbiffle 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.