Skip to content
  1. May 22, 2025
  2. Apr 30, 2025
    • Jonny Svärd's avatar
      Rework cache management · 5fbe2998
      Jonny Svärd authored
      
      
      Simplify the cache management by removing most of the logic from the
      driver itself to user overridable weak functions for cache flush/clean
      and invalidation.
      
      The driver now calls the cache flush/clean before each NPU command
      stream with a full list of base pointers/base addresses and their size.
      This allows full freedom to implement any desired logic for cache
      coherence management outside of the driver. This changes the function
      prototype for the flush and invalidate functions.
      
      As there's no longer a need to keep a bitmask of which base
      pointers/addresses to flush/clean/invalidate, those functions have been
      removed.
      
      To guarantee that the driver works in all cases and doesn't get affected
      by potential speculative loads, the cache invalidation call has been
      moved to after the NPU has finished.
      
      Due to the backwards incompatible changes to the function prototypes,
      the driver version has been bumped to 1.0.0
      
      Change-Id: Ibfd755876842edc911fecebf34fa80c22f287ca4
      Signed-off-by: Jonny Svärd's avatarJonny Svärd <jonny.svaerd@arm.com>
      25.05-rc1
      5fbe2998
    • Jonny Svärd's avatar
      Default to use CMSIS v6 from core_software · 59803b69
      Jonny Svärd authored
      
      
      Change-Id: Id66a7e401a134bad6b6b696dbee22546e298b190
      Signed-off-by: Jonny Svärd's avatarJonny Svärd <jonny.svaerd@arm.com>
      59803b69
  3. Mar 24, 2025
    • Jonny Svärd's avatar
      Misc updates to ethosu_log.h · a85ddcce
      Jonny Svärd authored
      
      
      Replace empty log macros with calls to a new LOG_COMMON_NOP macro, with
      the intention of avoiding unused variable/parameter warnings where the
      variables/parameters are currently only used for logging. The if check
      will normally be optimized away.
      
      Change formatting of error messages, prepend the file name and line
      instead of appending it, to allow for newlines in error messages.
      
      Add a check for __FILE_NAME__ macro and use that instead of strrchr
      function, when available.
      
      Fix broken LOG macro
      
      Correct copyright years
      
      Change-Id: Ic443a6ba6d4f723c9272e605a2d975413ffe9a66
      Signed-off-by: Jonny Svärd's avatarJonny Svärd <jonny.svaerd@arm.com>
      a85ddcce
  4. Mar 13, 2025
  5. Jan 07, 2025
  6. Dec 16, 2024
  7. Oct 29, 2024
    • Jonny Svärd's avatar
      Cache optimizations · e79714ad
      Jonny Svärd authored
      
      
      Add comments about ethosu_flush_dcache() being deprecated and not
      recommended to be implemented. Cache coherency for regions that are
      shared by the CPU and NPU are to be handled by the application before an
      inference is invoked, as the driver will otherwise do it for every
      invokation hurting performance.
      
      Remove cache flush/clean and invalidation calls for all base pointers
      and instead add a cache flush/clean and invalidation base pointer mask.
      This mask defaults to only mark the scratch base pointer (tensor arena)
      for both flush/clean and invalidation. The scratch base pointer is the
      only one containg RW data shared between the CPU and NPU.
      
      For the typical case, cache invalidation is only required to be done on
      the scratch/tensor arena base pointer, as that contains the OFM data.
      All other base pointers are either read only or in the case of dedicated
      sram mode being used, the fast memory is only meant to be used by the
      NPU and thus no cache coherency issues exist.
      
      Add a helper function to allow the cache masks to be modified for
      advanced use cases. The cache mask for flush and invalidate are both 8
      bit masks where bit 0 corresponds to base pointer 0, bit 1 corresponds
      to base pointer 1 etc.
      
      Update previously incorrect documentation that the addresses shipped to
      cache functions needs to be 16 byte aligned, they need to be 32 byte
      aligned (or the cache line size of the CPU).
      
      Invalidation of the complete cache is no longer supported as this is
      potentially dangerous, especially in async use cases where the CPU might
      be doing other things while the NPU is running. base_addr_size is now
      required to be set for all invoke calls, or an assert will trigger.
      
      Change-Id: Ica665ebfb84329ec5e56c224859516036fc08d2c
      Signed-off-by: Jonny Svärd's avatarJonny Svärd <jonny.svaerd@arm.com>
      3 tags
      e79714ad
  8. Oct 24, 2024
  9. Oct 04, 2024
  10. Oct 03, 2024
  11. Aug 22, 2024
  12. Aug 13, 2024
  13. Jun 13, 2024
  14. Jun 03, 2024
  15. May 21, 2024
  16. May 07, 2024
  17. Apr 26, 2024
  18. Apr 23, 2024
  19. Apr 22, 2024
  20. Apr 19, 2024
  21. Dec 19, 2023
    • Jonny Svärd's avatar
      Support timeout for interrupt semaphore · a2732ecd
      Jonny Svärd authored
      
      
      Introduce ETHOSU_INFERENCE_TIMEOUT CMake variable to set an
      arbitrary timeout value that will be sent as argument to
      ethosu_semaphore_take() for the interrupt semaphore. Adding
      the ability to have a timeout for an inference. (Defaults to
      no timeout/wait forever.)
      
      Implement a placeholder mutex for the baremetal example and add
      error checks for mutex_create() call.
      
      Change-Id: Ia74391620340a27c23dc3d15f9ba742c674c8bfa
      Signed-off-by: Jonny Svärd's avatarJonny Svärd <jonny.svaerd@arm.com>
      2 tags
      a2732ecd
  22. Oct 11, 2023
  23. Apr 04, 2023
  24. Feb 16, 2023
  25. Jan 20, 2023
    • Jonny Svärd's avatar
      Rework mutex/semaphore code · c964424d
      Jonny Svärd authored
      Improve the mutex protection around shared data
      
      Rework so that registering a driver gives a semaphore to the
      driver semaphore count, deregistering it takes it (removes one
      from the count) of available driver handles.
      
      Change-Id: I9b74ed87b9371490d0ffcc8516f65bcab56d05bb
      23.02-rc1
      c964424d
  26. Nov 14, 2022
    • Kristofer Jonsson's avatar
      Update header file documentation · 68b5c91c
      Kristofer Jonsson authored
      Update documentation in driver header file.
      
      Some functions were inconsistently returning boolean status. These
      functions have been updated to return integer status, with 0 on
      success and negative error code on failure.
      
      Change-Id: Ie044bf5b4f2daaff348e698fa6147472dbc582a9
      2 tags
      68b5c91c
    • Kristofer Jonsson's avatar
      Remapping command stream and base pointers · 9670332f
      Kristofer Jonsson authored
      Add new weak function ethosu_address_remap() that allows the addresses
      for QBASE and BASEP to be remapped.
      
      Change-Id: I36b0d71c57bfd293672b10c7b85f3b2415e9c839
      9670332f
  27. Nov 04, 2022
  28. Oct 03, 2022
  29. May 25, 2022
  30. May 13, 2022
    • Kristofer Jonsson's avatar
      Set default configuration · 1c0e7ae4
      Kristofer Jonsson authored
      Base address 1 points at the TFLM arena and is by default routed
      over AXI 0. For the spilling use case with both model and arena in
      DRAM it would make more sense to route base addresses 0 and 1
      over AXI 1.
      
      For Ethos-U65 the default settings should correspond to the spilling
      use case.
      
      The AXI limits should have different max values depending on the NPU
      architecture.
      
      Change-Id: Icd317097e2cfdbfb39886e13c2cb2202651e5357
      2 tags
      1c0e7ae4
  31. May 05, 2022
    • Jonny Svärd's avatar
      Refactor power handling · 301399d9
      Jonny Svärd authored and Kristofer Jonsson's avatar Kristofer Jonsson committed
      Add reference counted ethosu_request_power(),
      ethosu_release_power() functions. While there are
      active requests, disable the Q-channel power gating
      of the Ethos-U device, leaving the device powered on.
      Note that clock gating is implemented to follow the
      state of the power gating.
      
      Add ethosu_soft_reset() function. Restore power-
      and clock gating state after reset.
      
      Refactor and simplify driver code to use the new
      functions.
      
      Change-Id: I9756572c5c3e51b2be244bcea856d88e890e2d40
      22.05-rc1
      301399d9
  32. Apr 20, 2022
  33. Apr 12, 2022
    • Davide Grohmann's avatar
      Update the documentation · 2f9c333a
      Davide Grohmann authored
      - Improve build section by describing new build options
      - Add a section about driver APIs and basic usage examples
      - Add a section about mutexes and semaphores
      - Add a section about begin/end inference callbacks
      - Add a brief section about driver implementation design
      - Fix markdown title/subtitles structure
      - Small fixing of typos and rewording
      
      Also add .gitignore
      
      Change-Id: I7216a2b72b0dfaa605620f4344da205235339ddb
      2f9c333a
  34. Mar 31, 2022
    • Jonny Svärd's avatar
      Add driver async API · 1a3bb928
      Jonny Svärd authored
      Add an asynchronous API to the driver. The current synchronous API
      is now using the new async API internally. The main new functions
      are ethosu_invoke_async() and ethosu_wait(). Every successfull call
      to ethosu_invoke_async() must be followed by a call to ethosu_wait()
      to get the status of the inference. The wait function can be called
      in a blocking or non-blocking mode by specifying the `block`
      argument to true/false. The regular synchronous invoke function is
      implemented as a invoke_async followed by a wait(block=true) call.
      
      Short sommary of changes:
       - Add an internal ethosu_job struct to keep track of
         inference data and job state.
       - Use async API in blocking mode for normal flow
       - Change default semaphore implementation to binary type
       - Move error prints out of interrupt context
       - Move ethosu_inference_begin() callback to right before HW invoke
       - Always call ethosu_inference_end() callback, even in case of errors
       - On NPU error, do not keep NPU powered after being reset
      
      Change-Id: If4c3c46e3c6732a669e17251bd848dea5765a490
      1a3bb928
  35. Feb 08, 2022
  36. Jan 28, 2022
Loading