areusch commented on a change in pull request #8190:
URL: https://github.com/apache/tvm/pull/8190#discussion_r650110739
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/test-config.json
##########
@@ -1,12 +1,14 @@
{
"stm32f746xx": {
"vid_hex": "0483",
- "pid_hex": "374b",
- "test_cmd": ["pytest", "tests/micro/zephyr/test_zephyr.py",
"--microtvm-platforms=stm32f746xx"]
+ "pid_hex": "374b"
},
"nrf5340dk": {
"vid_hex": "1366",
- "pid_hex": "1055",
- "test_cmd": ["pytest", "tests/micro/zephyr/test_zephyr.py",
"--microtvm-platforms=nrf5340dk"]
+ "pid_hex": "1055"
+ },
+ "mps2_an521": {
+ "vid_hex": "",
Review comment:
it is a little confusing that "" means "don't attach anything" but i
think that's ok.
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/base_box_provision.sh
##########
@@ -0,0 +1,32 @@
+#!/bin/bash -e
+# 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.
+
+set -e
+set -x
+
+source ~/.profile
+
+# Init Zephyr
+cd ~
+~/ubuntu_init_zephyr_project.sh ~/zephyr v2.5-branch --commit
dabf23758417fd041fec2a2a821d8f526afac29d
Review comment:
maybe comment if there is anything special about this commit
##########
File path: apps/microtvm/reference-vm/base-box-tool.py
##########
@@ -173,12 +175,19 @@ def attach_vmware(uuid, vid_hex=None, pid_hex=None,
serial=None):
"vmware_desktop": attach_vmware,
}
+EXTRA_SCRIPTS = (
Review comment:
comment why these are separate from the base_box_setup.sh
##########
File path: python/tvm/micro/contrib/zephyr.py
##########
@@ -30,6 +30,8 @@
import shutil
import subprocess
import sys
+import threading
Review comment:
revert this file
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/base_box_test.sh
##########
@@ -0,0 +1,38 @@
+#!/bin/bash -e
+# 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.
+#
+# Usage: base_box_test.sh <TARGET>
+# Execute microTVM Zephyr tests.
+#
+
+set -e
+set -x
+
+if [ "$#" -lt 1 ]; then
+ echo "Usage: base_box_test.sh <TARGET>"
+ exit -1
+fi
+
+target=$1
+
+pytest tests/micro/zephyr/test_zephyr.py --microtvm-platforms=${target}
+
+if [ $target == "nrf5340dk" ] || [ $target == "mps2_an521" ]; then
Review comment:
i think this can be [ $target == "nrf5340dk" || $target == "mps2_an521"
], but would feel better about this being in python. or maybe like:
```
if [ $target == "stm32f746xx" ]; then
echo "NOTE: skipped test_zephyr_aot.py on $target -- known failure"
else
pytest ...
fi
```
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/base_box_provision.sh
##########
@@ -0,0 +1,32 @@
+#!/bin/bash -e
+# 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.
+
+set -e
+set -x
+
+source ~/.profile
+
Review comment:
comment the point of this file (reuse scripts in docker/install) so
people know why to put commands here vs base_box_setup.sh
##########
File path: apps/microtvm/reference-vm/zephyr/base-box/base_box_test.sh
##########
@@ -0,0 +1,38 @@
+#!/bin/bash -e
+# 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.
+#
+# Usage: base_box_test.sh <TARGET>
Review comment:
s/TARGET/MICROTVM_PLATFORM/g
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]