forked from apache/tvm
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial * remove compare * temp fix * debugging * hack * hack for testing * both test pass * cleanup * fix tests and tutorials * restructure * cleanup * cleanup * fix check files * fixed for physical devices * address comments * reduce nrf stack size * update sample url * format
- Loading branch information
Showing
34 changed files
with
869 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!--- 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 directory contains a Zephyr-based ahead of time (AOT) "demo" runtime environment that | ||
pulls together the microTVM runtime dependencies into a single application | ||
that can run TVM on a microTVM device without the need to a host. |
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
apps/microtvm/zephyr/aot_demo/boards/nrf5340dk_nrf5340_cpuapp.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 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 nRF5340 DK board. | ||
|
||
# For intrinsics used by generated optimized operators. | ||
CONFIG_CMSIS_DSP=y | ||
|
||
# For AOT runtime which requires lots of function call. | ||
CONFIG_MAIN_STACK_SIZE=2000 | ||
|
||
# For random number generation. | ||
CONFIG_ENTROPY_GENERATOR=y | ||
CONFIG_TEST_RANDOM_GENERATOR=y | ||
|
||
# For debugging. | ||
CONFIG_LED=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/*! | ||
* \file tvm/runtime/crt_config.h.template | ||
* \brief Template for CRT configuration, to be modified on each target. | ||
*/ | ||
#ifndef TVM_RUNTIME_CRT_CONFIG_H_ | ||
#define TVM_RUNTIME_CRT_CONFIG_H_ | ||
|
||
#include <tvm/runtime/crt/logging.h> | ||
|
||
/*! Log level of the CRT runtime */ | ||
#define TVM_CRT_LOG_LEVEL TVM_CRT_LOG_LEVEL_DEBUG | ||
|
||
/*! Maximum supported dimension in NDArray */ | ||
#define TVM_CRT_MAX_NDIM 6 | ||
|
||
/*! Maximum supported arguments in generated functions */ | ||
#define TVM_CRT_MAX_ARGS 10 | ||
|
||
/*! Size of the global function registry, in bytes. */ | ||
#define TVM_CRT_GLOBAL_FUNC_REGISTRY_SIZE_BYTES 200 | ||
|
||
/*! Maximum number of registered modules. */ | ||
#define TVM_CRT_MAX_REGISTERED_MODULES 2 | ||
|
||
/*! Maximum packet size, in bytes, including the length header. */ | ||
#define TVM_CRT_MAX_PACKET_SIZE_BYTES (1 * 1024) | ||
|
||
/*! Maximum supported string length in dltype, e.g. "int8", "int16", "float32" */ | ||
#define TVM_CRT_MAX_STRLEN_DLTYPE 10 | ||
|
||
/*! Maximum supported string length in function names */ | ||
#define TVM_CRT_MAX_STRLEN_FUNCTION_NAME 80 | ||
|
||
/*! \brief Maximum length of a PackedFunc function name. */ | ||
#define TVM_CRT_MAX_FUNCTION_NAME_LENGTH_BYTES 30 | ||
|
||
/*! \brief Log2 of the page size (bytes) for a virtual memory page. */ | ||
#define TVM_CRT_PAGE_BITS 10 // 1 kB | ||
|
||
/*! \brief Number of pages on device. */ | ||
#define TVM_CRT_MAX_PAGES 300 | ||
|
||
#endif // TVM_RUNTIME_CRT_CONFIG_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#ifndef TVM_APPS_MICROTVM_ZEPHYR_AOT_DEMO_INCLUDE_ZEPHYR_UART_H_ | ||
#define TVM_APPS_MICROTVM_ZEPHYR_AOT_DEMO_INCLUDE_ZEPHYR_UART_H_ | ||
|
||
#include <stdint.h> | ||
|
||
// Used to read data from the UART. | ||
|
||
/*! | ||
* \brief Read Uart Rx buffer. | ||
* \param data Pointer to read data. | ||
* \param data_size_bytes Read request size in bytes. | ||
* | ||
* \return Number of data read in bytes. | ||
*/ | ||
uint32_t TVMPlatformUartRxRead(uint8_t* data, uint32_t data_size_bytes); | ||
|
||
/*! | ||
* \brief Write data in serial. | ||
* \param data Pointer to data to write. | ||
* \param size Size of data in bytes. | ||
* | ||
* \return Number of write in bytes. | ||
*/ | ||
uint32_t TVMPlatformWriteSerial(const char* data, uint32_t size); | ||
|
||
/*! | ||
* \brief Initialize Uart. | ||
*/ | ||
void TVMPlatformUARTInit(); | ||
|
||
#endif /* TVM_APPS_MICROTVM_ZEPHYR_AOT_DEMO_INCLUDE_ZEPHYR_UART_H_ */ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../qemu-hack |
Oops, something went wrong.