Skip to content

Commit

Permalink
idf_size.py: Fix issue where diram size was halved in cases where ira…
Browse files Browse the repository at this point in the history
…m 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
  • Loading branch information
DNedic committed Dec 19, 2022
1 parent dfa9a81 commit 1c35538
Show file tree
Hide file tree
Showing 4 changed files with 26,314 additions and 387 deletions.
6 changes: 5 additions & 1 deletion tools/idf_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,17 @@ def in_iram(x: MemRegions.Region) -> bool:
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

Expand Down
Loading

0 comments on commit 1c35538

Please sign in to comment.