Can I run Tock apps in a virtual environment? #2868
-
Is it possible to run a Tock app in a virtual environment on Linux (inside a VM, say)? Or having a board is a requirement to do anything at all? Please discuss. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
You can run a Tock app in QEMU. A guide for doing so can be found here: https://github.com/tock/tock/blob/master/doc/Qemu.md |
Beta Was this translation helpful? Give feedback.
-
An alternative to QEMU as proposed by @hudson-ayers, which emulates an environment close to a board (e.g. the SiFive HiFive Rev B board), can be a gatelevel-simulation of some hardware. An example for this is the LiteX simulator which takes a hardware description of a chip including a CPU (in Verilog) and uses Verilator to build a simulation for that. Tock's support for this board can be found here: https://github.com/tock/tock/blob/master/boards/litex/sim/README.md. I've set up a companion repository for that which also contains step-by-step instructions on how to get started in setting up your LiteX simulation environment on Ubuntu 20.4 (other Linux distributions should work similarly). Alternatively you can have a look at this pull request, which attempts to create a GitHub actions workflow setting up this environment: #2801. Please be aware that the LiteX simulation being an accurate simulation of some hardware description means this is quite a bit slower than running a board in QEMU is. It should be sufficient to run some simple apps though. |
Beta Was this translation helpful? Give feedback.
An alternative to QEMU as proposed by @hudson-ayers, which emulates an environment close to a board (e.g. the SiFive HiFive Rev B board), can be a gatelevel-simulation of some hardware. An example for this is the LiteX simulator which takes a hardware description of a chip including a CPU (in Verilog) and uses Verilator to build a simulation for that. Tock's support for this board can be found here: https://github.com/tock/tock/blob/master/boards/litex/sim/README.md. I've set up a companion repository for that which also contains step-by-step instructions on how to get started in setting up your LiteX simulation environment on Ubuntu 20.4 (other Linux distributions should work similarly).…