Skip to content
30 changes: 24 additions & 6 deletions apps/microtvm/arduino/template_project/microtvm_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,40 @@ class BoardAutodetectFailed(Exception):
PROJECT_OPTIONS = [
server.ProjectOption(
"arduino_board",
required=["build", "flash", "open_transport"],
choices=list(BOARD_PROPERTIES),
help="Name of the Arduino board to build for",
type="str",
help="Name of the Arduino board to build for.",
),
server.ProjectOption(
"arduino_cli_cmd",
required=["build", "flash", "open_transport"],
type="str",
help="Path to the arduino-cli tool.",
),
server.ProjectOption(
"port",
optional=["flash", "open_transport"],
type="int",
help="Port to use for connecting to hardware.",
),
server.ProjectOption("arduino_cli_cmd", help="Path to the arduino-cli tool."),
server.ProjectOption("port", help="Port to use for connecting to hardware"),
server.ProjectOption(
"project_type",
help="Type of project to generate.",
required=["generate_project"],
choices=tuple(PROJECT_TYPES),
type="str",
help="Type of project to generate.",
),
server.ProjectOption(
"verbose", help="True to pass --verbose flag to arduino-cli compile and upload"
"verbose",
optional=["build", "flash"],
type="bool",
help="Run arduino-cli compile and upload with verbose output.",
),
server.ProjectOption(
"warning_as_error",
choices=(True, False),
optional=["generate_project"],
type="bool",
help="Treat warnings as errors and raise an Exception.",
),
]
Expand Down
42 changes: 37 additions & 5 deletions apps/microtvm/zephyr/template_project/microtvm_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,49 +234,81 @@ def _get_nrf_device_args(options):
PROJECT_OPTIONS = [
server.ProjectOption(
"extra_files_tar",
optional=["generate_project"],
type="str",
help="If given, during generate_project, uncompress the tarball at this path into the project dir.",
),
server.ProjectOption(
"gdbserver_port", help=("If given, port number to use when running the local gdbserver.")
"gdbserver_port",
help=("If given, port number to use when running the local gdbserver."),
optional=["open_transport"],
type="int",
),
server.ProjectOption(
"nrfjprog_snr",
optional=["open_transport"],
type="int",
help=("When used with nRF targets, serial # of the attached board to use, from nrfjprog."),
),
server.ProjectOption(
"openocd_serial",
optional=["open_transport"],
type="int",
help=("When used with OpenOCD targets, serial # of the attached board to use."),
),
server.ProjectOption(
"project_type",
help="Type of project to generate.",
choices=tuple(PROJECT_TYPES),
required=["generate_project"],
type="str",
help="Type of project to generate.",
),
server.ProjectOption(
"verbose",
optional=["build"],
type="bool",
help="Run build with verbose output.",
),
server.ProjectOption("verbose", help="Run build with verbose output.", choices=(True, False)),
server.ProjectOption(
"west_cmd",
optional=["generate_project"],
default=sys.executable + " -m west" if sys.executable else None,
type="str",
help=(
"Path to the west tool. If given, supersedes both the zephyr_base "
"option and ZEPHYR_BASE environment variable."
),
),
server.ProjectOption("zephyr_base", help="Path to the zephyr base directory."),
server.ProjectOption(
"zephyr_base",
optional=["build", "open_transport"],
default=os.getenv("ZEPHYR_BASE"),
type="str",
help="Path to the zephyr base directory.",
),
server.ProjectOption(
"zephyr_board",
required=["generate_project", "build", "flash", "open_transport"],
choices=list(BOARD_PROPERTIES),
type="str",
help="Name of the Zephyr board to build for.",
),
server.ProjectOption(
"config_main_stack_size",
optional=["generate_project"],
type="int",
help="Sets CONFIG_MAIN_STACK_SIZE for Zephyr board.",
),
server.ProjectOption(
"warning_as_error",
choices=(True, False),
optional=["generate_project"],
type="bool",
help="Treat warnings as errors and raise an Exception.",
),
server.ProjectOption(
"compile_definitions",
optional=["generate_project"],
type="str",
help="Extra definitions added project compile.",
),
]
Expand Down
3 changes: 2 additions & 1 deletion python/tvm/driver/tvmc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
TVMC - TVM driver command-line interface
"""

from . import micro
from . import runner
from . import autotuner
from . import compiler
from . import runner
from . import result_utils
from .frontends import load_model as load
from .compiler import compile_model as compile
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/driver/tvmc/autotuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


@register_parser
def add_tune_parser(subparsers):
def add_tune_parser(subparsers, _):
"""Include parser for 'tune' subcommand"""

parser = subparsers.add_parser("tune", help="auto-tune a model")
Expand Down
Loading