20.23 RAM Capacity Estimation
Memory areas used and managed by the RI600PX are broadly classified into four types of sections.
- BRI_RAM section: The RI600PX's management data, data queue area created by the system configuration file, message buffer area created by the system configuration file without specifying section
- RRI_RAM section: The RI600PX's management data (when dynamic creation function is used)
- BURI_HEAP section: Fixed-sized memory pool area and variable-sized memory pool area created by the system configuration file without specifying section
- SURI_STACK section: User stack area of tasks created by the system configuration file without specifying section
- SI section: System stack area
20.23.1 BRI_RAM and RRI_RAM section
The RI600PX's management data is located in the BRI_RAM and RRI_RAM section.
The
Table 20-11 shows the size calculation method for the BRI_RAM and RRI_RAM section (unit: bytes). In addition, actual size may become larger than the value computed by
Table 20-11 for boundary adjustment.
Table 20-11 BRI_RAM and RRI_RAM Section Size Calculation Method
|
|
Size Calculation Method (in bytes)
|
|
|
28 + 4down( ( TMAX_TPRI - 1) / 32 + 1) + TMAX_TPRI
+ VTMAX_SEM + 2 VTMAX_DTQ + VTMAX_FLG + VTMAX_MBX
+ VTMAX_MTX + 2 VTMAX_MBF + VTMAX_MPF + VTMAX_MPL
|
|
4 + VTMAX_SEM + 2 VTMAX_DTQ + VTMAX_FLG + VTMAX_MBX
+ VTMAX_MTX + 2 VTMAX_MBF + VTMAX_MPF + VTMAX_MPL
|
|
|
|
|
|
|
|
4 VTMAX_SEM + down ( VTMAX_SEM / 8 + 1)
|
|
|
|
|
8 VTMAX_FLG + 2down ( VTMAX_FLG / 8 + 1)
|
|
|
Data queue control block 7
|
|
6 VTMAX_DTQ+ down ( VTMAX_DTQ / 8 + 1) + DTQ_ALLSIZE
|
|
|
|
|
8 VTMAX_MBX + 2down ( VTMAX_MBX / 8 + 1)
|
|
|
|
|
VTMAX_MTX + down ( VTMAX_MTX / 8 + 1)
|
|
|
Message buffer control block 13
|
|
16 VTMAX_MBF + MBF_ALLSIZE
|
|
|
Fixed-sized memory pool control block 15
|
|
8 VTMAX_MPF + down ( VTMAX_MPF / 8 + 1)
+ (memorypool[].num_block / 8 + 1)
|
|
|
Variable-sized memory pool control block 17
|
|
|
|
|
Cyclic handler control block 19
|
|
|
|
|
Alarm handler control block 21
|
|
|
|
|
3
This area is not generated when VTMAX_SEM is 0.
5
This area is not generated when VTMAX_FLG is 0.
7
This area is not generated when VTMAX_DTQ is 0.
9
This area is not generated when VTMAX_MBX is 0.
11
This area is not generated when VTMAX_MTX is 0.
13
This area is not generated when VTMAX_MBF is 0.
15
This area is not generated when VTMAX_MPF is 0.
17
This area is not generated when VTMAX_MPL is 0.
19
This area is not generated when VTMAX_CYH is 0.
21
This area is not generated when VTMAX_ALH is 0.
|
Note Each keyword in the size calculation methods has the following meaning.
DTQ_ALLSIZE: Total of size of data queue area created in the system configuration file. Concretely, it is calculated by the following expressions.
dataqueue[].buffer_size * 4
Note,
DTQ_ALLSIZE is 4 when this calculation result is 0.
MBF_ALLSIZE: Total of size of message buffer area created in the system configuration file without specifying "mbf_section". Concretely, it is calculated by the following expressions.
message_buffer[].mbf_size * 4
20.23.2 BURI_HEAP section
The fixed-sized memory pool area and variable-sized memory pool area are located in the BURI_HEAP section. Note, when a fixed-sized memory pool and variable-sized memory pool are defined, the area can be located into the user-specific section.
The size of the BURI_HEAP section is calculated by the total of following. In addition, when user specific data is generated in the BURI_HEAP section, the size should be added.
( memorypool[].siz_block * memorypool[].num_block)
variable_memorypool[].heap_size
20.23.3 SURI_STACK section
The user stack area is located in the SURI_STACK section. Note, when a task is defined, the user stack area can be located into the user-specific section.
The size of the SURI_STACK section is calculated about the definition of
Task Information (task[]) that omits to specify "stack_section" by the following expressions. In addition, when user specific data is generated in the SURI_STACK section, the size should be added.
The system stack area is located in the SI section.