mlonmcu.platform.microtvm package

Submodules

mlonmcu.platform.microtvm.microtvm module

MicroTVM Platform

class mlonmcu.platform.microtvm.microtvm.MicroTvmPlatform(features=None, config=None)[source]

Bases: MicroTvmBasePlatform, MicroTvmCompilePlatform, MicroTvmBuildPlatform, MicroTvmTunePlatform

MicroTVM Platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'build_dir': None, 'debug': False, 'enable_wandb': False, 'experimental_tvmc_micro_tune': False, 'experimental_tvmc_print_time': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'num_threads': 4, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'project_dir': None, 'project_options': {}, 'project_template': None, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'skip_flash': False, 'total_time': False, 'tvmc_custom_script': None, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'debug', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}
create_target(name)[source]
get_supported_targets()[source]

mlonmcu.platform.microtvm.microtvm_arduino_target module

class mlonmcu.platform.microtvm.microtvm_arduino_target.ArduinoMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'arduino_board': '?', 'port': -1, 'print_outputs': False, 'project_type': None, 'repeat': None, 'verbose': False, 'warning_as_error': False}
REQUIRED = {'arduino.install_dir'}
property arduino_install_dir
get_project_options()[source]
property port
update_environment(env)[source]

mlonmcu.platform.microtvm.microtvm_backend module

mlonmcu.platform.microtvm.microtvm_backend.create_microtvm_platform_backend(name, platform, base=<class 'mlonmcu.flow.tvm.backend.backend.TVMBackend'>)[source]
mlonmcu.platform.microtvm.microtvm_backend.get_microtvm_platform_backends()[source]
mlonmcu.platform.microtvm.microtvm_backend.register_microtvm_platform_backend(backend_name, b, override=False)[source]

mlonmcu.platform.microtvm.microtvm_base_platform module

MicroTVM Base Platform

class mlonmcu.platform.microtvm.microtvm_base_platform.MicroTvmBasePlatform(name, features=None, config=None)[source]

Bases: TvmBasePlatform

MicroTVM base platform class.

DEFAULTS = {'experimental_tvmc_micro_tune': False, 'experimental_tvmc_print_time': False, 'project_dir': None, 'project_options': {}, 'project_template': None, 'tvmc_custom_script': None}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}
close()[source]
collect_available_project_options(command, target=None)[source]
get_template_args(target)[source]
init_directory(path=None, context=None)[source]
invoke_tvmc(command, *args, target=None, live=None, **kwargs)[source]
invoke_tvmc_micro(command, *args, target=None, list_options=False, **kwargs)[source]
property project_options
property project_template
property tvm_build_dir
property tvm_configs_dir
property tvm_pythonpath
property tvmc_custom_script
mlonmcu.platform.microtvm.microtvm_base_platform.filter_project_options(valid, options)[source]
mlonmcu.platform.microtvm.microtvm_base_platform.get_project_option_args(stage, project_options)[source]
mlonmcu.platform.microtvm.microtvm_base_platform.parse_project_options_from_stdout(out)[source]

mlonmcu.platform.microtvm.microtvm_build_platform module

MicroTVM Build Platform

class mlonmcu.platform.microtvm.microtvm_build_platform.MicroTvmBuildPlatform(name, features=None, config=None)[source]

Bases: BuildPlatform

MicroTVM build platform class.

create_backend(name)[source]
get_supported_backends()[source]

mlonmcu.platform.microtvm.microtvm_compile_platform module

MicroTVM Compile Platform

class mlonmcu.platform.microtvm.microtvm_compile_platform.MicroTvmCompilePlatform(name, features=None, config=None)[source]

Bases: CompilePlatform

MicroTVM compile platform class.

compile(target)[source]
generate(src, target, model=None) Tuple[dict, dict][source]
invoke_tvmc_micro_build(target=None, list_options=False, force=False, **kwargs)[source]
invoke_tvmc_micro_create(mlf_path, target=None, list_options=False, force=True, **kwargs)[source]
prepare(mlf, target)[source]

mlonmcu.platform.microtvm.microtvm_corev_ovpsim_target module

