Skip to content

Commit 1c35538

Browse files
committed
idf_size.py: Fix issue where diram size was halved in cases where iram was not fully filled with cache
This fixes an attempted fix for diram size calculation where it was counted twice, however the fix did not account for cases where iram was not fully filled with cache and therefore was of non 0 size. Now the calculation should be correct regardless of the cache size. Closes #9960 Fix expected output
1 parent dfa9a81 commit 1c35538

File tree

4 files changed

+26314
-387
lines changed

4 files changed

+26314
-387
lines changed

tools/idf_size.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,17 @@ def in_iram(x: MemRegions.Region) -> bool:
571571
r = StructureForSummary()
572572

573573
diram_filter = filter(in_diram, segments)
574-
r.diram_total = int(get_size(diram_filter) / 2)
574+
r.diram_total = get_size(diram_filter)
575575

576576
dram_filter = filter(in_dram, segments)
577577
r.dram_total = get_size(dram_filter)
578578
iram_filter = filter(in_iram, segments)
579579
r.iram_total = get_size(iram_filter)
580580

581+
# This fixes counting the diram twice if the cache fills the iram entirely
582+
if r.iram_total == 0:
583+
r.diram_total //= 2
584+
581585
def filter_in_section(sections: Iterable[MemRegions.Region], section_to_check: str) -> List[MemRegions.Region]:
582586
return list(filter(lambda x: LinkingSections.in_section(x.section, section_to_check), sections)) # type: ignore
583587

0 commit comments

Comments
 (0)