Skip to content

Commit a87b003

Browse files
committed
[docs,qemu] Add documentation for command-line QEMU args
Now that we're adding more centralized OpenTitan QEMU documentation, document the newly support command-line argument format here. Signed-off-by: Alex Jones <[email protected]>
1 parent cf06f43 commit a87b003

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

third_party/qemu/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
For instructions on setting up QEMU for local development and troubleshooting steps, see the [setup guide](./setup.md).
44

5-
## Test parameters
5+
## Testing
6+
7+
### Test parameters
68

79
Tests with a `sim_qemu_*` execution environment can be further configured by adding `qemu_params` to the test target.
810
The currently supported parameters are:
@@ -38,3 +40,16 @@ opentitan_test(
3840
# ...
3941
)
4042
```
43+
44+
### Command-line arguments
45+
46+
It can often be inconvenient to manually modify test targets to contain the desired list of QEMU arguments whilst debugging.
47+
In particular, manually adding and removing traces can quickly become unwieldy.
48+
49+
Instead, you can pass in arguments to QEMU as command-line arguments using the form `--qemu-arg="X"` or `--qemu-args="X Y Z"`.
50+
The former forwards a single argument `X` to QEMU, whereas the latter forwards `X`, `Y` and `Z` each as _different_ arguments to QEMU.
51+
52+
For example, to manually add some traces for the USB device and alert updates whilst debugging a test, you might run:
53+
```
54+
./bazelisk.sh test //path_to_qemu_test:my_test --test_arg=--qemu-args="--trace ot_usbdev* --trace ot*update_alert*"
55+
```

0 commit comments

Comments
 (0)