Merge branch 'bugfix/fix_esp32s3_diram_calculation_v4.4' into 'release/v4.4'

Tools: Fix diram size calculation (v4.4)

See merge request espressif/esp-idf!21671
This commit is contained in:
Roland Dobai
2023-02-03 14:36:13 +08:00
4 changed files with 25888 additions and 387 deletions

View File

@ -567,13 +567,17 @@ class StructureForSummary(object):
r = StructureForSummary()
diram_filter = filter(in_diram, segments)
r.diram_total = int(get_size(diram_filter) / 2)
r.diram_total = get_size(diram_filter)
dram_filter = filter(in_dram, segments)
r.dram_total = get_size(dram_filter)
iram_filter = filter(in_iram, segments)
r.iram_total = get_size(iram_filter)
# This fixes counting the diram twice if the cache fills the iram entirely
if r.iram_total == 0:
r.diram_total //= 2
def filter_in_section(sections: Iterable[MemRegions.Region], section_to_check: str) -> List[MemRegions.Region]:
return list(filter(lambda x: LinkingSections.in_section(x.section, section_to_check), sections)) # type: ignore

File diff suppressed because one or more lines are too long

View File

@ -4421,7 +4421,7 @@ Total sizes:
Used static IRAM: 46786 bytes ( 239934 remain, 16.3% used)
.text size: 45759 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 11772 bytes ( 123396 remain, 8.7% used)
Used stat D/IRAM: 11772 bytes ( 258564 remain, 4.4% used)
.data size: 9252 bytes
.bss size: 2520 bytes
Used Flash size : 114851 bytes
@ -4429,13 +4429,26 @@ Used Flash size : 114851 bytes
.rodata : 27132 bytes
Total image size: 170889 bytes (.bin may be padded larger)
***
Running idf_size.py for esp32s3 configured with 32KB of icache...
Total sizes:
Used stat D/IRAM: 66875 bytes ( 278981 remain, 19.3% used)
.data size: 10609 bytes
.bss size: 2544 bytes
.text size: 52695 bytes
.vectors size: 1027 bytes
Used Flash size : 126703 bytes
.text : 94967 bytes
.rodata : 31480 bytes
Total image size: 191034 bytes (.bin may be padded larger)
***
Running idf_size.py for esp32s3 with overflow...
Total sizes:
Used static IRAM: 337906 bytes ( -51186 remain, 117.9% used) Overflow detected! You can run idf.py size-files for more information.
.text size: 336879 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 94049 bytes ( 41119 remain, 69.6% used)
Used stat D/IRAM: 94049 bytes ( 176287 remain, 34.8% used)
.data size: 68929 bytes
.bss size: 25120 bytes
Used Flash size : 461714 bytes
@ -4449,7 +4462,7 @@ Total sizes:
Used static IRAM: 46786 bytes ( 239934 remain, 16.3% used)
.text size: 45759 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 11772 bytes ( 123396 remain, 8.7% used)
Used stat D/IRAM: 11772 bytes ( 258564 remain, 4.4% used)
.data size: 9252 bytes
.bss size: 2520 bytes
Used Flash size : 114851 bytes
@ -4463,7 +4476,7 @@ Total sizes:
Used static IRAM: 46786 bytes ( 239934 remain, 16.3% used)
.text size: 45759 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 11772 bytes ( 123396 remain, 8.7% used)
Used stat D/IRAM: 11772 bytes ( 258564 remain, 4.4% used)
.data size: 9252 bytes
.bss size: 2520 bytes
Used Flash size : 114851 bytes
@ -4507,7 +4520,7 @@ Total sizes:
Used static IRAM: 46786 bytes ( 239934 remain, 16.3% used)
.text size: 45759 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 11772 bytes ( 123396 remain, 8.7% used)
Used stat D/IRAM: 11772 bytes ( 258564 remain, 4.4% used)
.data size: 9252 bytes
.bss size: 2520 bytes
Used Flash size : 114851 bytes
@ -4773,7 +4786,7 @@ Total sizes:
Used static IRAM: 46786 bytes ( 239934 remain, 16.3% used)
.text size: 45759 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 11772 bytes ( 123396 remain, 8.7% used)
Used stat D/IRAM: 11772 bytes ( 258564 remain, 4.4% used)
.data size: 9252 bytes
.bss size: 2520 bytes
Used Flash size : 114851 bytes
@ -16560,10 +16573,10 @@ Producing JSON output for esp32s3...
"diram_vectors": 0,
"diram_rodata": 0,
"diram_other": 0,
"diram_total": 135168,
"diram_total": 270336,
"used_diram": 11772,
"used_diram_ratio": 0.08709161931818182,
"diram_remain": 123396,
"used_diram_ratio": 0.04354580965909091,
"diram_remain": 258564,
"flash_code": 87463,
"flash_rodata": 27132,
"flash_other": 256,

View File

@ -117,6 +117,8 @@ json_test() {
&& python -m coverage run -a $IDF_PATH/tools/idf_size.py --target esp32c3 --archive_details libdriver.a app_esp32c3.map &>> output \
&& echo -e "\n***\nRunning idf_size.py for esp32s3..." &>> output \
&& python -m coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 app_esp32s3.map &>> output \
&& echo -e "\n***\nRunning idf_size.py for esp32s3 configured with 32KB of icache..." &>> output \
&& python -m coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 app_esp32s3_32k_icache.map &>> output \
&& echo -e "\n***\nRunning idf_size.py for esp32s3 with overflow..." &>> output \
&& python -m coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 overflow_esp32s3.map &>> output \
&& echo -e "\n***\nRunning idf_size.py for esp32s3 (target autodetected)..." &>> output \