From 7f1f425604b90879f594d261a3e240a99a639249 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Tue, 20 Jul 2021 14:32:41 -0700 Subject: [PATCH 1/2] cortex r5 added --- .../host_driven/boards/qemu_cortex_r5.conf | 29 +++++++++++++++++++ .../microtvm/zephyr/qemu-hack/qemu-system-arm | 2 +- .../qemu-hack/qemu-system-xilinx-aarch64 | 1 + python/tvm/target/target.py | 2 +- tests/micro/zephyr/conftest.py | 1 + 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf create mode 120000 apps/microtvm/zephyr/qemu-hack/qemu-system-xilinx-aarch64 diff --git a/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf b/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf new file mode 100644 index 000000000000..a86bbaeb4b93 --- /dev/null +++ b/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This file is specific to the QEMU-emulated Cortex R5 microTVM board. + +# For TVMPlatformGenerateRandom(). Remember, these values do not need to be truly random. +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_TIMER_RANDOM_GENERATOR=y + +# Default stack size is 1k, this is required for debug mode. +CONFIG_MAIN_STACK_SIZE=4000 + + +# For models with floating point. +CONFIG_FPU=y diff --git a/apps/microtvm/zephyr/qemu-hack/qemu-system-arm b/apps/microtvm/zephyr/qemu-hack/qemu-system-arm index 58fc8296c31f..ebbc8ad5ad9d 120000 --- a/apps/microtvm/zephyr/qemu-hack/qemu-system-arm +++ b/apps/microtvm/zephyr/qemu-hack/qemu-system-arm @@ -1 +1 @@ -./qemu-system-i386 \ No newline at end of file +qemu-system-i386 \ No newline at end of file diff --git a/apps/microtvm/zephyr/qemu-hack/qemu-system-xilinx-aarch64 b/apps/microtvm/zephyr/qemu-hack/qemu-system-xilinx-aarch64 new file mode 120000 index 000000000000..ebbc8ad5ad9d --- /dev/null +++ b/apps/microtvm/zephyr/qemu-hack/qemu-system-xilinx-aarch64 @@ -0,0 +1 @@ +qemu-system-i386 \ No newline at end of file diff --git a/python/tvm/target/target.py b/python/tvm/target/target.py index 0d3feaaadbc2..868227fe4679 100644 --- a/python/tvm/target/target.py +++ b/python/tvm/target/target.py @@ -278,9 +278,9 @@ def intel_graphics(model="unknown", options=None): opts = _merge_opts(opts, options) return Target(" ".join(["opencl"] + opts)) - MICRO_SUPPORTED_MODELS = { "host": [], + "zynq_mp_r5": ["-mcpu=cortex-r5"], "mps2_an521": ["-mcpu=cortex-m33"], "nrf5340dk": ["-mcpu=cortex-m33"], "stm32f746xx": ["-mcpu=cortex-m7", "-march=armv7e-m"], diff --git a/tests/micro/zephyr/conftest.py b/tests/micro/zephyr/conftest.py index b1677e6c10f2..0b50ecd12ec5 100644 --- a/tests/micro/zephyr/conftest.py +++ b/tests/micro/zephyr/conftest.py @@ -29,6 +29,7 @@ "stm32f746xx_disco": ("stm32f746xx", "stm32f746g_disco"), "stm32f746xx_nucleo": ("stm32f746xx", "nucleo_f746zg"), "stm32l4r5zi_nucleo": ("stm32l4r5zi", "nucleo_l4r5zi"), + "zynq_mp_r5": ("zynq_mp_r5", "qemu_cortex_r5"), } From 3eff0d81524595c03f8045b9413ed14a97a8f484 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Tue, 20 Jul 2021 14:45:53 -0700 Subject: [PATCH 2/2] add aot demo --- .../aot_demo/boards/qemu_cortex_r5.conf | 25 +++++++++++++++++++ .../host_driven/boards/qemu_cortex_r5.conf | 6 +---- python/tvm/target/target.py | 3 ++- tests/lint/check_file_type.py | 3 +++ 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 apps/microtvm/zephyr/aot_demo/boards/qemu_cortex_r5.conf diff --git a/apps/microtvm/zephyr/aot_demo/boards/qemu_cortex_r5.conf b/apps/microtvm/zephyr/aot_demo/boards/qemu_cortex_r5.conf new file mode 100644 index 000000000000..267589ba8f0c --- /dev/null +++ b/apps/microtvm/zephyr/aot_demo/boards/qemu_cortex_r5.conf @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This file is specific to the QEMU-emulated Cortex R5 microTVM board. + +# For TVMPlatformGenerateRandom(). Remember, these values do not need to be truly random. +CONFIG_TEST_RANDOM_GENERATOR=y +CONFIG_TIMER_RANDOM_GENERATOR=y + +# Default stack size is 1k, this is required for debug mode. +CONFIG_MAIN_STACK_SIZE=2000 diff --git a/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf b/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf index a86bbaeb4b93..4097f7ec5487 100644 --- a/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf +++ b/apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf @@ -22,8 +22,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y # Default stack size is 1k, this is required for debug mode. -CONFIG_MAIN_STACK_SIZE=4000 - - -# For models with floating point. -CONFIG_FPU=y +CONFIG_MAIN_STACK_SIZE=1536 diff --git a/python/tvm/target/target.py b/python/tvm/target/target.py index 868227fe4679..106432cd44f7 100644 --- a/python/tvm/target/target.py +++ b/python/tvm/target/target.py @@ -278,13 +278,14 @@ def intel_graphics(model="unknown", options=None): opts = _merge_opts(opts, options) return Target(" ".join(["opencl"] + opts)) + MICRO_SUPPORTED_MODELS = { "host": [], - "zynq_mp_r5": ["-mcpu=cortex-r5"], "mps2_an521": ["-mcpu=cortex-m33"], "nrf5340dk": ["-mcpu=cortex-m33"], "stm32f746xx": ["-mcpu=cortex-m7", "-march=armv7e-m"], "stm32l4r5zi": ["-mcpu=cortex-m4"], + "zynq_mp_r5": ["-mcpu=cortex-r5"], } diff --git a/tests/lint/check_file_type.py b/tests/lint/check_file_type.py index 7250a3ccd7d0..f31630c2a705 100644 --- a/tests/lint/check_file_type.py +++ b/tests/lint/check_file_type.py @@ -136,6 +136,7 @@ "apps/microtvm/zephyr/qemu-hack/qemu-system-arm", "apps/microtvm/zephyr/qemu-hack/qemu-system-riscv32", "apps/microtvm/zephyr/qemu-hack/qemu-system-riscv64", + "apps/microtvm/zephyr/qemu-hack/qemu-system-xilinx-aarch64", "apps/microtvm/zephyr/host_driven/prj.conf", "apps/microtvm/zephyr/host_driven/boards/qemu_x86.conf", "apps/microtvm/zephyr/host_driven/boards/qemu_riscv32.conf", @@ -145,6 +146,7 @@ "apps/microtvm/zephyr/host_driven/boards/stm32f746g_disco.conf", "apps/microtvm/zephyr/host_driven/boards/mps2_an521.conf", "apps/microtvm/zephyr/host_driven/boards/nucleo_l4r5zi.conf", + "apps/microtvm/zephyr/host_driven/boards/qemu_cortex_r5.conf", "apps/microtvm/zephyr/host_driven/qemu-hack", "apps/microtvm/zephyr/aot_demo/prj.conf", "apps/microtvm/zephyr/aot_demo/boards/qemu_x86.conf", @@ -155,6 +157,7 @@ "apps/microtvm/zephyr/aot_demo/boards/stm32f746g_disco.conf", "apps/microtvm/zephyr/aot_demo/boards/mps2_an521.conf", "apps/microtvm/zephyr/aot_demo/boards/nucleo_l4r5zi.conf", + "apps/microtvm/zephyr/aot_demo/boards/qemu_cortex_r5.conf", "apps/microtvm/zephyr/aot_demo/qemu-hack", # microTVM Virtual Machines "apps/microtvm/reference-vm/zephyr/Vagrantfile",