ADSP-SC594
Production
Reaching speeds of up to 1 GHz, the ADSP-SC59x processors are members of the SHARC® family of products. The ADSP-SC59x processor is a dual-SHARC+® core...
Datasheet
ADSP-SC594 on Analog.com
Hello,
I am currently working with the ADI ADSP-SC594 DSP Board and have a question regarding accessing L3 memory from the ARM core.
Specifically, I would like to know how to bypass the data cache and access L3 memory directly.
Currently, the ARM core is unable to read data in the L3 memory written by the other core because of the data cache between the L3 memory.
Thank you in advance for your support!
Best regards,
Thank you in advance for your support!
Best regards,
Hello.
Thank you for your prompt reply.
The following ARM core side code modifications and SHARC core side code additions allowed each other to access in the L3 memory data (range:0xB8000000-0xBFFFFFFF).
ARM core side
/system/linker/apt.c
-----------------------------------------------------------------------------------
const adi_mmu_AbstractPageEntry _adi_mmu_absPageTable[] =
{
.....
//{ 0xA0000000u, 0xBFFFFFFFu, ADI_MMU_WB_CACHED }, /* 512MB DDR-A */
{ 0xA0000000u, 0xB7FFFFFFu, ADI_MMU_WB_CACHED }, /* 384MB DDR-A */
{ 0xB8000000u, 0xBFFFFFFFu, ADI_MMU_RW_UNCACHED }, /* 128MB DDR-A */
.....
};
-----------------------------------------------------------------------------------
SHARC core side
-----------------------------------------------------------------------------------
adiCacheStatus cache_stat;
cache_stat = adi_cache_set_range((void *)0xB8000000u,
(void *)0xBFFFFFFFu,
adi_cache_rr5,
adi_cache_noncacheable_range);
-----------------------------------------------------------------------------------
In consideration of exclusive access, the following code was inserted before and after accessing these areas.
ARM core side
-----------------------------------------------------------------------------------
uint32_t excl_addr = 0xB8000000u;
uint32_t excl_stat;
uint32_t excl_ret;
(before)
do
{
__asm volatile ("ldrex %0, [%1]" : "=r"(excl_stat) : "r" (excl_addr) : "memory);
} while (excl_stat != 0u);
excl_stat = 1u;
do
{
__asm volatile ("strex %0, %2, [%1]" : "=&r" (excl_ret) : "r" (excl_addr), "r" (excl_stat) : "memory");
} while (excl_ret != 0u);
(after)
do
{
__asm volatile ("ldrex %0, [%1]" : "=r"(excl_stat) : "r" (excl_addr) : "memory);
} while (excl_stat != 1u);
excl_stat = 0u;
do
{
__asm volatile ("strex %0, %2, [%1]" : "=&r" (excl_ret) : "r" (excl_addr), "r" (excl_stat) : "memory");
} while (excl_ret != 0u);
-----------------------------------------------------------------------------------
SHARC core side
-----------------------------------------------------------------------------------
uint32_t excl_addr = 0xB8000000u;
uint32_t excl_stat;
int excl_ret;
(before)
do
{
excl_stat = load_exclusive_32((unsigned volatile int *)excl_addr, &excl_ret);
} ((excl_ret != 0) && (excl_stat != 0u));
excl_stat = 1u;
do
{
excl_ret = store_exclusive_32(excl_stat, (unsigned volatile int *)excl_addr);
} (excl_ret != 0);
(after)
do
{
excl_stat = load_exclusive_32((unsigned volatile int *)excl_addr, &excl_ret);
} ((excl_ret != 0) && (excl_stat != 1u));
excl_stat = 0u;
do
{
excl_ret = store_exclusive_32(excl_stat, (unsigned volatile int *)excl_addr);
} (excl_ret != 0);
-----------------------------------------------------------------------------------
Hi,
Thanks for the update and glad to know that your issue is resolved.
Please let us know, if you need any further assistance.
Regards.
Nandini C