Skip to content

Use another simulator

A campaign uses the simulator pinned in the template’s hfim.yaml. Set simulator: in the campaign to select another compatible package or version.

What a run uses, and who chose it

hfim run prints two lines before it builds anything:

simulator: hfim-sim-qemu-xuantie@9.0.2 (docker), pinned by the template's hfim.yaml: The XuanTie fork of QEMU (xuantie-qemu-9.0 at 3287d34) with T-Head's C906 to C920 models, c906fdv by default, and XuanTie's bare-metal gcc V3.0.1, which runs on x86-64 only: the image is linux/amd64 on every host.
machine: virt, cpu c906fdv (asked for by board.yaml (emulation.qemu_cpu))

The first line names the package, its form and who pinned it: the template, or the campaign. The second names the QEMU machine and CPU and who asked for the CPU: the campaign's qemu_cpu, the board, or the package's default. A firmware boot names no CPU: the machine brings its own. The campaign's provenance records the same machine and CPU.

Another package or version of the same backend

A campaign may pin another QEMU package or version, for example to compare two QEMU releases:

simulator: hfim-sim-qemu@9.2.2

The short form simulator: qemu@9.2.2 means the same. HFIM reports the override at startup:

warning: this campaign pins simulator hfim-sim-qemu@9.2.2; its template (hfim.yaml) pins hfim-sim-qemu@9.2.3. It runs on hfim-sim-qemu@9.2.2, as stated. Delete simulator: from the campaign to follow the template.

Delete the line to follow the template again.

Another backend

A template's boot code is built for its backend. A campaign in a QEMU template that names a gem5 package, or a gem5 template's campaign that names a QEMU package, is refused before anything runs, and the message names both. Use a template made for that backend instead.

The board's CPU

A board names the CPU it is under emulation.qemu_cpu, and every simulator package lists the CPUs its build provides. When the package a run uses does not provide the CPU it is asked for, hfim run stops right after the two lines above, before anything is built, with one line:

hfim: board.yaml (emulation.qemu_cpu) asks for CPU c906fdv (riscv64), which hfim-sim-qemu@9.2.3 does not provide (it lists lowrisc-ibex, max, rv64, ...). This campaign pins hfim-sim-qemu@9.2.3, but its template pins hfim-sim-qemu-xuantie@9.0.2: delete simulator: from the campaign to follow the template. Or set qemu_cpu: rv64 in the campaign (hfim-sim-qemu@9.2.3's default) or another one it lists, to run on that CPU on purpose.

The golden run and the campaign make the same check before QEMU starts.

Setting qemu_cpu: rv64 in the campaign runs the generic CPU on purpose; the run then says the campaign asked for it.

Installing a package

hfim sim install qemu-xuantie         # the newest release
hfim sim install qemu-xuantie@9.0.2   # that release
hfim sim list                         # what is installed, with what each package is

The command names the kind of package, so it takes the short name: qemu-xuantie is hfim-sim-qemu-xuantie, and the full name works too. hfim sim install outside a campaign repository lists the packages HFIM knows: qemu, qemu-xuantie, gem5 and ovp.

A package is a QEMU package because its manifest says backends: [qemu], whatever its name.