mehrdadh commented on code in PR #13377:
URL: https://github.com/apache/tvm/pull/13377#discussion_r1025798464


##########
apps/microtvm/zephyr/template_project/microtvm_api_server.py:
##########
@@ -504,42 +506,68 @@ def _cmsis_required(self, project_path: Union[str, 
pathlib.Path]) -> bool:
                     return True
         return False
 
-    def _generate_cmake_args(self, mlf_extracted_path, options) -> str:
+    def _generate_cmake_args(
+        self,
+        mlf_extracted_path,
+        board: str,
+        use_fvp: bool,
+        west_cmd: str,
+        zephyr_base: str,
+        verbose: bool,
+        cmsis_path: pathlib.Path,
+    ) -> str:
         cmake_args = "\n# cmake args\n"
-        if options.get("verbose"):
+        if verbose:
             cmake_args += "set(CMAKE_VERBOSE_MAKEFILE TRUE)\n"
 
-        if options.get("zephyr_base"):
-            cmake_args += f"set(ZEPHYR_BASE {options['zephyr_base']})\n"
+        if zephyr_base:
+            cmake_args += f"set(ZEPHYR_BASE {zephyr_base})\n"
 
-        if options.get("west_cmd"):
-            cmake_args += f"set(WEST {options['west_cmd']})\n"
+        if west_cmd:
+            cmake_args += f"set(WEST {west_cmd})\n"
 
-        if self._is_qemu(options["board"], options.get("use_fvp")):
+        if self._is_qemu(board, use_fvp):
             # Some boards support more than one emulator, so ensure QEMU is 
set.
             cmake_args += f"set(EMU_PLATFORM qemu)\n"
 
-        if self._is_fvp(options["board"], options.get("use_fvp")):
+        if self._is_fvp(board, use_fvp):
             cmake_args += "set(EMU_PLATFORM armfvp)\n"
             cmake_args += "set(ARMFVP_FLAGS -I)\n"
 
-        cmake_args += f"set(BOARD {options['board']})\n"
+        cmake_args += f"set(BOARD {board})\n"
 
-        enable_cmsis = self._cmsis_required(mlf_extracted_path)
-        if enable_cmsis:
-            assert os.environ.get("CMSIS_PATH"), "CMSIS_PATH is not defined."
-        cmake_args += f"set(ENABLE_CMSIS {str(enable_cmsis).upper()})\n"
+        if self._cmsis_required(mlf_extracted_path):
+            assert cmsis_path, CMSIS_PATH_ERROR
+        cmake_args += f"set(CMSIS_PATH {str(cmsis_path)})\n"
 
         return cmake_args
 
     def generate_project(self, model_library_format_path, standalone_crt_dir, 
project_dir, options):
         zephyr_board = options["board"]
+        project_type = options["project_type"]
+
+        zephyr_base = get_zephyr_base(options)
+        warning_as_error = options.get("warning_as_error")
+        use_fvp = options.get("use_fvp")
+        west_cmd = get_west_cmd(options)
+        verbose = options.get("verbose")
+
+        recommended_heap_size = _get_recommended_heap_size_bytes(options)
+        heap_size_bytes = options.get("heap_size_bytes")
+        board_mem_size = _get_board_mem_size_bytes(options)
+
+        compile_definitions = options.get("compile_definitions")
+        config_main_stack_size = options.get("config_main_stack_size")
+
+        extra_files_tar = options.get("extra_files_tar")
+
+        cmsis_path = get_cmsis_path(options)

Review Comment:
   This is a bug, I fixed it.



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