mehrdadh commented on a change in pull request #9026:
URL: https://github.com/apache/tvm/pull/9026#discussion_r711369451



##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -59,44 +60,13 @@
 
 # Data structure to hold the information microtvm_api_server.py needs
 # to communicate with each of these boards.
-BOARD_PROPERTIES = {
-    "qemu_x86": {
-        "board": "qemu_x86",
-        "model": "host",
-    },
-    "qemu_riscv32": {
-        "board": "qemu_riscv32",
-        "model": "host",
-    },
-    "qemu_riscv64": {
-        "board": "qemu_riscv64",
-        "model": "host",
-    },
-    "mps2_an521": {
-        "board": "mps2_an521",
-        "model": "mps2_an521",
-    },
-    "nrf5340dk_nrf5340_cpuapp": {
-        "board": "nrf5340dk_nrf5340_cpuapp",
-        "model": "nrf5340dk",
-    },
-    "stm32f746g_disco": {
-        "board": "stm32f746g_disco",
-        "model": "stm32f746xx",
-    },
-    "nucleo_f746zg": {
-        "board": "nucleo_f746zg",
-        "model": "stm32f746xx",
-    },
-    "nucleo_l4r5zi": {
-        "board": "nucleo_l4r5zi",
-        "model": "stm32l4r5zi",
-    },
-    "qemu_cortex_r5": {
-        "board": "qemu_cortex_r5",
-        "model": "zynq_mp_r5",
-    },
-}
+BOARD_PROPERTIES = None
+BOARDS_FILE_NAME = "boards.json"
+
+with open(
+    BOARDS_FILE_NAME,
+) as board_f:
+    BOARD_PROPERTIES = json.load(board_f)

Review comment:
       since this is used once I think we could just use FileNotFoundError 
exception? something like this:
   
   ```
   try:
       with open(BOARDS) as boards:
           BOARD_PROPERTIES = json.load(boards)
   except FileNotFoundError:
       raise FileNotFoundError(f"Board file {{{BOARDS}}} does not exist.")
   ```
   
   




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to