Running Chipyard RTL Simulation - Ubuntu or BWRC

In this tutorial, we will simulate a simple SoC and make it print "Hello World".

Step 1. Preparing the Environment

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.

source $chipyard/env.sh

Step 2. Running the Simulation

To build simulation code:

cd $chipyard/tests/
make

Then, we go to the corresponding simulator folder and run the simulation.

cd $chipyard/sims/verilator/

make run-binary CONFIG=ExampleChipConfig BINARY=../../tests/hello.riscv

To run simulation with a program:

bsub -q ee194 -Is -XF make run-binary CONFIG=BearlyConfig BINARY=../../tests/hello.riscv

To run simulation with a program, and generate waveform:

bsub -q ee194 -Is -XF make run-binary-debug CONFIG=BearlyConfig BINARY=../../tests/hello.riscv timeout_cycles=10000

timeout_cycles can be set to a small value to make the waveform dump process faster.

Step 3. Examine Waveform

Launch verdi to examine the waveform

1

2

3

4

Last updated