Skip to content

debug: tester: add simple DRAM execution test - #9866

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:debug_module_dram
Mar 2, 2025
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:debug_module_dram

Conversation

@abonislawski

Copy link
Copy Markdown
Member

Add new type of test: TESTER_MODULE_CASE_SIMPLE_DRAM_TEST to test simple dram execution scenario

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering whether this makes sense if the build does not support mapping cold section to DRAM, but I guess these checks will apply in that case as well and would signal an invalid build of the FW.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abonislawski the way relocations are resolved during dynamic linking, sometimes addresses of functions when examined and when jumped to might be different. E.g. in

    printf("about to call x() at %p\n", x);
    x();

doesn't guarantee that the address you print will be the same address that you jump to. In your above code I actually think it will be necessarily the same, but I'm not 100% sure and it's a bit at the compiler's discretion. To make absolutely sure when debugging I use __builtin_return_address(), e.g.

void *caller_addr(void)
{
    return __builtin_return_address(0);
}

__cold void x(void)
{
    printf("running at %p\n", caller_addr());
}

Would be good to use this here too (1) to make sure we run in DRAM, (2) to document this method for everybody to use for debugging. Maybe even actually make that caller_address() function available in SOF globally.

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One open for me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why every second buffer instead of every buffer ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan was to do the same thing as existing TESTER_MODULE_CASE_DUMMY_TEST (switching do_copy) and make difference only in DRAM execution

Add new type of test: TESTER_MODULE_CASE_SIMPLE_DRAM_TEST
This will allow to test simple dram execution scenario

Signed-off-by: Adrian Bonislawski <[email protected]>
@lgirdwood
lgirdwood merged commit 87fef1b into thesofproject:main Mar 2, 2025
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.

4 participants