West: Add west simulate command

Introduce `simulate `command for running samples on a simulator of
choice. Initial implementation consists of one runner, dedicated for
Renode.

Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
This commit is contained in:
Michał Szprejda 2024-03-07 10:30:09 +01:00 committed by Alberto Escolar
commit 80900cbc3b
13 changed files with 172 additions and 7 deletions

View file

@ -698,6 +698,49 @@ determined by the imported subclasses of ``ZephyrBinaryRunner``.
runner implementations are in other submodules, such as ``runners.nrfjprog``,
``runners.openocd``, etc.
Simulating a board with: ``west simulate``
******************************************
Basics
======
Currently the command supports only one runner which is using Renode,
but can be easily extended by adding other runners.
From a Zephyr build directory, to run the built binary::
west simulate --runner=renode
This will start Renode and configure simulation based on a default ``.resc`` script
for the current platform with the zephyr.elf file loaded by default. The simulation
then can be started by typing "start" or "s" in Renode's Monitor. This can also be
done by passing a command to Renode, using an argument provided by the runner:
west simulate --runner=renode --renode-command start
To pass an argument to Renode itself, for example to start Renode in console mode
intead of a separate window:
west simulate --runner=renode --renode-arg="--console"
From that point on Renode can be used normally in both console and window modes.
For details on using Renode see `Renode - documentation`_.
.. _Renode - documentation:
http://docs.renode.io
Runner-Specific Overrides
=========================
To view all of the available options supported by the runners, as well
as their usage information, use ``--context`` (or``-H``)::
west simulate --runner=renode --context
To view all available options Renode supports, use::
west simulate --runner=renode --renode-help
Hacking
*******