mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Tools: Fix memory calculations of idf_size.py
This commit is contained in:
parent
706a17bdf1
commit
34ab97f081
@ -46,7 +46,7 @@ MEMORY
|
||||
|
||||
#if CONFIG_APP_BUILD_USE_FLASH_SECTIONS
|
||||
/* Flash mapped instruction data */
|
||||
iram0_2_seg (RX) : org = 0x42000020, len = 0x8000000-0x20
|
||||
iram0_2_seg (RX) : org = 0x42000020, len = 0x800000-0x20
|
||||
|
||||
/**
|
||||
* (0x20 offset above is a convenience for the app binary image generation.
|
||||
@ -65,7 +65,8 @@ MEMORY
|
||||
|
||||
#if CONFIG_APP_BUILD_USE_FLASH_SECTIONS
|
||||
/* Flash mapped constant data */
|
||||
drom0_0_seg (R) : org = 0x3C000020, len = 0x8000000-0x20
|
||||
drom0_0_seg (R) : org = 0x3C000020, len = 0x800000-0x20
|
||||
|
||||
|
||||
/* (See iram0_2_seg for meaning of 0x20 offset in the above.) */
|
||||
#endif // CONFIG_APP_BUILD_USE_FLASH_SECTIONS
|
||||
|
@ -26,4 +26,3 @@ PROVIDE ( TWAI = 0x6002B000 );
|
||||
PROVIDE ( GPSPI4 = 0x60037000 );
|
||||
PROVIDE ( APB_SARADC = 0x60040000 );
|
||||
PROVIDE ( GDMA = 0x6003F000 );
|
||||
PROVIDE ( IEEE802154 = 0x60047000 );
|
||||
|
@ -37,7 +37,6 @@
|
||||
#define SRAM_DRAM_END (SRAM_IRAM_END - I_D_SRAM_OFFSET) /* 2nd stage bootloader iram_loader_seg start address */
|
||||
#define I_D_SRAM_SIZE (SRAM_DRAM_END - SRAM_DRAM_START)
|
||||
|
||||
|
||||
#define ICACHE_SIZE 0x8000
|
||||
#define SRAM_IRAM_ORG (SRAM_IRAM_START + CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE)
|
||||
#define SRAM_IRAM_SIZE (I_D_SRAM_SIZE + ICACHE_SIZE - CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE)
|
||||
@ -66,7 +65,7 @@ MEMORY
|
||||
#if CONFIG_APP_BUILD_USE_FLASH_SECTIONS
|
||||
/* Flash mapped instruction data */
|
||||
iram0_2_seg (RX) : org = 0x42000020, len = 0x800000-0x20
|
||||
|
||||
|
||||
/**
|
||||
* (0x20 offset above is a convenience for the app binary image generation.
|
||||
* Flash cache has 64KB pages. The .bin file which is flashed to the chip
|
||||
|
@ -1,288 +0,0 @@
|
||||
components/app_update/otatool.py
|
||||
components/efuse/efuse_table_gen.py
|
||||
components/efuse/test_efuse_host/efuse_tests.py
|
||||
components/esp32s2/test/gen_digital_signature_tests.py
|
||||
components/esp_local_ctrl/python/esp_local_ctrl_pb2.py
|
||||
components/esp_netif/test_apps/component_ut_test.py
|
||||
components/espcoredump/corefile/gdb.py
|
||||
components/espcoredump/test/test_espcoredump.py
|
||||
components/lwip/weekend_test/net_suite_test.py
|
||||
components/mbedtls/esp_crt_bundle/gen_crt_bundle.py
|
||||
components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/test_gen_crt_bundle.py
|
||||
components/mqtt/weekend_test/mqtt_publish_test.py
|
||||
components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py
|
||||
components/partition_table/gen_empty_partition.py
|
||||
components/partition_table/gen_esp32part.py
|
||||
components/partition_table/parttool.py
|
||||
components/partition_table/test_gen_esp32part_host/gen_esp32part_tests.py
|
||||
components/protocomm/python/constants_pb2.py
|
||||
components/protocomm/python/sec0_pb2.py
|
||||
components/protocomm/python/sec1_pb2.py
|
||||
components/protocomm/python/session_pb2.py
|
||||
components/ulp/esp32ulp_mapgen.py
|
||||
components/wifi_provisioning/python/wifi_config_pb2.py
|
||||
components/wifi_provisioning/python/wifi_constants_pb2.py
|
||||
components/wifi_provisioning/python/wifi_scan_pb2.py
|
||||
components/xtensa/trax/traceparse.py
|
||||
docs/build_docs.py
|
||||
docs/conf_common.py
|
||||
docs/en/conf.py
|
||||
docs/extensions/google_analytics.py
|
||||
docs/extensions/html_redirects.py
|
||||
docs/extensions/list_filter.py
|
||||
docs/extensions/toctree_filter.py
|
||||
docs/generate_chart.py
|
||||
docs/get_github_rev.py
|
||||
docs/idf_extensions/build_system/__init__.py
|
||||
docs/idf_extensions/esp_err_definitions.py
|
||||
docs/idf_extensions/exclude_docs.py
|
||||
docs/idf_extensions/format_idf_target.py
|
||||
docs/idf_extensions/gen_defines.py
|
||||
docs/idf_extensions/gen_idf_tools_links.py
|
||||
docs/idf_extensions/gen_toolchain_links.py
|
||||
docs/idf_extensions/gen_version_specific_includes.py
|
||||
docs/idf_extensions/include_build_file.py
|
||||
docs/idf_extensions/kconfig_reference.py
|
||||
docs/idf_extensions/latex_builder.py
|
||||
docs/idf_extensions/link_roles.py
|
||||
docs/idf_extensions/run_doxygen.py
|
||||
docs/idf_extensions/util.py
|
||||
docs/sanitize_version.py
|
||||
docs/test/en/conf.py
|
||||
docs/test/test_docs.py
|
||||
docs/test/test_sphinx_idf_extensions.py
|
||||
docs/zh_CN/conf.py
|
||||
examples/bluetooth/nimble/blecent/blecent_test.py
|
||||
examples/bluetooth/nimble/blehr/blehr_test.py
|
||||
examples/bluetooth/nimble/bleprph/bleprph_test.py
|
||||
examples/cxx/exceptions/example_test.py
|
||||
examples/cxx/pthread/example_test.py
|
||||
examples/cxx/rtti/example_test.py
|
||||
examples/get-started/blink/example_test.py
|
||||
examples/get-started/hello_world/example_test.py
|
||||
examples/peripherals/gpio/generic_gpio/example_test.py
|
||||
examples/peripherals/i2c/i2c_tools/example_test.py
|
||||
examples/peripherals/rmt/ir_protocols/example_test.py
|
||||
examples/peripherals/sdio/sdio_test.py
|
||||
examples/peripherals/twai/twai_alert_and_recovery/example_test.py
|
||||
examples/peripherals/twai/twai_network/example_test.py
|
||||
examples/peripherals/twai/twai_self_test/example_test.py
|
||||
examples/protocols/asio/chat_client/asio_chat_client_test.py
|
||||
examples/protocols/asio/chat_server/asio_chat_server_test.py
|
||||
examples/protocols/asio/ssl_client_server/example_test.py
|
||||
examples/protocols/asio/tcp_echo_server/asio_tcp_server_test.py
|
||||
examples/protocols/asio/udp_echo_server/asio_udp_server_test.py
|
||||
examples/protocols/cbor/example_test.py
|
||||
examples/protocols/esp_http_client/esp_http_client_test.py
|
||||
examples/protocols/esp_local_ctrl/example_test.py
|
||||
examples/protocols/esp_local_ctrl/scripts/esp_local_ctrl.py
|
||||
examples/protocols/esp_local_ctrl/scripts/proto.py
|
||||
examples/protocols/http_server/advanced_tests/http_server_advanced_test.py
|
||||
examples/protocols/http_server/advanced_tests/scripts/test.py
|
||||
examples/protocols/http_server/persistent_sockets/http_server_persistence_test.py
|
||||
examples/protocols/http_server/simple/http_server_simple_test.py
|
||||
examples/protocols/http_server/ws_echo_server/ws_server_example_test.py
|
||||
examples/protocols/https_request/example_test.py
|
||||
examples/protocols/https_x509_bundle/example_test.py
|
||||
examples/protocols/icmp_echo/example_test.py
|
||||
examples/protocols/mdns/mdns_example_test.py
|
||||
examples/protocols/modbus/serial/example_test.py
|
||||
examples/protocols/modbus/tcp/example_test.py
|
||||
examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py
|
||||
examples/protocols/mqtt/ssl_ds/configure_ds.py
|
||||
examples/protocols/mqtt/tcp/mqtt_tcp_example_test.py
|
||||
examples/protocols/mqtt/ws/mqtt_ws_example_test.py
|
||||
examples/protocols/mqtt/wss/mqtt_wss_example_test.py
|
||||
examples/protocols/openssl_client/example_test.py
|
||||
examples/protocols/openssl_server/example_test.py
|
||||
examples/protocols/pppos_client/example_test.py
|
||||
examples/protocols/sntp/example_test.py
|
||||
examples/protocols/sockets/non_blocking/example_test.py
|
||||
examples/protocols/sockets/tcp_client/example_test.py
|
||||
examples/protocols/sockets/tcp_server/example_test.py
|
||||
examples/protocols/sockets/udp_client/example_test.py
|
||||
examples/protocols/sockets/udp_server/example_test.py
|
||||
examples/protocols/websocket/example_test.py
|
||||
examples/provisioning/legacy/ble_prov/ble_prov_test.py
|
||||
examples/provisioning/legacy/custom_config/components/custom_provisioning/python/custom_config_pb2.py
|
||||
examples/provisioning/legacy/softap_prov/softap_prov_test.py
|
||||
examples/provisioning/wifi_prov_mgr/wifi_prov_mgr_test.py
|
||||
examples/security/flash_encryption/example_test.py
|
||||
examples/storage/ext_flash_fatfs/example_test.py
|
||||
examples/storage/nvs_rw_blob/nvs_rw_blob_example_test.py
|
||||
examples/storage/nvs_rw_value/nvs_rw_value_example_test.py
|
||||
examples/storage/nvs_rw_value_cxx/nvs_rw_value_cxx_example_test.py
|
||||
examples/storage/partition_api/partition_find/partition_find_example_test.py
|
||||
examples/storage/partition_api/partition_mmap/partition_mmap_example_test.py
|
||||
examples/storage/partition_api/partition_ops/partition_ops_example_test.py
|
||||
examples/storage/parttool/example_test.py
|
||||
examples/storage/parttool/parttool_example.py
|
||||
examples/storage/sd_card/sd_card_example_test.py
|
||||
examples/storage/semihost_vfs/semihost_vfs_example_test.py
|
||||
examples/storage/spiffs/spiffs_example_test.py
|
||||
examples/storage/spiffsgen/example_test.py
|
||||
examples/storage/wear_levelling/wear_levelling_example_test.py
|
||||
examples/system/app_trace_to_host/example_test.py
|
||||
examples/system/base_mac_address/example_test.py
|
||||
examples/system/console/example_test.py
|
||||
examples/system/deep_sleep/example_test.py
|
||||
examples/system/esp_event/default_event_loop/example_test.py
|
||||
examples/system/esp_event/user_event_loops/example_test.py
|
||||
examples/system/esp_timer/example_test.py
|
||||
examples/system/freertos/real_time_stats/example_test.py
|
||||
examples/system/gcov/example_test.py
|
||||
examples/system/himem/example_test.py
|
||||
examples/system/light_sleep/example_test.py
|
||||
examples/system/ota/advanced_https_ota/example_test.py
|
||||
examples/system/ota/native_ota_example/example_test.py
|
||||
examples/system/ota/otatool/example_test.py
|
||||
examples/system/ota/otatool/get_running_partition.py
|
||||
examples/system/ota/otatool/otatool_example.py
|
||||
examples/system/ota/simple_ota_example/example_test.py
|
||||
examples/system/perfmon/example_test.py
|
||||
examples/system/select/example_test.py
|
||||
examples/system/sysview_tracing/example_test.py
|
||||
examples/system/sysview_tracing_heap_log/example_test.py
|
||||
examples/system/task_watchdog/example_test.py
|
||||
examples/system/ulp/example_test.py
|
||||
examples/system/ulp_adc/example_test.py
|
||||
examples/system/unit_test/example_test.py
|
||||
examples/wifi/iperf/iperf_test.py
|
||||
tools/ble/lib_ble_client.py
|
||||
tools/ble/lib_gap.py
|
||||
tools/ble/lib_gatt.py
|
||||
tools/check_python_dependencies.py
|
||||
tools/check_term.py
|
||||
tools/ci/check_artifacts_expire_time.py
|
||||
tools/ci/check_callgraph.py
|
||||
tools/ci/check_codeowners.py
|
||||
tools/ci/check_deprecated_kconfigs.py
|
||||
tools/ci/check_examples_cmake_make.py
|
||||
tools/ci/check_executables.py
|
||||
tools/ci/check_kconfigs.py
|
||||
tools/ci/check_public_headers.py
|
||||
tools/ci/check_readme_links.py
|
||||
tools/ci/check_rules_yml.py
|
||||
tools/ci/check_tools_files_patterns.py
|
||||
tools/ci/checkout_project_ref.py
|
||||
tools/ci/ci_fetch_submodule.py
|
||||
tools/ci/deploy_docs.py
|
||||
tools/ci/envsubst.py
|
||||
tools/ci/normalize_clangtidy_path.py
|
||||
tools/ci/python_packages/gitlab_api.py
|
||||
tools/ci/python_packages/idf_http_server_test/adder.py
|
||||
tools/ci/python_packages/idf_http_server_test/client.py
|
||||
tools/ci/python_packages/idf_http_server_test/test.py
|
||||
tools/ci/python_packages/idf_iperf_test_util/Attenuator.py
|
||||
tools/ci/python_packages/idf_iperf_test_util/LineChart.py
|
||||
tools/ci/python_packages/idf_iperf_test_util/PowerControl.py
|
||||
tools/ci/python_packages/idf_iperf_test_util/TestReport.py
|
||||
tools/ci/python_packages/tiny_test_fw/App.py
|
||||
tools/ci/python_packages/tiny_test_fw/DUT.py
|
||||
tools/ci/python_packages/tiny_test_fw/Env.py
|
||||
tools/ci/python_packages/tiny_test_fw/EnvConfig.py
|
||||
tools/ci/python_packages/tiny_test_fw/TinyFW.py
|
||||
tools/ci/python_packages/tiny_test_fw/Utility/CIAssignTest.py
|
||||
tools/ci/python_packages/tiny_test_fw/Utility/CaseConfig.py
|
||||
tools/ci/python_packages/tiny_test_fw/Utility/GitlabCIJob.py
|
||||
tools/ci/python_packages/tiny_test_fw/Utility/SearchCases.py
|
||||
tools/ci/python_packages/tiny_test_fw/Utility/TestCase.py
|
||||
tools/ci/python_packages/tiny_test_fw/bin/Runner.py
|
||||
tools/ci/python_packages/tiny_test_fw/bin/example.py
|
||||
tools/ci/python_packages/tiny_test_fw/docs/conf.py
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
tools/ci/python_packages/ttfw_idf/CIScanTests.py
|
||||
>>>>>>> idf_size.py: fixed diram counted twice issue, and improve display
|
||||
tools/ci/python_packages/ttfw_idf/DebugUtils.py
|
||||
tools/ci/python_packages/ttfw_idf/IDFAssignTest.py
|
||||
tools/ci/python_packages/ttfw_idf/IDFDUT.py
|
||||
tools/ci/python_packages/ttfw_idf/__init__.py
|
||||
tools/ci/python_packages/ttfw_idf/unity_test_parser.py
|
||||
tools/ci/python_packages/wifi_tools.py
|
||||
tools/ci/test_autocomplete.py
|
||||
tools/ci/test_check_kconfigs.py
|
||||
tools/cmake/convert_to_cmake.py
|
||||
tools/esp_app_trace/espytrace/apptrace.py
|
||||
tools/esp_app_trace/espytrace/sysview.py
|
||||
tools/esp_app_trace/logtrace_proc.py
|
||||
tools/esp_app_trace/sysviewtrace_proc.py
|
||||
tools/esp_prov/esp_prov.py
|
||||
tools/esp_prov/prov/custom_prov.py
|
||||
tools/esp_prov/prov/wifi_prov.py
|
||||
tools/esp_prov/prov/wifi_scan.py
|
||||
tools/esp_prov/security/security.py
|
||||
tools/esp_prov/security/security0.py
|
||||
tools/esp_prov/security/security1.py
|
||||
tools/esp_prov/transport/ble_cli.py
|
||||
tools/esp_prov/transport/transport.py
|
||||
tools/esp_prov/transport/transport_ble.py
|
||||
tools/esp_prov/transport/transport_console.py
|
||||
tools/esp_prov/transport/transport_http.py
|
||||
tools/esp_prov/utils/convenience.py
|
||||
tools/find_apps.py
|
||||
tools/find_build_apps/common.py
|
||||
tools/find_build_apps/make.py
|
||||
tools/gen_esp_err_to_name.py
|
||||
tools/idf.py
|
||||
tools/idf_monitor.py
|
||||
tools/idf_py_actions/constants.py
|
||||
tools/idf_py_actions/core_ext.py
|
||||
tools/idf_py_actions/create_ext.py
|
||||
tools/idf_py_actions/debug_ext.py
|
||||
tools/idf_py_actions/dfu_ext.py
|
||||
tools/idf_py_actions/errors.py
|
||||
tools/idf_py_actions/global_options.py
|
||||
tools/idf_py_actions/serial_ext.py
|
||||
tools/idf_py_actions/tools.py
|
||||
tools/idf_py_actions/uf2_ext.py
|
||||
tools/idf_size.py
|
||||
tools/kconfig_new/confgen.py
|
||||
tools/kconfig_new/confserver.py
|
||||
tools/kconfig_new/esp-windows-curses/setup.py
|
||||
tools/kconfig_new/gen_kconfig_doc.py
|
||||
tools/kconfig_new/prepare_kconfig_files.py
|
||||
tools/kconfig_new/test/confgen/test_confgen.py
|
||||
tools/kconfig_new/test/confserver/test_confserver.py
|
||||
tools/kconfig_new/test/gen_kconfig_doc/test_kconfig_out.py
|
||||
tools/kconfig_new/test/gen_kconfig_doc/test_target_visibility.py
|
||||
tools/ldgen/fragments.py
|
||||
tools/ldgen/generation.py
|
||||
tools/ldgen/ldgen.py
|
||||
tools/ldgen/ldgen_common.py
|
||||
tools/ldgen/linker_script.py
|
||||
tools/ldgen/output_commands.py
|
||||
tools/ldgen/sdkconfig.py
|
||||
tools/ldgen/test/test_entity.py
|
||||
tools/ldgen/test/test_fragments.py
|
||||
tools/ldgen/test/test_generation.py
|
||||
tools/ldgen/test/test_output_commands.py
|
||||
tools/mass_mfg/mfg_gen.py
|
||||
tools/mkuf2.py
|
||||
tools/test_apps/build_system/ldgen_test/check_placements.py
|
||||
tools/test_apps/protocols/mqtt/publish_connect_test/app_test.py
|
||||
tools/test_apps/protocols/openssl/app_test.py
|
||||
tools/test_apps/protocols/pppos/app_test.py
|
||||
tools/test_apps/system/gdb_loadable_elf/app_test.py
|
||||
tools/test_apps/system/longjmp_test/app_test.py
|
||||
tools/test_apps/system/memprot/app_test.py
|
||||
tools/test_apps/system/monitor_ide_integration/app_test.py
|
||||
tools/test_apps/system/panic/app_test.py
|
||||
tools/test_apps/system/panic/panic_tests.py
|
||||
tools/test_apps/system/panic/test_panic_util/test_panic_util.py
|
||||
tools/test_apps/system/startup/app_test.py
|
||||
tools/test_idf_monitor/idf_monitor_wrapper.py
|
||||
tools/test_idf_monitor/run_test_idf_monitor.py
|
||||
tools/test_idf_py/extra_path/some_ext.py
|
||||
tools/test_idf_py/idf_ext.py
|
||||
tools/test_idf_py/test_idf_extensions/test_ext/test_extension.py
|
||||
tools/test_idf_py/test_idf_py.py
|
||||
tools/test_idf_size/test_idf_size.py
|
||||
tools/test_idf_tools/test_idf_tools.py
|
||||
tools/test_mkdfu/test_mkdfu.py
|
||||
tools/test_mkuf2/test_mkuf2.py
|
||||
tools/unit-test-app/idf_ext.py
|
||||
tools/unit-test-app/tools/CreateSectionTable.py
|
||||
tools/unit-test-app/tools/UnitTestParser.py
|
||||
tools/unit-test-app/unit_test.py
|
||||
tools/windows/eclipse_make.py
|
@ -113,7 +113,7 @@ class MemRegions(object):
|
||||
MemRegDef(0x3ff80000, 0x2000, MemRegions.RTC_FAST_D_ID, 0x600FE000),
|
||||
MemRegDef(0x50000000, 0x2000, MemRegions.RTC_SLOW_D_ID, 0),
|
||||
])
|
||||
elif target == 'esp32c3':
|
||||
elif target in ['esp32c3']:
|
||||
return sorted([
|
||||
MemRegDef(0x3FC80000, 0x60000, MemRegions.DRAM_ID, 0x40380000),
|
||||
MemRegDef(0x4037C000, 0x4000, MemRegions.IRAM_ID, 0),
|
||||
@ -137,7 +137,6 @@ class MemRegions(object):
|
||||
|
||||
if (region.secondary_addr and region.secondary_addr <= start < region.secondary_addr + region.length):
|
||||
return (region, min(length, region.secondary_addr + region.length - start))
|
||||
|
||||
raise RuntimeError('Given section not found in any memory region. '
|
||||
'Check whether the LD file is compatible with the definitions in get_mem_regions in idf_size.py')
|
||||
|
||||
@ -223,12 +222,13 @@ class LinkingSections(object):
|
||||
|
||||
score_list = [get_name_score(section) for section in section_name_list]
|
||||
ordered_name_list = sorted(section_name_list, key=lambda x: score_list[section_name_list.index(x)], reverse=True)
|
||||
display_name_list = ordered_name_list.copy()
|
||||
display_name_list = ordered_name_list[:]
|
||||
|
||||
memory_name = ''
|
||||
for i in range(len(section_name_list)):
|
||||
section = ordered_name_list[i]
|
||||
|
||||
display_name_list = sorted(display_name_list)
|
||||
ordered_name_list = sorted(ordered_name_list)
|
||||
ordered_name_list = check_is_dict_sort(ordered_name_list)
|
||||
for i, section in enumerate(ordered_name_list):
|
||||
if memory_name and section.startswith(memory_name):
|
||||
# If the section has same memory type with the previous one, use shorter name
|
||||
display_name_list[i] = section.replace(memory_name, '& ')
|
||||
@ -239,9 +239,12 @@ class LinkingSections(object):
|
||||
if len(split_name) > 1:
|
||||
# If the section has a memory type, update the type and try to display the type properly
|
||||
assert len(split_name) == 3 and split_name[0] == '', 'Unexpected section name'
|
||||
memory_name = '.' + split_name[1]
|
||||
memory_name = '.iram' if 'iram' in split_name[1] else\
|
||||
'.dram' if 'dram' in split_name[1] else\
|
||||
'.flash' if 'flash' in split_name[1] else\
|
||||
'.' + split_name[1]
|
||||
display_name_list[i] = 'DRAM .' + split_name[2] if 'dram' in split_name[1] else\
|
||||
'IRAM .' + split_name[2] if 'iram' in split_name[1] else\
|
||||
'IRAM' + split_name[1].replace('iram', '') + ' .' + split_name[2] if 'iram' in split_name[1] else\
|
||||
'Flash .' + split_name[2] if 'flash' in split_name[1] else\
|
||||
section
|
||||
continue
|
||||
@ -605,9 +608,10 @@ class StructureForSummary(object):
|
||||
|
||||
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)
|
||||
if r.diram_total == 0:
|
||||
r.diram_total = r.dram_total + r.iram_total
|
||||
|
||||
def filter_in_section(sections, section_to_check): # type: (Iterable[MemRegions.Region], str) -> List[MemRegions.Region]
|
||||
return list(filter(lambda x: LinkingSections.in_section(x.section, section_to_check), sections)) # type: ignore
|
||||
@ -615,6 +619,8 @@ class StructureForSummary(object):
|
||||
dram_sections = list(filter(in_dram, sections))
|
||||
iram_sections = list(filter(in_iram, sections))
|
||||
diram_sections = list(filter(in_diram, sections))
|
||||
if not diram_sections:
|
||||
diram_sections = dram_sections + iram_sections
|
||||
flash_sections = filter_in_section(sections, 'flash')
|
||||
|
||||
dram_data_list = filter_in_section(dram_sections, 'data')
|
||||
@ -679,7 +685,6 @@ class StructureForSummary(object):
|
||||
|
||||
# The used DRAM BSS is counted into the "Used static DRAM" but not into the "Total image size"
|
||||
r.total_size = r.used_dram - r.used_dram_bss + r.used_iram + r.used_diram - r.used_diram_bss + r.used_flash
|
||||
|
||||
return r
|
||||
|
||||
def get_json_dic(self): # type: (StructureForSummary) -> collections.OrderedDict
|
||||
@ -867,6 +872,23 @@ def get_summary(path, segments, sections, target,
|
||||
return output
|
||||
|
||||
|
||||
def check_is_dict_sort(non_sort_list): # type: (List) -> List
|
||||
# keeping the order data, bss, other, iram, diram, ram_st_total, flash_text, flash_rodata, flash_total
|
||||
start_of_other = 0
|
||||
props_sort = [] # type: List
|
||||
props_elem = ['.data', '.bss', 'other', 'iram', 'diram', 'ram_st_total', 'flash.text', 'flash.rodata', 'flash', 'flash_total']
|
||||
for i in props_elem:
|
||||
for j in non_sort_list:
|
||||
if i == 'other':
|
||||
start_of_other = len(props_sort)
|
||||
elif i in (j[0] if len(j[0]) > 1 else j) and (j[0] if len(j[0]) > 1 else j) not in props_sort:
|
||||
props_sort.append(j)
|
||||
for j in non_sort_list:
|
||||
if j not in props_sort:
|
||||
props_sort.insert(start_of_other, j)
|
||||
return props_sort
|
||||
|
||||
|
||||
class StructureForDetailedSizes(object):
|
||||
|
||||
@staticmethod
|
||||
@ -905,8 +927,10 @@ class StructureForDetailedSizes(object):
|
||||
section_dict['ram_st_total'] = ram_st_total
|
||||
section_dict['flash_total'] = flash_total
|
||||
|
||||
# TODO: keep the order data, bss, other, iram, diram, ram_st_total, flash_text, flash_rodata, flash_total
|
||||
s.append((key, collections.OrderedDict(section_dict)))
|
||||
sorted_dict = sorted(section_dict.items(), key=lambda elem: elem[0])
|
||||
sorted_dict = check_is_dict_sort(sorted_dict)
|
||||
|
||||
s.append((key, collections.OrderedDict(sorted_dict)))
|
||||
|
||||
s = sorted(s, key=lambda elem: elem[0])
|
||||
# do a secondary sort in order to have consistent order (for diff-ing the output)
|
||||
|
17372
tools/test_idf_size/app_esp32c3.map
Normal file
17372
tools/test_idf_size/app_esp32c3.map
Normal file
File diff suppressed because one or more lines are too long
20987
tools/test_idf_size/app_esp32s3.map
Normal file
20987
tools/test_idf_size/app_esp32s3.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,32 @@
|
||||
{
|
||||
"dram_data": 9324,
|
||||
"dram_bss": 8296,
|
||||
"dram_rodata": 0,
|
||||
"dram_other": 0,
|
||||
"used_dram": 17620,
|
||||
"available_dram": 163116,
|
||||
"dram_total": 180736,
|
||||
"used_dram_ratio": 0.09749026203966006,
|
||||
"dram_remain": 163116,
|
||||
"iram_vectors": 1024,
|
||||
"iram_text": 37908,
|
||||
"iram_other": 0,
|
||||
"used_iram": 38932,
|
||||
"available_iram": 92140,
|
||||
"iram_total": 131072,
|
||||
"used_iram_ratio": 0.297027587890625,
|
||||
"used_diram": 0,
|
||||
"available_diram": 0,
|
||||
"used_diram_ratio": 0,
|
||||
"iram_remain": 92140,
|
||||
"diram_data": 9324,
|
||||
"diram_bss": 8296,
|
||||
"diram_text": 37908,
|
||||
"diram_vectors": 1024,
|
||||
"diram_rodata": 0,
|
||||
"diram_other": 0,
|
||||
"diram_total": 311808,
|
||||
"used_diram": 56552,
|
||||
"used_diram_ratio": 0.18136802134646962,
|
||||
"diram_remain": 255256,
|
||||
"flash_code": 146944,
|
||||
"flash_rodata": 39580,
|
||||
"total_size": 234780
|
||||
"flash_other": 0,
|
||||
"used_flash_non_ram": 186524,
|
||||
"total_size": 283036
|
||||
}
|
||||
|
@ -1,8 +1,16 @@
|
||||
Total sizes:
|
||||
DRAM .data size: 9324 bytes
|
||||
DRAM .bss size: 8296 bytes
|
||||
Used static DRAM: 17620 bytes ( 163116 available, 9.7% used)
|
||||
Used static IRAM: 38932 bytes ( 92140 available, 29.7% used)
|
||||
Flash code: 146944 bytes
|
||||
Flash rodata: 39580 bytes
|
||||
Total image size:~ 234780 bytes (.bin may be padded larger)
|
||||
Used static DRAM: 17620 bytes ( 163116 remain, 9.7% used)
|
||||
.data size: 9324 bytes
|
||||
.bss size: 8296 bytes
|
||||
Used static IRAM: 38932 bytes ( 92140 remain, 29.7% used)
|
||||
.text size: 37908 bytes
|
||||
.vectors size: 1024 bytes
|
||||
Used stat D/IRAM: 56552 bytes ( 255256 remain, 18.1% used)
|
||||
.data size: 9324 bytes
|
||||
.bss size: 8296 bytes
|
||||
.text size: 37908 bytes
|
||||
.vectors size: 1024 bytes
|
||||
Used Flash size : 186524 bytes
|
||||
.text : 146944 bytes
|
||||
.rodata : 39580 bytes
|
||||
Total image size: 283036 bytes (.bin may be padded larger)
|
||||
|
@ -64,6 +64,26 @@
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s2 --archive_details libdriver.a app_esp32s2.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py diff with another app (different target)..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py app.map --diff app_esp32s2.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py for esp32c3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32c3 app_esp32c3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py for esp32c3 (target autodetected)..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py app_esp32c3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --archives for esp32c3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32c3 --archives app_esp32c3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --files for esp32c3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32c3 --files app_esp32c3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --archive_details for esp32c3..." &>> output \
|
||||
&& 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 \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 app_esp32s3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py for esp32s3 (target autodetected)..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py app_esp32s3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --archives for esp32s3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 --archives app_esp32s3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --files for esp32s3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 --files app_esp32s3.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py --archive_details for esp32s3..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s3 --archive_details libdriver.a app_esp32s3.map &>> output \
|
||||
&& echo -e "\n***\nProducing JSON output..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --json app.map &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --json --archives app.map &>> output \
|
||||
|
@ -17,6 +17,7 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
from typing import Dict
|
||||
|
||||
try:
|
||||
import idf_size
|
||||
@ -41,6 +42,6 @@ if __name__ == '__main__':
|
||||
|
||||
segments = {'iram0_0_seg': {'origin': 0, 'length': 0},
|
||||
'dram0_0_seg': {'origin': 0, 'length': 0}}
|
||||
sections = {}
|
||||
sections = {} # type: Dict
|
||||
|
||||
print(idf_size.get_summary('a.map', segments, sections, 'esp32'), end='')
|
||||
|
Loading…
x
Reference in New Issue
Block a user