class mlonmcu.platform.microtvm.microtvm_corev_ovpsim_target.CoreVOVPSimMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'abi': None, 'arch': None, 'attr': '', 'enable_xcorevalu': False, 'enable_xcorevbi': False, 'enable_xcorevbitmanip': False, 'enable_xcorevhwlp': False, 'enable_xcorevmac': False, 'enable_xcorevmem': False, 'enable_xcorevsimd': False, 'extensions': ['i', 'm', 'a', 'c'], 'fpu': 'double', 'ovpsim_extra_args': '', 'print_outputs': False, 'quiet': False, 'repeat': None, 'toolchain': 'gcc', 'verbose': False, 'workspace_size_bytes': None, 'xlen': 32}
FEATURES = {'benchmark', 'xcorev'}
REQUIRED = {'corev_ovpsim.exe', 'llvm.install_dir', 'microtvm_ovpsim.src_dir', 'riscv_gcc.install_dir', 'riscv_gcc.name'}
property abi
add_backend_config(backend, config, optimized_layouts=False, optimized_schedules=False)[source]
property attr
property enable_xcorevalu
property enable_xcorevbi
property enable_xcorevbitmanip
property enable_xcorevhwlp
property enable_xcorevmac
property enable_xcorevmem
property enable_xcorevsimd
property etiss_extra_args
property etiss_script
property extensions
property fpu
property gcc_arch
get_backend_config(backend, optimized_layouts=False, optimized_schedules=False)[source]
get_project_options()[source]
property llvm_arch
property llvm_prefix
property microtvm_ovpsim_src_dir
property riscv_gcc_install_dir
property riscv_gcc_name
property toolchain
property xlen

mlonmcu.platform.microtvm.microtvm_espidf_target module

class mlonmcu.platform.microtvm.microtvm_espidf_target.EspidfMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'baud': None, 'board': None, 'port': None, 'print_outputs': False, 'project_type': 'host_driven', 'repeat': None, 'verbose': False}
REQUIRED = {'espidf.install_dir', 'espidf.src_dir', 'microtvm_espidf.template'}
property baud
property board
property esp_idf_install_dir
property esp_idf_src_dir
get_project_options()[source]
property microtvm_espidf_template
property port

mlonmcu.platform.microtvm.microtvm_etiss_target module

class mlonmcu.platform.microtvm.microtvm_etiss_target.EtissMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'abi': None, 'arch': None, 'attr': '', 'cpu_arch': None, 'enable_xcorevalu': False, 'enable_xcorevbi': False, 'enable_xcorevbitmanip': False, 'enable_xcorevhwlp': False, 'enable_xcorevmac': False, 'enable_xcorevmem': False, 'enable_xcorevsimd': False, 'etiss_extra_args': '', 'extensions': ['i', 'm', 'c'], 'fpu': 'double', 'print_outputs': False, 'quiet': False, 'repeat': None, 'toolchain': 'gcc', 'verbose': False, 'workspace_size_bytes': None, 'xlen': 32}
FEATURES = {'benchmark', 'xcorev'}
REQUIRED = {'etissvp.script', 'llvm.install_dir', 'microtvm_etiss.src_dir', 'riscv_gcc.install_dir', 'riscv_gcc.name'}
property abi
add_backend_config(backend, config, optimized_layouts=False, optimized_schedules=False)[source]
property attr
property cpu_arch
property enable_xcorevalu
property enable_xcorevbi
property enable_xcorevbitmanip
property enable_xcorevhwlp
property enable_xcorevmac
property enable_xcorevmem
property enable_xcorevsimd
property etiss_extra_args
property etiss_script
property extensions
property fpu
property gcc_arch
get_backend_config(backend, optimized_layouts=False, optimized_schedules=False)[source]
get_project_options()[source]
property llvm_arch
property llvm_prefix
property microtvm_etiss_src_dir
property riscv_gcc_install_dir
property riscv_gcc_name
property toolchain
property xlen

mlonmcu.platform.microtvm.microtvm_host_target module

class mlonmcu.platform.microtvm.microtvm_host_target.HostMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'print_outputs': False, 'repeat': None, 'verbose': False}
REQUIRED = {'tvm.build_dir'}
property tvm_build_dir

mlonmcu.platform.microtvm.microtvm_mlonmcu_target module

