diff --git a/src/runtime/micro/device/arm/stm32f746xx/utvm_init.s b/src/runtime/micro/device/arm/stm32f746xx/utvm_init.s index b852dd97db2ba..5861c0326dbfa 100644 --- a/src/runtime/micro/device/arm/stm32f746xx/utvm_init.s +++ b/src/runtime/micro/device/arm/stm32f746xx/utvm_init.s @@ -16,6 +16,13 @@ * specific language governing permissions and limitations * under the License. */ + +/*! + * Copyright (c) 2019 by Contributors + * \file utvm_init.s + * \brief uTVM init definition for STM32F746XX-series boards + */ + .syntax unified .cpu cortex-m7 .fpu softvfp diff --git a/src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c b/src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c index 16ffa003b60c4..df603b828b02d 100644 --- a/src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c +++ b/src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c @@ -1,3 +1,28 @@ +/* + * 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. + */ + +/*! + * Copyright (c) 2019 by Contributors + * \file utvm_timer.c + * \brief uTVM timer API definitions for STM32F746XX-series boards + */ + #ifdef __cplusplus extern "C" { #endif diff --git a/src/runtime/micro/device/host/utvm_init.c b/src/runtime/micro/device/host/utvm_init.c new file mode 100644 index 0000000000000..02888f04c48e0 --- /dev/null +++ b/src/runtime/micro/device/host/utvm_init.c @@ -0,0 +1,39 @@ +/* + * 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. + */ + +/*! + * Copyright (c) 2019 by Contributors + * \file utvm_init.c + * \brief uTVM init definition for the host emulated device + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "utvm_runtime.h" + +void UTVMInit() { + // no init required for the host + UTVMMain(); +} + +#ifdef __cplusplus +} // TVM_EXTERN_C +#endif diff --git a/src/runtime/micro/device/host/utvm_timer.c b/src/runtime/micro/device/host/utvm_timer.c index 51e78924d5674..fffbf7dc8eb1f 100644 --- a/src/runtime/micro/device/host/utvm_timer.c +++ b/src/runtime/micro/device/host/utvm_timer.c @@ -1,3 +1,27 @@ +/* + * 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. + */ + +/*! + * Copyright (c) 2019 by Contributors + * \file utvm_timer.c + * \brief uTVM timer API stubs for the host emulated device + */ #ifdef __cplusplus extern "C" { @@ -7,10 +31,6 @@ extern "C" { // TODO(weberlo): use this? https://stackoverflow.com/questions/5141960/get-the-current-time-in-c -void UTVMInit() { - UTVMMain(); -} - int32_t UTVMTimerStart() { return 0; } diff --git a/src/runtime/micro/host_driven/utvm_runtime.c b/src/runtime/micro/host_driven/utvm_runtime.c index 99ff1ad1d90d2..09fa9cb641c1c 100644 --- a/src/runtime/micro/host_driven/utvm_runtime.c +++ b/src/runtime/micro/host_driven/utvm_runtime.c @@ -22,9 +22,9 @@ * \file utvm_runtime.cc * \brief uTVM runtime * - * All function calls go through `UTVMMain`, which reads from the current - * `UTVMTask` and calls the appropriate function with the arguments from the - * task. + * All function calls go through the externally defined `UTVMInit`, which + * performs device-specific setup, then calls `UTVMMain`. `UTVMMain` then + * calls the function in `utvm_task` with the arguments from the task. * * Additionally included in this file are definitions for some of the most * common functions used in the C runtime API.