summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-09-06 22:38:54 +0700
committerhathach <[email protected]>2026-09-06 22:38:54 +0700
commitd7a750fd59c3132f9489366fef5e88afe57e5b83 (patch)
tree11a2c6fe6c295f08efe53135c27d32a2ee27b480
parent760edc55cb4971553f6a674733b435b2845db648 (diff)
tools: count HPM fast code in flash and RAMrework-metrics
-rw-r--r--test/hil/test/test_membrowse_compare.py12
-rw-r--r--tools/membrowse_compare.py4
2 files changed, 14 insertions, 2 deletions
diff --git a/test/hil/test/test_membrowse_compare.py b/test/hil/test/test_membrowse_compare.py
index 4a607562e..88ab94216 100644
--- a/test/hil/test/test_membrowse_compare.py
+++ b/test/hil/test/test_membrowse_compare.py
@@ -119,6 +119,18 @@ class PerFileSizes(unittest.TestCase):
['/co/src/'])['device/usbd.c']
self.assertEqual(sizes, {'flash': 8, 'ram': 8})
+ def test_fast_code_in_ilm_counts_flash_load_image_and_ram(self):
+ layout = {
+ 'ILM': fake_region(0x00080000, 0x20000,
+ [fake_section('.fast', 0x00080000, 8, 'code')]),
+ }
+ syms = [{'name': 'dcd_event_handler', 'size': 8, 'section': '.fast',
+ 'source_file': 'usbd.c',
+ 'object_file': 'device/cdc_msc/CMakeFiles/cdc_msc.dir/co/src/device/usbd.c.obj'}]
+ sizes = mc.per_file_sizes(fake_report_with_layout(syms, layout),
+ ['/co/src/'])['device/usbd.c']
+ self.assertEqual(sizes, {'flash': 8, 'ram': 8})
+
def test_split_across_two_ram_regions_stays_ram_only(self):
# Multiple regions can all be RAM banks.
layout = {
diff --git a/tools/membrowse_compare.py b/tools/membrowse_compare.py
index f955602ba..72cd8f8d4 100644
--- a/tools/membrowse_compare.py
+++ b/tools/membrowse_compare.py
@@ -15,10 +15,10 @@ from membrowse_report import extract_ld_scripts, extract_defsyms
FLASH_SECTIONS = ('.text', '.rodata', '.isr_vector', '.vector', '.init', '.fini',
'.interrupts', '.flash_config', '.ivt', '.id_code', '.option_setting')
RAM_SECTIONS = ('.bss', '.noinit', '.stack', '.heap',
- 'NonCacheable', '.fast', 'm_usb_global')
+ 'NonCacheable', 'm_usb_global')
# These sections have a flash load image and RAM run address.
BOTH_SECTIONS = ('.data', '.relocate', '.ramfunc', '.fastrun', '.itcm', '.dtcm', '.ccmram',
- '.time_critical')
+ '.time_critical', '.fast')
_RAM_REGION_HINTS = ('ram', 'tcm', 'ddr')
_FLASH_REGION_HINTS = ('flash', 'rom')