class mlonmcu.platform.microtvm.microtvm_mlonmcu_target.MlonmcuMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'abi': None, 'arch': None, 'attr': '', 'cpu_arch': None, 'enable_xcorevalu': False, 'enable_xcorevbi': False, 'enable_xcorevbitmanip': False, 'enable_xcorevhwlp': False, 'enable_xcorevmac': False, 'enable_xcorevmem': False, 'enable_xcorevsimd': False, 'etiss_extra_args': '', 'extensions': ['i', 'm', 'a', 'c'], 'fpu': 'double', 'print_outputs': False, 'quiet': False, 'repeat': None, 'toolchain': 'gcc', 'verbose': False, 'workspace_size_bytes': None, 'xlen': 32}
FEATURES = {'benchmark', 'xcorev'}
REQUIRED = {'etissvp.script', 'llvm.install_dir', 'mlif.src_dir', 'riscv_gcc.install_dir', 'riscv_gcc.name'}
property abi
add_backend_config(backend, config, optimized_layouts=False, optimized_schedules=False)[source]
property attr
property cpu_arch
property enable_xcorevalu
property enable_xcorevbi
property enable_xcorevbitmanip
property enable_xcorevhwlp
property enable_xcorevmac
property enable_xcorevmem
property enable_xcorevsimd
property etiss_extra_args
property etiss_script
property extensions
property fpu
property gcc_arch
get_backend_config(backend, optimized_layouts=False, optimized_schedules=False)[source]
get_project_options()[source]
property llvm_arch
property llvm_prefix
property microtvm_etiss_src_dir
property riscv_gcc_install_dir
property riscv_gcc_name
property toolchain
property xlen

mlonmcu.platform.microtvm.microtvm_spike_target module

class mlonmcu.platform.microtvm.microtvm_spike_target.SpikeMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget, RVPTarget, RVVTarget

DEFAULTS = {'abi': None, 'arch': None, 'atomic': True, 'attr': '', 'compressed': True, 'cpu': None, 'elen': 64, 'embedded': False, 'embedded_vext': False, 'enable_pext': False, 'enable_vext': False, 'extensions': [], 'extra_args': '', 'fpu': 'double', 'multiply': True, 'pext_spec': 0.92, 'print_outputs': False, 'quiet': True, 'repeat': None, 'timeout_sec': 0, 'toolchain': 'gcc', 'verbose': False, 'vext_spec': 1.0, 'vlen': 128, 'workspace_size_bytes': None, 'xlen': 32}
FEATURES = {'benchmark', 'pext', 'vext'}
REQUIRED = {'llvm.install_dir', 'microtvm_spike.src_dir', 'riscv_gcc.install_dir', 'riscv_gcc.name', 'riscv_gcc.variant', 'spike.exe', 'spike.pk', 'tvm.build_dir'}
property extensions
get_backend_config(backend, optimized_layouts=False, optimized_schedules=False)[source]
get_project_options()[source]
property llvm_prefix
property microtvm_spike_src_dir
property spike_exe
property spike_pk
property toolchain

mlonmcu.platform.microtvm.microtvm_target module

mlonmcu.platform.microtvm.microtvm_target.create_microtvm_platform_target(name, platform, base=<class 'mlonmcu.target.target.Target'>)[source]
mlonmcu.platform.microtvm.microtvm_target.get_microtvm_platform_targets()[source]
mlonmcu.platform.microtvm.microtvm_target.name2template(name)[source]
mlonmcu.platform.microtvm.microtvm_target.register_microtvm_platform_target(target_name, t, override=False)[source]

mlonmcu.platform.microtvm.microtvm_target_platform module

MicroTVM Target Platform

class mlonmcu.platform.microtvm.microtvm_target_platform.MicroTvmTargetPlatform(name, features=None, config=None)[source]

Bases: TvmTargetPlatform

MicroTVM target platform class.

DEFAULTS = {'aggregate': 'none', 'experimental_tvmc_print_time': False, 'fill_mode': None, 'ins_file': None, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'skip_flash': False, 'total_time': False, 'use_rpc': False}
FEATURES = {}
property experimental_tvmc_print_time
flash(elf, target, timeout=120)[source]
get_tvmc_run_args()[source]
invoke_tvmc_micro_flash(target=None, list_options=False, **kwargs)[source]
invoke_tvmc_micro_run(*args, target=None, list_options=False, **kwargs)[source]
invoke_tvmc_run(*args, target=None)[source]
monitor(target, timeout=60)[source]
run(elf, target, timeout=120)[source]
property skip_flash

