Skip to content

fix(renode): a smoke whose CPU halts before executing anything still exits 0 #64

Description

@hkngln

Summary

After #63 the Renode smoke really boots. It can still pass while executing nothing: the CPU halts on the first instruction fetch and tan renode exits 0.

Actual

tan --sdk-root /Users/hakan/.alp/sdk/v0.13.0 renode --core m55_hp --timeout 25 on a real E1M-AEN801 build:

16:23:18.8324 [INFO] System bus created.
16:23:19.6576 [INFO] sysbus: Loading block of 17984 bytes length at 0x20000140.
16:23:19.6666 [INFO] sysbus: Loading block of 120636 bytes length at 0x80000000.
16:23:19.6672 [INFO] sysbus: Loading block of 316 bytes length at 0x8001D73C.
16:23:19.6672 [INFO] sysbus: Loading block of 4 bytes length at 0x8001D878.
Starting emulation...
16:23:19.6935 [INFO] cpu: Guessing VectorTableOffset value to be 0x20000000.
16:23:19.7011 [ERROR] cpu: PC does not lay in memory or PC and SP are equal to zero. CPU was halted.
16:23:19.7025 [INFO] aen801: Machine started.
(aen801) 16:23:19.8066 [INFO] aen801: Machine paused.
16:23:19.8224 [INFO] aen801: Disposed.

Exit code: 0. Envelope ok: true.

Why it passes

Without --expect, commands::renode has exactly two failure signals: a non-zero natural_exit, and (as of #63) a latched argv rejection. A Renode that boots, halts the CPU, and shuts down cleanly trips neither — it exits 0 like a healthy run. So the smoke's default mode (no --expect) cannot distinguish "the firmware ran" from "the CPU never executed an instruction".

This is the same shape as the argv false-green #63 closed, one layer further in: there, Renode never started; here, it starts and does nothing.

Two separable questions

1. Which console lines should fail a smoke? A judgement call, and worth being conservative — too broad a rule turns healthy smokes red. Options, narrowest first:

  • Fail only on the "never executed" markers: CPU was halted, PC does not lay in memory. Narrow, high-signal, matches this failure exactly.
  • Fail on any Renode [ERROR] line. Broader; emulation ERRORs are not all fatal, so this risks false failures.
  • Require --expect for a green smoke (no boot evidence, no pass). Strictest and the most honest, but it changes the default contract and every existing caller.

2. Why does the CPU halt on this image? Likely NOT a tan bug: Guessing VectorTableOffset value to be 0x20000000 right before the halt suggests the ELF's vector table is not where metadata/renode/alif_ensemble_e8.repl / .resc expect for this slice. The loaded blocks span both 0x20000140 (ITCM/SRAM) and 0x80000000 (MRAM), so the descriptor may need the MRAM-linked shape for m55_hp, or the .resc needs to set PC/VectorTableOffset explicitly. That belongs to the SDK's Renode descriptors, not the CLI — worth confirming before wiring any detection, since the detection should not paper over a descriptor bug.

Suggested split

  • This repo: implement (1), starting with the narrow marker rule.
  • alp-sdk: investigate (2) against metadata/renode/alif_ensemble_e8.{repl,resc} for an MRAM-linked M55 slice.

Environment

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions