gromero commented on a change in pull request #7813:
URL: https://github.com/apache/tvm/pull/7813#discussion_r610906010
##########
File path: python/tvm/micro/contrib/zephyr.py
##########
@@ -108,7 +108,18 @@ def __init__(
f"project_dir supplied to ZephyrCompiler does not exist:
{project_dir}"
)
+ if "qemu" in board:
Review comment:
@areusch I can but I'm actually trimming off based on that check too. If
I simplify like you suggest it would be:
```
diff --git a/python/tvm/micro/contrib/zephyr.py
b/python/tvm/micro/contrib/zephyr.py
index ed66ce111..e772fa610 100644
--- a/python/tvm/micro/contrib/zephyr.py
+++ b/python/tvm/micro/contrib/zephyr.py
@@ -108,15 +108,14 @@ class ZephyrCompiler(tvm.micro.Compiler):
f"project_dir supplied to ZephyrCompiler does not exist:
{project_dir}"
)
- if "qemu" in board:
- self._qemu = True
+ self._qemu = "qemu" in board
- # For Zephyr boards that run emulated by default, i.e.
"simulation: qemu" is set in
- # the board's .yaml config file, and which their names don't
have the prefix "qemu_", a
- # suffix "-qemu" is used in microTVM to inform that the QEMU
transporter has to be used.
- # So the suffix needs to be trimmed off before the board name
is passed to Zephyr.
- if "-qemu" in board:
- board = board.replace("-qemu", "")
+ # For Zephyr boards that run emulated by default, i.e. "simulation:
qemu" is set in
+ # the board's .yaml config file, and which their names don't have
the prefix "qemu_", a
+ # suffix "-qemu" is used in microTVM to inform that the QEMU
transporter has to be used.
+ # So the suffix needs to be trimmed off before the board name is
passed to Zephyr.
+ if "-qemu" in board:
+ board = board.replace("-qemu", "")
self._board = board
```
i.e. to keep the same result I would have to check for "-qemu" anyway below
in order to trim off the suffix from the board name. Am I following your
suggestion correctly? If so, I still prefer trimming off only when "qemu" is in
board, so the first version.
--
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]