Repository navigation
Conversation
h-filali
left a comment
There was a problem hiding this comment.
Thanks @kulan-pal for this PR.
I have a couple of general questions.
Do you know why these helpers are still running at the end of the test? cur_run_phase is only nulled after wait_for_test_done() returns. By then fetch_enable has been off for about 3000 cycles, and with it off the core neither fetches nor executes.
What happens if a helper hangs because of an RTL bug, for example a dret that never comes shortly before the end of the test? As I read the change, that objection is reclaimed with a UVM_LOW info line and the test passes.
A helper still waiting at test end keeps its objection. When its event comes, it drops it through the nulled cur_run_phase, and a test that already passed fails with a null object access. Keep cur_run_phase until no helper objection is left. A helper whose event never comes still fails on its own timeout. Helpers that start after that point, and the directed-test cleanup, leave it alone. Signed-off-by: Kulan Palanichamy <kulan.palanichamy@opentitan.org>
ee630de to
7496d77
Compare
|
Thanks, both good questions. Why helpers are still running. The core keeps running after test end. A helper that hangs. You're right, the previous version turned that timeout into a pass. Now a helper that |
|
The latest revision looks correct: it keeps the phase handle until the outstanding helpers finish, so they can drop their objections without dereferencing a null handle. I didn’t find an issue with the changes. |
When a helper is still waiting at test end, a test that already logged
payload=TEST_PASScan fail with:Helpers such as
wait_for_csr_writeraise an objection while they wait for an event. The base testclears
cur_run_phasewhenwait_for_test_done()returns, even if a helper is still waiting. That helper keepsthe phase open, and when its event arrives, its drop dereferences null. We saw this downstream in debug and
interrupt tests, at roughly 1 in 1000 runs.
Events still arrive after test end because the core keeps running.
vseq.stop()does not stopfetch_enable_seq, which turns fetch back on. The riscv-dv program then runs its end-of-test trap handler, whichwrites more signatures.
run_phasenow keepscur_run_phaseuntil no helper objection is left. A helper whose event never comes stillfails on its own timeout, as on master. Helpers that start after that point, and the directed-test cleanup, leave
cur_run_phasealone.The directed cleanup is otherwise unchanged. It still kills
check_stimulus()at test end and drops oneobjection. A stuck directed check is therefore discarded, and two stuck at once leave an objection until the test
timeout, as on master.
Tested on VCS U-2023.03-SP2 with the
opentitanconfig, same programs and seeds on both sides. Local canaries(not in this PR) use the real helpers and teardown. They cover late and missing events, the clock edge where the
handle is nulled, a helper that starts after that, and directed cancellation. The ones that inject an event
disable
fetch_enable_seq, so no program signature write lands between the injected words.4dd3932aError-[NOA]at the helper's dropdret), 2 seeds eachError-[NOA]Error-[NOA]at its raiseriscv_reset_test, seeds 2-5assorted_trapsmid-test cosim mismatchNo dependencies. #2444 adds a copy of this
run_phaseincore_ibex_elf_manifest_test.sv, which would need thesame change.
AI disclosure (CLA §9): written with help from Claude Code and reviewed with OpenAI Codex; I have reviewed and understood every change and take full responsibility for it.