Esempio n. 1
0
 def server_info_query(self, tvm_version):
     return server.ServerInfo(
         platform_name="host",
         is_template=IS_TEMPLATE,
         model_library_format_path="" if IS_TEMPLATE else PROJECT_DIR /
         MODEL_LIBRARY_FORMAT_RELPATH,
         project_options=[
             server.ProjectOption("verbose",
                                  help="Run make with verbose output")
         ],
     )
Esempio n. 2
0
        BOARD_PROPERTIES = json.load(boards)
except FileNotFoundError:
    raise FileNotFoundError(f"Board file {{{BOARDS}}} does not exist.")


class BoardAutodetectFailed(Exception):
    """Raised when no attached hardware is found matching the requested board"""


PROJECT_TYPES = ["example_project", "host_driven"]

PROJECT_OPTIONS = [
    server.ProjectOption(
        "arduino_board",
        required=["build", "flash", "open_transport"],
        choices=list(BOARD_PROPERTIES),
        type="str",
        help="Name of the Arduino board to build for.",
    ),
    server.ProjectOption(
        "arduino_cli_cmd",
        required=(["generate_project", "build", "flash", "open_transport"]
                  if not ARDUINO_CLI_CMD else None),
        optional=(["generate_project", "build", "flash", "open_transport"]
                  if ARDUINO_CLI_CMD else None),
        default=ARDUINO_CLI_CMD,
        type="str",
        help="Path to the arduino-cli tool.",
    ),
    server.ProjectOption(
        "port",
Esempio n. 3
0
        return []

    return ["--snr", boards[0]]


PROJECT_TYPES = []
if IS_TEMPLATE:
    for d in (API_SERVER_DIR / "src").iterdir():
        if d.is_dir():
            PROJECT_TYPES.append(d.name)

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."),
        optional=["open_transport"],
        type="int",
    ),
    server.ProjectOption(
        "nrfjprog_snr",
        optional=["open_transport"],
        type="int",
        help=
Esempio n. 4
0
    if not boards:
        return []

    return ["--snr", boards[0]]


PROJECT_TYPES = []
if IS_TEMPLATE:
    for d in (API_SERVER_DIR / "src").iterdir():
        if d.is_dir():
            PROJECT_TYPES.append(d.name)


PROJECT_OPTIONS = [
    server.ProjectOption(
        "extra_files",
        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")
    ),
    server.ProjectOption(
        "nrfjprog_snr",
        help=(
            "When used with nRF targets, serial # of the " "attached board to use, from nrfjprog"
        ),
    ),
    server.ProjectOption(
        "openocd_serial",
        help=("When used with OpenOCD targets, serial # of the " "attached board to use"),
    ),
    server.ProjectOption(
Esempio n. 5
0
    with open(BOARDS) as boards:
        BOARD_PROPERTIES = json.load(boards)
except FileNotFoundError:
    raise FileNotFoundError(f"Board file {{{BOARDS}}} does not exist.")


class BoardAutodetectFailed(Exception):
    """Raised when no attached hardware is found matching the requested board"""


PROJECT_TYPES = ["example_project", "host_driven"]

PROJECT_OPTIONS = [
    server.ProjectOption(
        "arduino_board",
        choices=list(BOARD_PROPERTIES),
        help="Name of the Arduino board to build for",
    ),
    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.",
        choices=tuple(PROJECT_TYPES),
    ),
    server.ProjectOption(
        "verbose",
        help="True to pass --verbose flag to arduino-cli compile and upload"),
    server.ProjectOption(
Esempio n. 6
0
    if not boards:
        return []

    return ["--snr", boards[0]]


PROJECT_TYPES = []
if IS_TEMPLATE:
    for d in (API_SERVER_DIR / "src").iterdir():
        if d.is_dir():
            PROJECT_TYPES.append(d.name)

PROJECT_OPTIONS = [
    server.ProjectOption(
        "extra_files_tar",
        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.")),
    server.ProjectOption(
        "nrfjprog_snr",
        help=
        ("When used with nRF targets, serial # of the attached board to use, from nrfjprog."
         ),
    ),
    server.ProjectOption(
        "openocd_serial",
        help=
Esempio n. 7
0
        "model": "imxrt1060",
    },
    "wioterminal": {
        "package": "Seeeduino",
        "architecture": "samd",
        "board": "seeed_wio_terminal",
        "model": "atsamd51",
    },
}

PROJECT_TYPES = ["example_project", "host_driven"]

PROJECT_OPTIONS = [
    server.ProjectOption(
        "arduino_board",
        choices=list(BOARD_PROPERTIES),
        help="Name of the Arduino board to build for",
    ),
    server.ProjectOption(
        "arduino_model",
        choices=[board["model"] for _, board in BOARD_PROPERTIES.items()],
        help="Name of the model for each Arduino board.",
    ),
    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.",
        choices=tuple(PROJECT_TYPES),