mlonmcu.platform.microtvm.microtvm_template_target module

class mlonmcu.platform.microtvm.microtvm_template_target.TemplateMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: Target

REQUIRED = {'tvm.build_dir'}
get_project_options()[source]
update_environment(env)[source]

mlonmcu.platform.microtvm.microtvm_tune_platform module

MicroTVM Tune Platform

class mlonmcu.platform.microtvm.microtvm_tune_platform.MicroTvmTunePlatform(name, features=None, config=None)[source]

Bases: TvmTunePlatform, MicroTvmTargetPlatform

MicroTVM Tune platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'enable_wandb': False, 'experimental_tvmc_print_time': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'skip_flash': False, 'total_time': False, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {}
property experimental_tvmc_micro_tune
invoke_tvmc_micro_tune(*args, target=None, list_options=False, **kwargs)[source]
invoke_tvmc_tune(*args, target=None, **kwargs)[source]

mlonmcu.platform.microtvm.microtvm_zephyr_target module

class mlonmcu.platform.microtvm.microtvm_zephyr_target.ZephyrMicroTvmPlatformTarget(name=None, features=None, config=None)[source]

Bases: TemplateMicroTvmPlatformTarget

DEFAULTS = {'compile_definitions': '', 'config_main_stack_size': '16384', 'extra_files_tar': None, 'gdbserver_port': None, 'nrfjprog_snr': None, 'openocd_serial': None, 'port': None, 'print_outputs': False, 'project_type': 'host_driven', 'repeat': None, 'verbose': False, 'warning_as_error': True, 'zephyr_board': ''}
REQUIRED = {'zephyr.install_dir', 'zephyr.sdk_dir'}
get_project_options()[source]
property port
update_environment(env)[source]
property zephyr_install_dir
property zephyr_sdk_dir

Module contents

MLonMCU MicroTVM platform

class mlonmcu.platform.microtvm.MicroTvmPlatform(features=None, config=None)[source]

Bases: MicroTvmBasePlatform, MicroTvmCompilePlatform, MicroTvmBuildPlatform, MicroTvmTunePlatform

MicroTVM Platform class.

DEFAULTS = {'aggregate': 'none', 'autoscheduler_enable': False, 'autoscheduler_include_simple_tasks': False, 'autoscheduler_log_estimated_latency': True, 'autotuning_append': None, 'autotuning_early_stopping': None, 'autotuning_max_parallel': 1, 'autotuning_mode': None, 'autotuning_num_workers': None, 'autotuning_results_file': None, 'autotuning_tasks': None, 'autotuning_timeout': 100, 'autotuning_trials': 10, 'autotuning_trials_single': None, 'autotuning_use_rpc': False, 'autotuning_visualize': False, 'autotuning_visualize_file': None, 'autotuning_visualize_live': False, 'autotvm_enable': False, 'autotvm_tuner': 'ga', 'build_dir': None, 'debug': False, 'enable_wandb': False, 'experimental_tvmc_micro_tune': False, 'experimental_tvmc_print_time': False, 'experimental_tvmc_tune_tasks': False, 'experimental_tvmc_tune_visualize': False, 'fill_mode': None, 'ins_file': None, 'metascheduler_enable': False, 'min_repeat_ms': 0, 'num_threads': 4, 'number': 1, 'outs_file': None, 'print_outputs': False, 'print_top': False, 'profile': False, 'project_dir': None, 'project_options': {}, 'project_template': None, 'repeat': 1, 'rpc_hostname': None, 'rpc_key': None, 'rpc_port': None, 'skip_flash': False, 'total_time': False, 'tvmc_custom_script': None, 'use_rpc': False}
FEATURES = {'autoscheduler', 'autotvm', 'benchmark', 'debug', 'metascheduler', 'tvm_profile', 'tvm_rpc'}
REQUIRED = {'tvm.build_dir', 'tvm.configs_dir', 'tvm.pythonpath'}
create_target(name)[source]
get_supported_targets()[source]