SPRUJ79 November 2024 F29H850TU
The MEMSS uses a three-level arbitration scheme. The first level of arbitration is the fixed priority arbiter, which arbitrates accesses originating from within the same initiator. The following is the priority for the CPU accesses:
Initiators other than the CPU have only one read and one write bus, arbitrated with the following priority:
The second and third level of arbitration controls the initiator selects. Initiator select 1 and 2 are controlled by independent round-robin pointers RR1 and RR2 respectively. RR1 arbitrates accesses connected to slow access ports. When access is granted by RR1, the access is pipelined and then passes to initiator select 2. Next, RR2 arbitrates accesses from initiator select 1 and fast access ports.
The following tables help to illustrate the round-robin arbitration using 64-bit memory controller as an example and same applies to 128-bit memory controller.
Cycle | CPUa | RTDMA1 | RTDMA2 | Round-Robin Pointer 2 | Round-Robin Pointer 1 | Access Granted at Initiator Select 1 | Memory Access |
---|---|---|---|---|---|---|---|
1 | CPUa Read Access 1 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | CPUa | RTDMA1 | CPUa Read Access 1 | |
2 | CPUa Read Access 2 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | CPUa | RTDMA1 | RTDMA1 Read Access 1 | CPUa Read Access 2 |
3 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | Initiator Select 1 | RTDMA1 | RTDMA1 Read Access 1 | RTDMA1 Read Access1 | |
4 | RTDMA2 Read Access 1 | Initiator Select 1 | RTDMA2 | ||||
5 | RTDMA2 Read Access 1 | Initiator Select 1 | RTDMA2 | RTDMA2 Read Access 1 | RTDMA2 Read Access1 | ||
6 | Initiator Select 1 | RTDMA2 | |||||
7 | CPUa Read Access 3 | Initiator Select 1 | RTDMA2 | ||||
8 | CPUa Read Access 3 | CPUa | RTDMA2 | CPUa Read Access 3 | |||
9 | CPUa | RTDMA2 |
Cycle | CPUa | RTDMA1 | RTDMA2 | Round-Robin Pointer 2 | Round-Robin Pointer 1 | Access Granted at Initiator Select 1 | Memory Access |
---|---|---|---|---|---|---|---|
1 | CPUa Read Access 1 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | CPUa | RTDMA1 | CPUa Read Access 1 | |
2 | CPUa Read Access 2 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | CPUa | RTDMA1 | RTDMA1 Read Access 1 | CPUa Read Access 2 |
3 | CPUa Read Access 3 | RTDMA1 Read Access 1 | RTDMA2 Read Access 1 | Initiator Select 1 | RTDMA1 | RTDMA1 Read Access 1 | RTDMA1 Read Access 1 |
4 | CPUa Read Access 3 | RTDMA2 Read Access 1 | CPUa | RTDMA2 | CPUa Read Access 3 | ||
5 | CPUa Read Access 4 | RTDMA2 Read Access 1 | CPUa | RTDMA2 | RTDMA2 Read Access 1 | CPUa Read Access 4 | |
6 | RTDMA2 Read Access 1 | Initiator Select 1 | RTDMA2 | RTDMA2 Read Access 1 | |||
7 | Initiator Select 1 | RTDMA2 | |||||
8 | Initiator Select 1 | RTDMA2 | |||||
9 | Initiator Select 1 | RTDMA2 |
The default initiator selects at reset is set such that the primary CPU has access to the memory (that is, the primary CPU has access to LPx, LDx, CDx, CPx, and M0 by default).
The round-robin pointer is changed when triggered by a pending request from an initiator other than the one currently granted access. The pointer is changed to the next initiator with priority, which takes 1 cycle. This occurs for each round-robin pointer, with greater weight given to initiators coming from fast access ports.
This two-level arbitration scheme makes sure that no initiator is stalled forever except for atomic and burst operations. Back-to-back accesses or multiple simultaneous accesses from an initiator does not block the other initiator from getting granted access. Essentially, when the round-robin pointer is set to an initiator, a pending request from any other initiator forces the round-robin pointer to switch, so there is fair arbitration without blocking an initiator.
For example, if CPUa and CPUb are initiating back-to-back read accesses the round-robin pointer switches between CPUa and CPUb every cycle so accesses from CPUa and CPUb are served alternatively one after the other.
Another example is if CPUa initiates four possible accesses (program read, data read 1, data read 2, and data write) and the RTDMA is initiating back-to-back read accesses at the same time. If the current pointer is set to CPUa, only the CPUa data write access gets granted before the pointer is switched to RTDMA to serve the read request. The pointer is then switched back to service CPUa program read, and at this time both the new RTDMA request as well as the CPUa data read 1 and 2 are pending. The pointer is switched back to CPUa to serve the data read 1 access and then CPUa data read 2 access.