The following document is intended to provide the steps in order to install and use Chisel in the Jupyter environment. Moreover you can find the installation steps of Chisel on your local machine.
This will walk you through installing Chisel and its dependencies:
- sbt, which is the preferred Scala build system and what Chisel uses.
- Firrtl, which compiles Chisel's IR down to Verilog. If you're building from a release branch of chisel3, separate installation of Firrtl is no longer required: the required jar will be automatically downloaded by sbt. If you're building chisel3 from the master branch, you'll need to follow the directions on the firrtl project to publish a local copy of the required jar.
- Verilator, which compiles Verilog down to C++ for simulation. The included unit testing infrastructure uses this.
-
Install Java
sudo apt-get install default-jdk
-
Install sbt, which isn't available by default in the system package manager:
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 sudo apt-get update sudo apt-get install sbt
-
Install Verilator. We currently recommend Verilator version 3.904. Follow these instructions to compile it from source.
-
Install prerequisites (if not installed already):
sudo apt-get install git make autoconf g++ flex bison
-
Clone the Verilator repository:
git clone http://git.veripool.org/git/verilator
-
In the Verilator repository directory, check out a known good version:
git pull git checkout verilator_3_904
-
In the Verilator repository directory, build and install:
unset VERILATOR_ROOT # For bash, unsetenv for csh autoconf # Create ./configure script ./configure make sudo make install
-
Make sure you have Java 8 installed on your machine
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
And then
brew install sbt verilator
In case you do not have the correct version of Verilator (3.902):
brew --repository (to understand where bre is installed, let's assume /usr/local/Homebrew)
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
git checkout 16ebe5f1843e6cb54856311ff0f676be53007329 -- Formula/verilator.rb
brew uninstall verilator (uninstall older verilator version)
brew unlink verilator (remove all links to previous version)
HOMEBREW_NO_AUTO_UPDATE=1 brew install verilator
To create a new project starting from a pre-existing template clone the Chisel git repo:
git clone https://github.com/ucb-bar/chisel-template.git MyChiselProject
cd MyChiselProject
Test the example GCD project:
sbt 'testOnly gcd.GCDTester'
sbt 'test:runMain gcd.GCDMain --backend-name verilator'
The following instructions necessary for the purpose of this full-day bootcamp if you want to run the tools on your local machine.
Run the instructions below for your particular situation. Note that we include a custom javascript file for Jupyter, so if you already have Jupyter installed, you still need to install the custom.js file.
Note: Make sure you are using Java 8 (NOT Java 9) and have the JDK8 installed. Coursier/jupyter-scala does not appear to be compatible with Java 9 yet as of January 2018.
If you do have multiple version of Java, make sure to select Java 8 (1.8) before running jupyter notebook
:
- On Linux:
sudo update-alternatives --config java
Type the number related to Java 8 and press Enter. Then check which is the current Java version
java -version
- On Windows:
- In the Java Control Panel, click on the Java tab.
- Click View to display the Java Runtime Environment Settings
- Verify that the wanted Java Runtime version is enabled by checking the Enabled box.
- Click OK to save settings
- Click OK in Java Control Panel window to confirm changes and close the window.
- Try to run same applet and verify it is now running using wanted version of Java installed in your system.
- On MacOS:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version
-
Download the installer: Miniconda installer for Linux https://conda.io/miniconda.html Miniconda installer for MacOS https://conda.io/miniconda.html
-
In your Terminal window, run: Miniconda:
bash Miniconda3-latest-Linux-x86_64.sh
-
Follow the prompts on the installer screens. If you are unsure about any setting, accept the defaults. You can change them later.
-
To make the changes take effect, close and then re-open your Terminal window.
-
Download the installer: Miniconda installer for Windows https://conda.io/miniconda.html
-
Double click the '.exe' file
-
Follow the instructions on the screens. If you are unsure about any setting, accept the defaults. You can change them later.
Make sure you have python3.6 installed in your environment as well as pip3
Before going on with the local installation of Jupyter for Chisel create and run the Conda environment:
conda create -n chisel_bootcamp pip python=3.6
source activate chisel_bootcamp
First install Jupyter Scala.
Dependencies: openssh-client, openjdk-8-jre, openjdk-8-jdk (-headless OK for both), ca-certificates-java
First, use pip3 to install jupyter (or pip for python 2): http://jupyter.org/install.html
pip3 install jupyter
Then, clone this repo and run the installation script: https://github.com/alexarchambault/jupyter-scala
git clone https://github.com/jupyter-scala/jupyter-scala.git
cd jupyter-scala && ./jupyter-scala
Now clone this repo and install the customization script. If you already have one, append this script to it.
git clone https://github.com/ucb-bar/generator-bootcamp.git
cd generator-bootcamp
mkdir -p ~/.jupyter/custom
cp source/custom.js ~/.jupyter/custom/custom.js
And to start the bootcamp on your local machine:
jupyter notebook
All the participants have access to a server with the tools needed for this full-day bootcamp.
In order to access to the server visit
https://asap-chiselbootcamp.necst.it/hub/login
Insert "username" and "password" provided by the administrators and log in. You will be redirected to a ready-to-use Jupyter notebook
If you do not have access to the server you can run the Jupyter Chisel bootcamp notebook on your local machine prior installation (see previous step)