Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tensorflow/lite/micro/tools/make/ext_libs/xtensa.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ ifeq ($(TARGET_ARCH), hifimini)
THIRD_PARTY_CC_HDRS += \
$(shell find $(FFT_PATH)/hifi2_fft -name "*.h")

else ifeq ($(TARGET_ARCH), hifi_iq)
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ext_libs/xtensa_download.sh ${DOWNLOADS_DIR} hifi_iq $(TENSORFLOW_ROOT))
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
$(error Something went wrong with the xtensa download: $(DOWNLOAD_RESULT))
endif

PLATFORM_FLAGS = \
-Wno-shadow\

CCFLAGS += $(PLATFORM_FLAGS)
CXXFLAGS += $(PLATFORM_FLAGS)

NNLIB_PATH := $(MAKEFILE_DIR)/downloads/xa_nnlib_hifi_iq

THIRD_PARTY_KERNEL_CC_SRCS += \
$(shell find $(NNLIB_PATH) -name "*.c")

EXCLUDED_NNLIB_SRCS = \
$(NNLIB_PATH)/algo/layers/cnn/src/xa_nn_cnn_api.c \
$(NNLIB_PATH)/algo/layers/gru/src/xa_nn_gru_api.c \
$(NNLIB_PATH)/algo/layers/lstm/src/xa_nn_lstm_api.c \

THIRD_PARTY_KERNEL_CC_SRCS := $(filter-out $(EXCLUDED_NNLIB_SRCS), $(THIRD_PARTY_KERNEL_CC_SRCS))

THIRD_PARTY_CC_HDRS += \
$(shell find $(NNLIB_PATH) -name "*.h") \

INCLUDES += \
-I$(NNLIB_PATH)/ \
-I$(NNLIB_PATH)/algo/kernels/ \
-I$(NNLIB_PATH)/include/nnlib/ \
-I$(NNLIB_PATH)/include/ \
-I$(NNLIB_PATH)/algo/common/include/ \

else ifeq ($(TARGET_ARCH), hifi5)
DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ext_libs/xtensa_download.sh ${DOWNLOADS_DIR} hifi5 $(TENSORFLOW_ROOT))
ifneq ($(DOWNLOAD_RESULT), SUCCESS)
Expand Down
16 changes: 10 additions & 6 deletions tensorflow/lite/micro/tools/make/ext_libs/xtensa_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ DOWNLOADS_DIR=${1}
PATCH=""

if [[ ${2} == "hifi3" ]]; then
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_30_2025.zip"
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_03_2026.zip"
LIBRARY_DIRNAME="xa_nnlib_hifi4"
LIBRARY_MD5="a1cba57501a35d0bffdd39c536689366"
LIBRARY_MD5="69537cd86952b02aa6ed566d4a6f0c08"
elif [[ ${2} == "hifi4" ]]; then
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_30_2025.zip"
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi4/raw/master/archive/xa_nnlib_hifi4_09_03_2026.zip"
LIBRARY_DIRNAME="xa_nnlib_hifi4"
LIBRARY_MD5="a1cba57501a35d0bffdd39c536689366"
LIBRARY_MD5="69537cd86952b02aa6ed566d4a6f0c08"
elif [[ ${2} == "hifi5" ]]; then
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi5/raw/master/archive/xa_nnlib_hifi5_09_30_2025.zip"
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi5/raw/master/archive/xa_nnlib_hifi5_09_03_2026.zip"
LIBRARY_DIRNAME="xa_nnlib_hifi5"
LIBRARY_MD5="f3ac445ae47143b1fddf26b85d763697"
LIBRARY_MD5="2fbe7a4459609f257b43fb1d2cdc2339"
elif [[ ${2} == "hifi_iq" ]]; then
LIBRARY_URL="http://github.com/foss-xtensa/nnlib-hifi_iq/raw/main/archive/xa_nnlib_hifi_iq_09_03_2026.zip"
LIBRARY_DIRNAME="xa_nnlib_hifi_iq"
LIBRARY_MD5="050f2e27b5b68068a3b4d00a1b449013"
elif [[ ${2} == "vision_p6" ]]; then
LIBRARY_URL="https://github.com/foss-xtensa/tflmlib_vision/raw/main/archive/xi_tflmlib_vision_p6_22_06_29.zip"
LIBRARY_DIRNAME="xi_tflmlib_vision_p6"
Expand Down
Loading