Skip to content

Fix the Renode test: working dmlog_monitor, attached from the start of the boot - #102

Merged
JohnAmadis merged 4 commits into
masterfrom
ccr-09cd1b4c-fehk7j
Sep 30, 2026
Merged

JohnAmadis merged 4 commits into
masterfrom
ccr-09cd1b4c-fehk7j

Conversation

@JohnAmadis

@JohnAmadis JohnAmadis commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Test Renode Simulation has been red on master. Three things stacked up:

  1. The host dmlog_monitor did not link. dmod's Dmod_Malloc/Dmod_Free became macros requiring DMOD_CURRENT_ALLOCATOR, and the monitor used them without including dmod.h. Result: undefined reference to 'Dmod_Malloc', and no logs at all.
  2. The firmware ran before the monitor attached. The boot log is ~54 KB before DMOD-Boot started, mostly dmdevfs progress lines, and the dmlog ring is 8 KiB. Renode started the firmware immediately. monitor-gdb attached only after building the monitor (about a minute), and even with the monitor pre-built, the CI runner wraps the ring in the ~5 s before the monitor attaches.
  3. Attached early, the monitor stalled the boot. Its GDB live mode interrupted the target every 10 ms, and under Renode the firmware then made no progress.

Fix

  • Bump lib/dmlog to dmlog master fb05e82, the merge of Fix the monitor for the current dmod API and for Renode's GDB server dmlog#56, which fixes (1) and (3). The bump also brings dmlog master's switch to dmtty 1.1 ioctl numbers.
  • New option DMBOOT_RENODE_WAIT_FOR_GDB (default OFF). When it is on, the generated renode.resc leaves out start, so the machine stays paused until a GDB client continues it; monitor-gdb does that when it connects. The default connect workflow is unchanged.
  • scripts/run_renode_tests.sh turns the option on, and builds build_dmlog_monitor and extract_ring_buffer_config together with the firmware. The monitor then follows the boot from its first line, no matter how fast the runner is. This fixes (2).

The Docker image (chocotechnologies/dmboot:1.0.0) does not need rebuilding.

Verification

scripts/run_renode_tests.sh run locally inside chocotechnologies/dmboot:1.0.0 on this branch passes twice: DMOD-Boot started ... ✓ FOUND, Renode emulation tests PASSED. The captured log starts at == dmlog ver. 1.0 ==, the firmware's first line. The generated renode.resc still ends with start when the option is OFF.

Two local-only workarounds, not part of the diff: dmf-get and Renode traffic went through the local proxy's CA, and Renode's SVD download from dl.antmicro.com is blocked in that sandbox, so the ApplySVD line was stripped from the container's platform file.

Not addressed here, since it's not part of this failure: the emulated boot also logs Stack overflow detected in task: console and dmdma: stream 3 already open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv

The Renode test builds dmlog_monitor for the host, and that no longer
linked: dmod made Dmod_Malloc/Dmod_Free macros (requiring
DMOD_CURRENT_ALLOCATOR on the system side) and dropped the plain
functions, while the monitor used them without including dmod.h. The
monitor never started, so no firmware logs were captured and the test
reported "DMOD-Boot started ... NOT FOUND".

The bump also brings dmlog's switch to dmtty 1.1's ioctl numbers for
Dmod_Stdin_Get/SetFlags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
monitor-gdb built the host monitor itself (FetchContent of dmod plus a
full build), so it attached about a minute after Renode had started the
firmware. The boot log is far larger than the 8 KiB dmlog ring by then,
so "DMOD-Boot started" had already been overwritten. Build the monitor
together with the firmware, so it attaches right after Renode starts and
follows the boot from the first line.

Also bump dmlog for the monitor's GDB polling fix: it used to interrupt
the target every 10 ms, which under Renode kept the boot from progressing
at all once the monitor had caught up with the ring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
@JohnAmadis JohnAmadis changed the title Fix Renode test: bump dmlog so the host dmlog_monitor links again Fix the Renode test: working dmlog_monitor, attached from the start of the boot Sep 30, 2026
choco-technologies/dmlog#56 is merged; fb05e82 is its merge commit, with
the same tree as the branch commit tested here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
Building the monitor up front was not enough: on the CI runners Renode
boots the firmware far enough in the ~5 s before monitor-gdb attaches to
wrap the 8 KiB dmlog ring, so "DMOD-Boot started" was already gone.

Add DMBOOT_RENODE_WAIT_FOR_GDB (default OFF): the generated Renode script
then leaves out 'start', so the machine stays paused until a GDB client
continues it. The Renode test turns it on, so the monitor follows the
boot from its first line no matter how fast the runner is. The default
connect workflow still starts the firmware right away.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWVYTSBnZLbpDqp7X1sknv
@JohnAmadis
JohnAmadis merged commit 75c8906 into master Sep 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants