Skip to content

Files

Latest commit

 

History

History
134 lines (112 loc) · 6.21 KB

onprem-firesim.org

File metadata and controls

134 lines (112 loc) · 6.21 KB

On-Premises Firesim Setup

A collection of fixes and small changes that need to be made for Firesim 1.20.1 to work.

Firesim Workload Fixes

The uniform baseline workload has malformed JSON.

diff --git a/deploy/workloads/br-base-uniform.json b/deploy/workloads/br-base-uniform.json
index f53f281ba..113907e6d 100644
--- a/deploy/workloads/br-base-uniform.json
+++ b/deploy/workloads/br-base-uniform.json
@@ -1,12 +1,12 @@
 {
   "benchmark_name": "br-base-uniform",
   "common_bootbinary": "../../../target-design/chipyard/software/firemarshal/images/firechip/br-base/br-base-bin",
-  "common_rootfs": "../../../target-design/chipyard/software/firemarshal/images/firechip/br-base/br-base.img"
+  "common_rootfs": "../../../target-design/chipyard/software/firemarshal/images/firechip/br-base/br-base.img",
   "common_outputs": [
     "/etc/os-release"
   ],
   "common_simulation_outputs": [
     "uartlog",
     "memory_stats*.csv"
-  ],
+  ]
 }

Firemarshal Fixes

Define the Firesim Directory

This must be done for marshal install to work.

diff --git a/wlutil/default-config.yaml b/wlutil/default-config.yaml
index d458a9a..dcc4cc9 100644
--- a/wlutil/default-config.yaml
+++ b/wlutil/default-config.yaml
@@ -19,7 +19,7 @@ mount-dir : "../disk-mount"

 # Location of the FireSim repository. Used by the 'install' command. Null
 # indicates that no FireSim installation is available.
-firesim-dir : null
+firesim-dir : "/pool/karl/firesim-1.20.1"

 # Default parallelism level to use in subcommands (mostly when calling 'make')
 # '' means unbounded

Fix Ubuntu 22+ change to mountpoint Return Code

This is only applicable if you use a Firemarshal commit older than 8cea603201d246be30096ff4561ed2923a05149e.

diff --git a/wlutil/wlutil.py b/wlutil/wlutil.py
index 7d30eda..1d959e5 100644
--- a/wlutil/wlutil.py
+++ b/wlutil/wlutil.py
@@ -595,7 +595,7 @@ def mountImg(imgPath, mntPath):

     assert imgPath.is_file(), f"Unable to find {imgPath} to mount"
     ret = run(["mountpoint", mntPath], check=False).returncode
-    assert ret == 1, f"{mntPath} already mounted. Somethings wrong"
+    assert ret == 1 or ret == 32, f"{mntPath} already mounted. Somethings wrong"

     uid = sp.run(['id', '-u'], capture_output=True, text=True).stdout.strip()
     gid = sp.run(['id', '-g'], capture_output=True, text=True).stdout.strip()

Fix PCIe Capability Number Detection

Despite running lspci on the FPGA host, the firesim Python script does not use that information. We must manually fix the capability number to make things work.

diff --git a/deploy/runtools/run_farm_deploy_managers.py b/deploy/runtools/run_farm_deploy_managers.py
index 3b9491e6f..01a3d7474 100644
--- a/deploy/runtools/run_farm_deploy_managers.py
+++ b/deploy/runtools/run_farm_deploy_managers.py
@@ -1198,7 +1198,7 @@ class XilinxVCU118InstanceDeployManager(InstanceDeployManager):

                 # TODO: is hardcoded cap 0x1 correct?
                 # TODO: is "Partial Reconfig Clear File" useful (see xvsecctl help)?
-                bdfs = [ { "busno": "0x" + i[:2], "devno": "0x" + i[3:5], "capno": "0x1" } for i in collect.splitlines() if len(i.strip()) >= 0 ]
+                bdfs = [ { "busno": "0x" + i[:2], "devno": "0x" + i[3:5], "capno": "0x0" } for i in collect.splitlines() if len(i.strip()) >= 0 ]
                 bdf = bdfs[slotno]

                 busno = bdf['busno']

/dev Fixes

The new scripts for Firesim to set up the FPGA for runworkload rely on being able to write to the various XMDA character devices that show up in /dev.

sudo chgrp firesim /dev/xdma*
sudo chmod g+rw /dev/xdma*

# Everything in default_simulation_dir/sim_slot_0 must be RW by the generic user
# NOTE: default_simulation_dir comes from config_runtime.yaml

Your simulation will exit immediately on the manager machine. The simulation runner’s uartlog will look like the following.

runner-machine$ cat FIRESIM_RUNS_DIR/sim_slot_0/uartlog
Script started on 2025-01-15 16:40:33+00:00 [TERM="screen" TTY="/dev/pts/2" COLUMNS="80" LINES="24"]
+domain found: 0x0000
+bus found: 0x01
+device found: 0x00
+function found: 0x0
+bar found: 0x0
Using: 0000:01:00.0, BAR ID: 0, PCI Vendor ID: 0x10ee, PCI Device ID: 0x903f
Opening /sys/bus/pci/devices/0000:01:00.0/vendor
Opening /sys/bus/pci/devices/0000:01:00.0/device
examining xdma/.
examining xdma/..
examining xdma/xdma0_h2c_0
FireSim-xilinx_vcu118: /pool/firesim/sim/midas/src/main/cc/simif_xilinx_vcu118.cc:280: void simif_xilinx_alveo_u250_t::fpga_setup(uint16_t, uint8_t, uint8_t, uint8_t, uint8_t, uint16_t, uint16_t): Assertion `fd != -1' failed.
bash: line 1:  1631 Aborted                 (core dumped) ./FireSim-xilinx_vcu118 +permissive +macaddr0=00:12:6D:00:00:02 +blkdev0=linux-uniform0-br-base.img +niclog0=niclog0 +blkdev-log0=blkdev-log0 +trace-select=1 +trace-start=0 +trace-end=-1 +trace-output-format=0 +dwarf-file-name=linux-uniform0-br-base-bin-dwarf +autocounter-readrate=0 +autocounter-filename-base=AUTOCOUNTERFILE +print-start=0 +print-end=-1 +linklatency0=6405 +netbw0=200 +shmemportname0=default +domain=0x0000 +bus=0x01 +device=0x00 +function=0x0 +bar=0x0 +pci-vendor=0x10ee +pci-device=0x903f +permissive-off +prog0=linux-uniform0-br-base-bin

Script done on 2025-01-15 16:40:33+00:00 [COMMAND_EXIT_CODE="134"]

In particular, the assert(fd != 1) is checking if the simulation setup can read/write to the various /dev/xdma* devices.

F1Shim Synthesis Errors

This is caused by the top-level ports in the shim being renamed without the changes being reflected everywhere else in Firesim’s codebases. This was fixed by PR firesim/garnet-firesim#3.

You must checkout the firesim/platforms/xilinx_vcu118/garnet-firesim submodule past commit e0bb020ac0ff6c3731cb82cfc9789963a0e1c382.

conda-lock cannot be found on conda-forge

conda update -n base -c defaults conda
conda config --add channels conda-forge
conda config --set channel_priority strict
conda update --all