Skip to content

ci: add Erbium and ET-SOC1 tests to CI and fix related issues - #80

Open
AFOliveira wants to merge 8 commits into
aifoundry-org:masterfrom
AFOliveira:feat/ci-add-all-tests
Open

ci: add Erbium and ET-SOC1 tests to CI and fix related issues#80
AFOliveira wants to merge 8 commits into
aifoundry-org:masterfrom
AFOliveira:feat/ci-add-all-tests

Conversation

@AFOliveira

Copy link
Copy Markdown
Member

Fixes #52
Also adds all tests to CI.

Just need to look at why some et-soc1 tests are failing.

@glguida

glguida commented Feb 19, 2026

Copy link
Copy Markdown
Member
+ running tests/halt_on_reset
62
  | FAIL: [H16256] tests/halt_on_reset.c:33: assertion failed: hastatus0 == 0x0001000000000001, where hastatus0=0x1000000000000
63
  | 2214: INFO EMU: [H16256 S254:N0:C0:T0] Signal end test with FAIL
64
  | 2215: ERROR EMU: [SYS-EMU] Error, test failure
65
make: *** [Makefile:93: run/tests/halt_on_reset] Error 1
66
make: Leaving directory '/workspace/sw-sysemu/debug_tests'
67
Error: Process completed with exit code 2.

@AFOliveira
AFOliveira force-pushed the feat/ci-add-all-tests branch from 407e9c4 to e52b7d2 Compare February 20, 2026 13:22
@AFOliveira AFOliveira changed the title ci: add Erbium and ET-SOC1 tests ci: add Erbium and ET-SOC1 tests to CI and fix related issues Feb 20, 2026
After warm_reset(), all harts are set to State::unavailable, and
recalculate_thread0_enable decides which ones to bring back based on
thread0_disable. For non-disabled harts with resethaltreq set, the
original code called enter_debug_mode() directly on the unavailable
hart, which would transition it to halted. But since f82280f added
an is_unavailable() guard to enter_debug_mode() — to prevent the
debugger from reviving harts disabled by thread0_disable — that call
now silently returns, and the hart stays unavailable forever. The fix
calls start_running() first to transition the hart from unavailable to
active, then enter_debug_mode() halts it. The end result is the same
as before — the hart ends up halted in debug mode after reset — but
the path through the code changes because enter_debug_mode() is now
stricter about which states it accepts.
warm_reset() used immediate links.unlink(), but become_unavailable()
was changed to use pending_unlink in f82280f. Apply the same pattern
here to avoid iterator corruption if warm_reset() is triggered while
the simulation is iterating the active list.
Add missing #include "esrs.h" to debug.c and diag.h to fix
build errors. The code references functions and macros defined
in esrs.h (write_dmctrl, read_hastatus0, DMACTIVE, etc.) but
the header was not included.
Follows emulator change 418b0f4.

Per the RISC-V Debug Spec, resumeack is cleared when resumereq is
written 1 (start of a new resume), not when resumereq transitions
1->0. After a successful resume, resumeack stays set in hastatus0
until the next resume request.

Update halt_resume, halt_resume_4n, and progbuf_break to expect
resumeack (bit 32) in hastatus0 after resume.
The test was failing because the minion returned from main() before
the SPIO could halt it, which caused become_unavailable() to be
called on the hart. When the SPIO then called Halt_Harts(),
enter_debug_mode() silently skipped the unavailable hart. Since the
hart was never halted, the program buffer could not execute, so
Read_All_GPR's instructions never ran and ddata0 stayed at 0. Every
GPR read back as 0, causing the EXPECTX checks to fail.

Add a handshake so the minion spins until the SPIO has finished
the debug operations and explicitly releases it.
Add comprehensive test coverage to CI:
- Erbium emulator tests (25 tests)
- Erbium GDB tests (1 test)
- ET-SOC1 debug tests (13 tests)
The Docker build fetches the RISC-V toolchain release from the GitHub
API, which has a 60 req/hour limit for unauthenticated requests. CI
runners share IPs and hit this limit, causing the build to fail.

Pass GITHUB_TOKEN through the Docker build to authenticate the API
request, raising the limit to 5000 req/hour.
@AFOliveira
AFOliveira force-pushed the feat/ci-add-all-tests branch from 01ba2c2 to e7d5ae6 Compare February 20, 2026 15:43
@AFOliveira

Copy link
Copy Markdown
Member Author

Scope creep hit this PR, but the commit history should make the different parts clearly.

@AFOliveira
AFOliveira marked this pull request as ready for review February 20, 2026 15:44
@AFOliveira
AFOliveira requested review from glguida and vidas February 20, 2026 16:06
@AFOliveira

Copy link
Copy Markdown
Member Author

One question I still have here is whether or not I should rename the debug_tests/ folder to somewhere else?

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.

sysemu: ETSOC1 tests need to be ported.

2 participants