Hello,
These questions might have been asked before, but I have not been able to find conclusive answers.
In my program I have already implemented usage of the CLA core and been running control routines in real time using it. In parallel, the CPU is running and there is data that is constantly been shared between the CPU and CLA.
My main concern is that for some reason false/garbage data will be read by either the CPU or CLA in one of the LSRAM blocks, either when one of the masters is trying to read the data simultaneously when the other one is writing to it or for some other reason.
In the data sheet section 3.11.1.6 Access Arbitration -> Figure 3-15. Arbitration Scheme on Local Shared Memories shows the arbitration scheme when trying to access the same memory from both the CPU and CLA. I am also aware that LSRAM blocks can be configured to have CPU write protection (by setting the CPUWRPROT_LSx bit to 1).
Additionally, section 6.3.1 CLA Memory also talks about "CPU to CLA Message RAM" and "CLA to CPU Message RAM"
"The CLA can use this block to pass data to the CPU. This block is both readable and writable by the CLA. This block is also readable by the CPU but writes by the CPU are ignored."
So following this long intro (sorry ), here are my main questions :
- What would be considered a more "safe" method regarding CPU write protection? is it using Cla1ToCpuMsgRAM to pass data from the CLA (memory is small and can be insufficient) or using LSRAM block and activating the CPU write protection?
- In the opposite direction, assuming my CLA code will never try to 'write' to the data sent from the CPU, is it more "safe" to have it shared using the CpuToCla1MsgRAM or using one of the LSRAM blocks when configured both CLA and CPU to be masters?
- When trying to 'read' data from an LSRAM block, I understand that it follows the arbitration as stated in Section 3.11.1.6, is reading from CpuToCla1MsgRAM follows a similar arbitration? I want to make sure that writing to the data is completed before someone is trying to read from it.
Thanks in advance.