-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[CMSIS-NN] Support CMSIS NN from new GitHub location #13656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,9 @@ cmake -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-non | |
| make | ||
|
|
||
| # Build NN Library | ||
| mkdir ${CMSIS_PATH}/CMSIS-NN/build/ && cd ${CMSIS_PATH}/CMSIS-NN/build/ | ||
| cmake .. -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-none-eabi-gcc.cmake -DTARGET_CPU=cortex-m55 -DBUILD_CMSIS_NN_FUNCTIONS=YES -DCMSIS_PATH=${CMSIS_PATH} | ||
|
|
||
| mkdir ${CMSIS_PATH}/CMSIS/NN/build/ && cd ${CMSIS_PATH}/CMSIS/NN/build/ | ||
| cmake .. -DCMAKE_TOOLCHAIN_FILE=${ethosu_dir}/core_platform/cmake/toolchain/arm-none-eabi-gcc.cmake -DTARGET_CPU=cortex-m55 -DBUILD_CMSIS_NN_FUNCTIONS=YES | ||
| make | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both of the above commands look similar, I hope they are serving two different things. Can you please revisit them?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first one builds the new |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -605,6 +605,7 @@ def test_schedule_build_with_cmsis_dependency(workspace_dir, board, microtvm_deb | |
| "project_type": "host_driven", | ||
| "verbose": bool(build_config.get("debug")), | ||
| "board": board, | ||
| "cmsis_path": os.getenv("CMSIS_PATH"), | ||
| "use_fvp": bool(use_fvp), | ||
| } | ||
|
|
||
|
|
@@ -623,7 +624,7 @@ def test_schedule_build_with_cmsis_dependency(workspace_dir, board, microtvm_deb | |
| assert "CMSIS/DSP/Include" in cmake_content | ||
| assert "CMSIS/DSP/Include/dsp" in cmake_content | ||
| assert "CMSIS/DSP/Include" in cmake_content | ||
| assert "CMSIS/NN/Include" in cmake_content | ||
| # assert "CMSIS-NN/Include" in cmake_content | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If comment is not useful for future, it can be removed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the future, after the docker image will be updated, we want this assert. |
||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,11 @@ CC = arm-none-eabi-gcc | |
| AR = arm-none-eabi-ar | ||
| RANLIB = arm-none-eabi-ranlib | ||
| CC_OPTS = CC=$(CC) AR=$(AR) RANLIB=$(RANLIB) | ||
| ifeq ($(shell [ -d ${CMSIS_PATH}/CMSIS-NN ]; echo $$?), 0) | ||
| CMSIS_NN_PATH = ${CMSIS_PATH}/CMSIS-NN | ||
| else | ||
| CMSIS_NN_PATH = ${CMSIS_PATH}/CMSIS/NN | ||
| endif | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't simply looking for the directory work
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want I can check and improve that, but this code will be reverted when the docker image will be updated. |
||
| PKG_CFLAGS = ${PKG_COMPILE_OPTS} \ | ||
| ${CFLAGS} \ | ||
| -I$(build_dir)/../include \ | ||
|
|
@@ -57,7 +62,7 @@ PKG_CFLAGS = ${PKG_COMPILE_OPTS} \ | |
| -I${DRIVER_PATH}/include \ | ||
| -I${CMSIS_PATH}/Device/ARM/${ARM_CPU}/Include/ \ | ||
| -I${CMSIS_PATH}/CMSIS/Core/Include \ | ||
| -I${CMSIS_PATH}/CMSIS/NN/Include \ | ||
| -I${CMSIS_NN_PATH}/Include \ | ||
| -I${CMSIS_PATH}/CMSIS/DSP/Include \ | ||
| -isystem$(STANDALONE_CRT_DIR)/include | ||
| DRIVER_CMAKE_FLAGS = -DCMAKE_TOOLCHAIN_FILE=$(ETHOSU_TEST_ROOT)/arm-none-eabi-gcc.cmake \ | ||
|
|
@@ -78,7 +83,7 @@ CC_CODEGEN_SRCS = $(shell find $(abspath $(CODEGEN_ROOT)/host/src/*.cc)) | |
| C_CODEGEN_OBJS = $(subst .c,.o,$(C_CODEGEN_SRCS)) | ||
| CC_CODEGEN_OBJS = $(subst .cc,.o,$(CC_CODEGEN_SRCS)) | ||
| CMSIS_STARTUP_SRCS = $(shell find ${CMSIS_PATH}/Device/ARM/${ARM_CPU}/Source/*.c) | ||
| CMSIS_NN_SRCS = $(shell find ${CMSIS_PATH}/CMSIS/NN/Source/*/*.c) | ||
| CMSIS_NN_SRCS = $(shell find ${CMSIS_NN_PATH}/Source/*/*.c) | ||
| UART_SRCS = $(shell find ${PLATFORM_PATH}/*.c) | ||
|
|
||
| ifdef ETHOSU_TEST_ROOT | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a temporary fix until we update the docker image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is.