idf_performance_target.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #define IDF_PERFORMANCE_MIN_AES_CBC_THROUGHPUT_MBSEC 43
  8. // SHA256 hardware throughput at 160 MHz, threshold set lower than worst case
  9. #define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 90
  10. // esp_sha() time to process 32KB of input data from RAM
  11. #define IDF_PERFORMANCE_MAX_TIME_SHA1_32KB 560
  12. #define IDF_PERFORMANCE_MAX_RSA_2048KEY_PUBLIC_OP 19000
  13. #define IDF_PERFORMANCE_MAX_RSA_2048KEY_PRIVATE_OP 210000
  14. #define IDF_PERFORMANCE_MAX_RSA_3072KEY_PUBLIC_OP 45000
  15. #define IDF_PERFORMANCE_MAX_RSA_3072KEY_PRIVATE_OP 670000
  16. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING 15
  17. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_POLLING_NO_DMA 15
  18. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING 32
  19. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING_NO_DMA 30
  20. /*
  21. * Flash Performance value
  22. * 4 subsections: legacy, normal (new driver after v4.0), SPI1 (external but on SPI1), external (SPI2)
  23. * These thresholds are set to about 70% of the average test data, under certain condition.
  24. * Contact Espressif for details.
  25. */
  26. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_4B
  27. // rom options is much slower. use its 70%
  28. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_4B 42200
  29. #endif
  30. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_4B
  31. // legacy & suspend config are much faster. use the 70% of slower configs
  32. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_4B (179*1000)
  33. #endif
  34. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_2KB
  35. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_2KB (622*1000)
  36. #endif
  37. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_2KB
  38. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_2KB (6536*1000)
  39. #endif
  40. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_ERASE
  41. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  42. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_ERASE 23700
  43. #endif
  44. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_4B
  45. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_4B 46400
  46. #endif
  47. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_4B
  48. // legacy & suspend config are much faster. use the 70% of slower configs
  49. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_4B (183*1000)
  50. #endif
  51. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_2KB
  52. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_2KB (605*1000)
  53. #endif
  54. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_2KB
  55. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_2KB (6676*1000)
  56. #endif
  57. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_ERASE
  58. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  59. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_ERASE 22900
  60. #endif
  61. // No SPI1 tests for C3
  62. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_4B
  63. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_4B 0
  64. #endif
  65. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_4B
  66. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_4B 0
  67. #endif
  68. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_2KB
  69. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_2KB 0
  70. #endif
  71. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_2KB
  72. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_2KB 0
  73. #endif
  74. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_ERASE
  75. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  76. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_ERASE 0
  77. #endif
  78. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B
  79. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B 43300
  80. #endif
  81. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B
  82. // rom options is much slower. use its 70%
  83. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B 99500
  84. #endif
  85. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_2KB
  86. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_2KB (300*1000)
  87. #endif
  88. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_2KB
  89. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_2KB (754*1000)
  90. #endif
  91. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_ERASE
  92. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  93. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_ERASE 33900
  94. #endif
  95. // floating point instructions per divide and per sqrt (configured for worst-case with PSRAM workaround)
  96. #define IDF_PERFORMANCE_MAX_CYCLES_PER_DIV 70
  97. #define IDF_PERFORMANCE_MAX_CYCLES_PER_SQRT 140