idf_performance_target.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * SPDX-FileCopyrightText: 2020-2021 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 240MHz, 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 1000
  12. #define IDF_PERFORMANCE_MAX_TIME_SHA512_32KB 900
  13. #define IDF_PERFORMANCE_MAX_RSA_2048KEY_PUBLIC_OP 18000
  14. #define IDF_PERFORMANCE_MAX_RSA_2048KEY_PRIVATE_OP 210000
  15. #define IDF_PERFORMANCE_MAX_RSA_3072KEY_PUBLIC_OP 45000
  16. #define IDF_PERFORMANCE_MAX_RSA_3072KEY_PRIVATE_OP 670000
  17. #define IDF_PERFORMANCE_MAX_RSA_4096KEY_PUBLIC_OP 80000
  18. #define IDF_PERFORMANCE_MAX_RSA_4096KEY_PRIVATE_OP 1500000
  19. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING 32
  20. #define IDF_PERFORMANCE_MAX_SPI_PER_TRANS_NO_POLLING_NO_DMA 30
  21. /*
  22. * Flash Performance value
  23. * 4 subsections: legacy, normal (new driver after v4.0), SPI1 (external but on SPI1), external (SPI2)
  24. * These thresholds are set to about 70% of the average test data, under certain condition.
  25. * Contact Espressif for details.
  26. *
  27. * Currently all performance data on S3 are set to 0 for now. Update to a proper value later.
  28. */
  29. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_4B
  30. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_4B 0
  31. #endif
  32. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_4B
  33. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_4B 0
  34. #endif
  35. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_2KB
  36. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_WR_2KB 0
  37. #endif
  38. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_2KB
  39. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_RD_2KB 0
  40. #endif
  41. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_ERASE
  42. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  43. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_LEGACY_ERASE 0
  44. #endif
  45. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_4B
  46. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_WR_4B 0
  47. #endif
  48. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_4B
  49. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_RD_4B 0
  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 0
  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 0
  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 0
  60. #endif
  61. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_4B
  62. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_4B 0
  63. #endif
  64. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_4B
  65. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_4B 0
  66. #endif
  67. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_2KB
  68. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_WR_2KB 0
  69. #endif
  70. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_2KB
  71. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_RD_2KB 0
  72. #endif
  73. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_ERASE
  74. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  75. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_SPI1_ERASE 0
  76. #endif
  77. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B
  78. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_4B 0
  79. #endif
  80. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B
  81. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_4B 0
  82. #endif
  83. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_2KB
  84. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_WR_2KB 0
  85. #endif
  86. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_2KB
  87. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_RD_2KB 0
  88. #endif
  89. #ifndef IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_ERASE
  90. //erase performance is highly depending on the chip vendor. Use 70% of the minimal value.
  91. #define IDF_PERFORMANCE_MIN_FLASH_SPEED_BYTE_PER_SEC_EXT_ERASE 0
  92. #endif
  93. // floating point instructions per divide and per sqrt (configured for worst-case with PSRAM workaround)
  94. #define IDF_PERFORMANCE_MAX_CYCLES_PER_DIV 70
  95. #define IDF_PERFORMANCE_MAX_CYCLES_PER_SQRT 140