FireSim Repo Setup

Next, we’ll clone FireSim through Chipyard on your Manager Machine and run a few final setup steps using scripts in the repo.

Setting up the FireSim Repo

Machine: From this point forward, run everything on your Manager Machine, unless otherwise instructed.

We’re finally ready to fetch FireSim’s sources through Chipyard. Chipyard provides all the necessary target designs (e.g. RISC-V SoCs) and software (e.g. Linux) used for the rest of this guide.

Note

This guide was built using Chipyard version dbc082e2206f787c3aba12b9b171e1704e15b707. It is recommended to use the most up-to-date version of Chipyard with this tutorial.

This should be done on your Manager Machine. Run:

 git clone https://github.com/ucb-bar/chipyard
 cd chipyard
 # ideally use the main chipyard release instead of this
 git checkout dbc082e2206f787c3aba12b9b171e1704e15b707
 ./build-setup.sh

Once build-setup.sh completes, run:

cd sims/firesim
source sourceme-manager.sh --skip-ssh-setup

This will perform various environment setup steps, such as adding the RISC-V tools to your path. Sourcing this the first time will take some time – however each subsequent sourcing should be instantaneous.

Warning

Every time you want to use FireSim, you should cd into your FireSim directory and source sourceme-manager.sh again with the arguments shown above.

Initializing FireSim Config Files

The FireSim manager contains a command that will automatically provide a fresh set of configuration files for a given platform.

To run it, do the following:

 firesim managerinit --platform xilinx_vcu118

This will produce several initial configuration files, which we will edit in the next section.

Configuring the FireSim manager to understand your Run Farm Machine setup

As our final setup step, we will edit FireSim’s configuration files so that the manager understands our Run Farm machine setup and the set of FPGAs attached to each Run Farm machine.

Inside the cloned FireSim repo, open up the deploy/config_runtime.yaml file and set the following keys to the indicated values:

  • default_simulation_dir should point to a temporary simulation directory of your choice on your Run Farm Machines. This is the directory that simulations will run out of.

  • run_farm_hosts_to_use should be a list of - IP-address: machine_spec pairs, one pair for each of your Run Farm Machines. IP-address should be the IP address or hostname of the system (that the Manager Machine can use to ssh into the Run Farm Machine) and the machine_spec should be a value from run_farm_host_specs in deploy/run-farm-recipes/externally_provisioned.yaml. Each spec describes the number of FPGAs attached to a system and other properties about the system.

Here are two examples of how this could be configured:

Example 1: Your Run Farm has a single machine with one FPGA attached and this machine is also your Manager Machine:

...
    run_farm_hosts_to_use:
        - localhost: one_fpgas_spec
...

Example 2: You have two Run Farm Machines (separate from your Manager Machine). The Run Farm Machines are accessible from your manager machine with the hostnames firesim-runner1.berkeley.edu and firesim-runner2.berkeley.edu, each with eight FPGAs attached.

...
    run_farm_hosts_to_use:
        - firesim-runner1.berkeley.edu: eight_fpgas_spec
        - firesim-runner2.berkeley.edu: eight_fpgas_spec
...
  • default_hw_config should be xilinx_vcu118_firesim_rocket_singlecore_4GB_no_nic

Then, run the following command so that FireSim can generate a mapping from the FPGA ID used for JTAG programming to the PCIe ID used to run simulations. If you ever change the physical layout of the machine (e.g., which PCIe slot the FPGAs are attached to), you will need to re-run this command.

firesim enumeratefpgas

This will generate a database file in /opt/firesim-db.json on each Run Farm Machine that has this mapping.

Now you’re ready to run your first FireSim simulation! Hit Next to continue with the guide.