Shared memory is a mechanism that allows multiple processes or subsystems in a system to access the same physical memory space. Here, Only one subsystem at a time can access shared memory space. This technique enables fast and efficient communication between different subsystems and memory. It allows the DSS subsystem's memory to be directly utilized as RAM for the APPSS subsystem, ensuring efficient data sharing and enhanced performance across both subsystems. This solution optimizes memory usage, reduces data transfer overhead, and improves the overall system efficiency, making it ideal for applications that require high-performance computing and real-time data processing.
xWRL684x has 896KB Shared Memory in following configurations:
This example shows the usage of 768KB DSS/APPSS Shared memory as APPSS memory and usage of 128KB DSS/FECSS (configured for DSS by default) shared memory in APPSS software. Following registers will help in configuring 768KB Memory between APPSS and HWASS (Refer to Technical Reference Manual for more details):
To configure FECSS/DSS Shared Memory (128KB) for FECSS(Configured for DSS by default), Following registers have to be configured (Refer to Technical Reference Manual for more details):
TOP_PRCM:DSS_PD_MEM_SHARE_REG
FEC_CTRL:FECSS_SHARED_MEM_CLK_GATE
When running in functional mode RBL can be leveraged to perform these configurations. This can be done through modifying "sharedRamAllocationControl" field found in metaimage_cfg."profile".json macro found in build. The below diagram and table demonstrate how "sharedRamAllocationControl" field allows us to allocate different shared memory. The following configurations are possible:
| Bits | Field | Description |
|---|---|---|
| [1:0] | TCMA shared RAM | 0b00: Don't allocate TCMA to APPSS 0b01: Allocate immediate 256 KB to APPSS 0b10: Invalid 0b11: Allocate 512 KB to APPSS |
| [2:2] | Extend APPSS TCMB | 0b0: Don't allocate TCMA to APPSS 0b1: Allocate 256 KB to APPSS (i.e. extend TCMB) |
| [3:3] | FECSS Shared RAM Allocation | 0b0: Don't allocate shared RAM to FECSS 0b1 Allocated shared RAM to FECSS |
| [15:4] | Reserved | – |
| [16:16] | FECSS ROM Eclipse | 0b0: Don't eclipse the FECSS ROM with shared RAM 0b1: Eclipse FECSS ROM with shared RAM |
| [31:17] | Reserved | - |
To ensure everything functions as expected, especially when using a debugger, a specific initialization process must be followed:
This initialization process is important to ensure the system is set up correctly for shared memory usage during debugging.
| SHARED RAM ALLOCATION CONTROL VALUE | TOTAL APPSS RAM (INCL. SHARED RAM) | DSS (FECSS shared Memory to be taken care by DSS) |
|---|---|---|
| "sharedRamAllocationControl": "0" | 0x00000000 - 0x0007FFFF (512 KB)(TCMA address in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) | 0x88000000 - 0x8815FFFF (1408 KB) |
| "sharedRamAllocationControl": "1", | 0x00000000 - 0x000BFFFF (768 KB)(TCMA address in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) | 0x88000000 - 0x8811FFFF (1152 KB) |
| "sharedRamAllocationControl": "3", | 0x00000000 - 0x000FFFFF (1024 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) | 0x88000000 - 0x880DFFFF (896 KB) |
| "sharedRamAllocationControl": "5", | 0x00000000 - 0x000BFFFF (768 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0805FFFF (512KB)(TCMB) | 0x88000000 - 0x880DFFFF (896 KB) |
| "sharedRamAllocationControl": "7", | 0x00000000 - 0x000FFFFF (1024 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0805FFFF (512KB)(TCMB) | 0x88000000 - 0x8809FFFF (640 KB) |
| SHARED RAM ALLOCATION CONTROL VALUE | TOTAL DSS RAM (INCL. SHARED RAM) | FECSS (FECSS shared Memory) |
|---|---|---|
| "sharedRamAllocationControl": "8" | 0x88000000 - 0x8815FFFF (1408 KB) | 0x21080000 - 0x21097FFC (128 KB) |
| "sharedRamAllocationControl": "0" | 0x88000000 - 0x8813FFFF (1280 KB) | 0x21080000 - 0x2111FFFC (256 KB) |
In case complete DSS Memory is not used, that memory can be used for APPSS Software. However as this memory is not initialized by RBL, application has to ensure that this memory is intitialized before use. Hence we cannot use it for .text, .data, .ro sections. This example demonstrates one such use case.
.text file is being assigned to the TCMA_SHARED_RAM | TCMB_SHARED_RAM section in the linker file
Shared Memory Demonstration:
When this memory is configured for DSS the address range is in continuation to DSS Memory.
The .bss.l3 section is assigned to the DSS/FECSS shared memory space in the linker file. Fisrt 256KB will be allocated in Native RAM. The array created spans 300 KB forcing allocation into the FECSS shared memory for the remaining data. This example writes 0xFF to these memory locations.
| Parameter | Value |
|---|---|
| CPU + OS | r5fss0-0 freertos |
| r5fss0-0 nortos | |
| Toolchain | ti-arm-clang |
| Boards | xWRL6844-evm |
| Example folder | examples/drivers/sharedmemory/ |
A GUI tool SysConfig is used to configure different modules and peripherals of the example. Using this tool, users can select and customize different modules and peripherals. The SysConfig tool will generate the code for initializing and configuring these modules. This configuration is saved to a file called example.syscfg for every example. To know more about how to use SDK with SysConfig, Visit this page
Shown below is a sample output when the application is run,