4.4.2. gem5#

4.4.2.1. Simulation#

class simbricks.components.gem5.simulation.gem5.Gem5Sim(simulation: Simulation, executable: str | None = None, config: str | None = None)#
supports_checkpointing() → bool#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

supported_image_formats() → list[str]#
toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
async copy_disk_image(inst: Instantiation, disk_image: DiskImage, ident: str)#
async prepare(inst: Instantiation) → None#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

add(host: Host)#
boot_artifact(host: FullSystemHost, kind: BootArtifact) → str#

Path of a boot artifact previously fetched by pull_boot_artifacts.

check_boot_artifact(host: FullSystemHost, kind: BootArtifact) → bool#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
full_name() → str#

Full name of the simulator.

get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async pull_boot_artifacts(inst: Instantiation, host: FullSystemHost, kinds: list[BootArtifact]) → None#

Fetch @kinds from @host’s first disk image and stash them for run_cmd.

Called from a simulator’s prepare, naming every kind at once. run_cmd is synchronous and cannot fetch, so it reads the stash via boot_artifact().

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supported_socket_types(interface: Interface) → set[SockType]#
property wait_terminate: bool#