Skip to content

Commit

Permalink
Modify launch script and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
junsunchoi committed Apr 19, 2024
1 parent 3bbabcd commit c4e1128
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
7 changes: 3 additions & 4 deletions docs/source/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ workload.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In some cases, you may need to boot your workload in spike (typically due to a
custom ISA extension or hardware model). In that case, you may use the -s
option. Note that spike currently does not support network or block devices.
You must pass the --no-disk option to FireMarshal when using spike.
option. Note that spike currently does not support network.
You may need to pass the --no-disk option to FireMarshal when using spike.

clean
--------------------------------------
Expand All @@ -115,8 +115,7 @@ included in the output directory.

``-s --spike``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Test using spike instead of qemu (requires the --no-disk option to the
``marshal`` command).
Test using spike instead of qemu.

``-m testDir --manual testDir``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
10 changes: 6 additions & 4 deletions docs/source/internal/Build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Build Process

The goal of building a workload is to produce a working boot binary and
(optionally) a root filesystem to boot from. The same outputs are used for
Spike, Qemu, and FireSim. The one exception is that Spike does not support a
disk, so users may choose to create an initramfs-only version of their workload
for Spike (that binary will boot on Qemu and FireSim as well). The build process
proceeds as follows:
Spike, Qemu, and FireSim. Spike now supports a disk. In order to use a disk,
libspikedevices.so should be installed by chipyard to the RISCV library path.
Iceblk will be used as the default device. Users may also choose to create
an initramfs-only version of their workload instead for Spike
(that binary will boot on Qemu and FireSim as well).
The build process proceeds as follows:

Build Parents
--------------------
Expand Down
17 changes: 10 additions & 7 deletions wlutil/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ def getSpikeCmd(config, nodisk=False):
log.warn("You have hard-coded a disk image in your workload. Spike does not support disk images, your workload may not work correctly. Consider building with the '--nodisk' option (for linux-based workloads).")
elif 'img' in config and not nodisk:
riscv_lib_path = os.getenv('RISCV')
if not os.path.isfile(riscv_lib_path+'/lib/libspikedevices.so'):
raise ValueError("Spike does not support disk-based configurations without libspikedevices.so")

spikeArgs += '--extlib=libspikedevices.so ' +\
"--device=\"iceblk," +\
'img=' + str(config.get('img', '')) + "\" "
if riscv_lib_path is None:
raise ValueError("The RISCV environment variable is not set")
elif not os.path.isfile(riscv_lib_path+'/lib/libspikedevices.so'):
raise ValueError("Spike does not support disk-based configurations without libspikedevices.so installed by Chipyard")
else:
spikeArgs += '--extlib=libspikedevices.so ' +\
"--device=\"iceblk," +\
'img=' + str(config.get('img', '')) + "\" "

if 'spike' in config:
spikeBin = str(config['spike'])
else:
spikeBin = 'spike'

cmd = [spikeBin,
spikeArgs, # config.get('spike-args', ''),
spikeArgs,
config.get('spike-args', ''),
' -p' + str(config['cpus']),
' -m' + str(int(config['mem'] / (1024*1024)))]
if nodisk:
Expand Down

0 comments on commit c4e1128

Please sign in to comment.