Installation
Step 1. Install conda
Chipyard uses Conda to manage the development environment and packages.
Download Conda from the miniforge release page .
Select the corresponding Miniforge3 version and download the file ending with ".sh".
After download, we need to mark the script as executable.
Copy chmod +x ~/Downloads/Miniforge3-24.11.0-0-Linux-x86_64.sh
Then, execute the script.
Copy ~/Downloads/Miniforge3-24.11.0-0-Linux-x86_64.sh
Follow the installation prompt. The program will prompt you to input the installation location. Here, we are using /home/tk/Documents/miniforge3
.
After installation, it will ask whether to execute conda init
. Enter "yes" to the prompt.
Conda is now installed on the system.
Step 2. Install conda-lock
Chipyard also requires the conda-lock
module. Install conda-lock
by executing the following commands.
Copy conda install -n base conda-lock==1.4.0
conda activate base
Step 3. Clone Chipyard
Open terminal in a known location. Here, we will use the directory /home/tk/Desktop/
. In the terminal, execute the following command.
Copy git clone git@github.com:ucb-bar/chipyard.git
Step 4. Configure Chipyard
By default, chipyard setup script initializes/installs things in the following order:
Toolchain collateral (Spike, PK, tests, libgloss)
Chipyard pre-compile sources
FireSim pre-compile sources
FireMarshal pre-compile default buildroot Linux sources
To execute the setup script, run the following command.
Copy ./build-setup.sh riscv-tools --use-lean-conda
On older chipyard versions, do this instead:
Copy ./build-setup.sh riscv-tools -s 6 -s 7 -s 8 -s 9 --force
The --force
flag is used to skip the confirmation prompt, which is buggy on some terminals.
The set up process will take around 10-30 minutes, depending on the system configuration. After the script is finished, Chipyard is initialized and is ready to be used.
Running RTL Simulation
Step 1. Preparing the Environment
Ubuntu Millennium BWRC
On Ubuntu, we will use the open-source Verilator to simulate.
We don't need to do anything special to use Verilator. Just remember to source the env.sh script.
Copy source $chipyard/env.sh
Use the following script to source vcs and other related tools.
Copy source /ecad/tools/vlsi.bashrc
On BWRC machine, we need to source the VCS simulator path. This can be done by executing the following commands.
Copy export VCS_HOME=/tools/synopsys/vcs/S-2021.09-SP1-1/
export VERDI_HOME=/tools/synopsys/verdi/S-2021.09-SP1-1/
export VCS_64=1
export PATH=$VCS_HOME/bin:$VERDI_HOME/bin:$PATH
Alternatively, run the following all-in-one script
Copy source /tools/C/chiyufeng/documents/vcs_env.sh
If running into license issues, try running the following command
Copy source /tools/flexlm/flexlm.sh
If running into JDK_HOME issue(JDK/lib/tools.jar not found), try the following command
Copy export JDK_HOME=/usr/lib/jvm/java-1.8.0/
Step 2. Build the RISC-V binaries
To build simulation code:
Copy # inside chipyard directory
cd ./tests/
make
Step 3. Running the Simulation
Then, we go to the corresponding simulator folder and run the simulation.
Ubuntu Millennium BWRC
Copy cd $chipyard/sims/verilator/
Running a simple RocketConfig simulation
Copy make run-binary CONFIG=RocketConfig BINARY=../../tests/hello.riscv
Running a simulation and generating waveform
Copy make run-binary-debug CONFIG=RocketConfig BINARY=../../tests/hello.riscv timeout_cycles=10000
timeout_cycles
can be set to a small value to make the waveform dump process faster.
With fast memory loading
Copy make run-binary CONFIG=RocketConfig BINARY=../../tests/hello.riscv LOADMEM=1
Copy cd $chipyard/sims/vcs/
Running a simple RocketConfig simulation
Copy make run-binary CONFIG=RocketConfig BINARY=../../tests/hello.riscv
Running a simulation and generating waveform
Copy make run-binary-debug CONFIG=RocketConfig BINARY=../../tests/hello.riscv timeout_cycles=10000
timeout_cycles
can be set to a small value to make the waveform dump process faster.
Copy cd $chipyard/sims/vcs/
Dispatch the job on ee194 queue
Copy bsub -q ee194 -Is -XF make run-binary CONFIG=RocketConfig BINARY=../../tests/hello.riscv
Dispatch the job on ix queue
Copy bsub -q ??? -Is -XF make run-binary CONFIG=RocketConfig BINARY=../../tests/hello.riscv
Step 3. Examine Waveform
Launch verdi to examine the waveform.
Copy verdi -ssf <fsdb file>
Copy verdi -ssf ./sims/vcs/output/chipyard.harness.TestHarness.REFV256D128ShuttleConfig/tests.fsdb
Quick Reference:
Ctrl
+ W
: add to current waveform
Prototype the design on FPGA
Step 1. Source the tool scripts
Use the following command to add vivado to PATH
Ubuntu Millennium BWRC
Copy source ~/Documents/Xilinx/Vivado/2024.1/settings64.sh
Copy source /ecad/tools/xilinx/Vivado/2023.2/settings64.sh
Copy source /tools/xilinx/Vivado/2022.2/settings64.sh
Step 2. Building Bitstream
Copy # in chipyard folder
cd ./fpga/
Copy make SUB_PROJECT=arty100t bitstream
Debugging
Debug the design with JTAG