riscemu.riscemu_main module

class riscemu.riscemu_main.RiscemuMain(cfg: Optional[RunConfig] = None)

Bases: object

This represents the riscemu API exposed to other programs for better interoperability.

__init__(cfg: Optional[RunConfig] = None)
available_ins_sets: Dict[str, Type[InstructionSet]]
available_file_loaders: List[Type[ProgramLoader]]
cfg: Optional[RunConfig]
cpu: Optional[CPU]
input_files: List[str]
selected_ins_sets: List[Type[InstructionSet]]
instantiate_cpu()
configure_cpu()
register_all_arguments(parser: ArgumentParser)
register_all_isas()
register_all_program_loaders()
parse_argv(argv: List[str])
add_libc_to_input_files()

This adds the provided riscemu libc to the programs runtime.

create_config(args: Namespace) RunConfig
load_programs()
run_from_cli(argv: List[str])
run()

This assumes that these values were set externally:

  • available_file_loaders: A list of available file loaders. Can be set using .register_all_program_loaders()

  • cfg: The RunConfig object. Can be directly assigned to the attribute

  • input_files: A list of assembly files to load.

  • selected_ins_sets: A list of instruction sets the CPU should support.

class riscemu.riscemu_main.OptionStringAction(option_strings, dest, keys=None, omit_empty=False, **kwargs)

Bases: Action

__init__(option_strings, dest, keys=None, omit_empty=False, **kwargs)