4.3.2. Simulation Configuration#
4.3.2.1. Base#
- class simbricks.orchestration.simulation.base.Simulator(simulation: sim_base.Simulation, executable: str, name: str = '')#
Base class for all simulators.
- 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]#
- property extra_args: str#
- property wait_terminate: bool#
- toJSON() dict#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- static get_unique_latency_period_sync(channels: list[Channel]) tuple[TimeInterval, TimeInterval, bool]#
- 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.
- get_interface_url(inst: Instantiation, intf: Interface) str#
- 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.
- full_name() str#
Full name of the simulator.
- abstractmethod run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- async prepare(inst: Instantiation) None#
- id() int#
- class simbricks.orchestration.simulation.base.DummySimulator(simulation: sim_base.Simulation, executable: str, name: str = '')#
- run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- full_name() str#
Full name of the simulator.
- 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 prepare(inst: Instantiation) None#
- 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.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- toJSON() dict#
- property wait_terminate: bool#
- class simbricks.orchestration.simulation.base.GenericSimulator(simulation: sim_base.Simulation, executable: str, name: str = '', args: list[str] | None = None)#
Runs an arbitrary simulator binary whose full argv is given by the user.
The binary and args can contain placeholders. There are two kinds of placeholder:
@{SIMBRICKS_URL:<interface-id>}@becomes the SimBricks parameters url of that interface’s connection. Build it with interface_url_placeholder.@{SIMBRICKS_PATH:<name>}@becomes one of the run’s directories, see simbricks.orchestration.instantiation.base.InstantiationEnvironment.path_placeholder.
A placeholder may sit inside a larger argument, e.g.
--pci=@{...}@. Any other text is passed through untouched.Note: To run a binary shipped in an input artifact, name it relative to the directory it is unpacked into, e.g.
executable="@{SIMBRICKS_PATH:input_artifacts_dir}@/my-sim".- args: list[str]#
Arguments to invoke executable with, possibly containing placeholders.
- static interface_url_placeholder(interface: Interface) str#
Placeholder that run_cmd replaces with @interface’s parameters url.
- full_name() str#
Full name of the simulator.
- toJSON() dict#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- 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 prepare(inst: Instantiation) None#
- 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.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- property wait_terminate: bool#
- class simbricks.orchestration.simulation.base.Simulation(name: str, system: System)#
Base class for all simulation experiments.
Contains the simulators to be run and experiment-wide parameters.
- name#
This experiment’s name.
Can be used to run only a selection of experiments.
- timeout: int | None#
Timeout for experiment in seconds.
- toJSON() dict#
Serializes a Simulation.
- Note: The sys_sim_map is not serialized as the sim_list stores the required information implicitly as Simulators,
when serialized store a list of their corresponding components.
- classmethod fromJSON(system: System, json_obj: dict, enforce_dummies: bool = False) Self#
Deserializes a Simulation.
- Note: The sys_sim_map is not deserialized as the map is restored when deserializing the the sim_list.
This is possible as each Simulator stores when a list of their corresponding components when serialized.
- add_spec_sim_map(sys: Component, sim: Simulator)#
Add a mapping from specification to simulation instance
- id() int#
- enable_synchronization(sync_period: TimeInterval | str | None = None) None#
- resreq_mem() int#
Memory required to run all simulators in this experiment.
- resreq_cores() int#
Number of Cores required to run all simulators in this experiment.
- find_sim(comp: sys_conf.Component) sim_base.Simulator#
Returns the used simulator object for the system component.
- async prepare(inst: Instantiation) None#
- any_supports_checkpointing() bool#
4.3.2.2. Channel#
- class simbricks.orchestration.simulation.channel.Channel(chan: Channel)#
- property sync_period: TimeInterval#
The synchronization period. For SimBricks to function properly in sync mode, the sync period must not be larger than a channels latency.
- toJSON()#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- id() int#
4.3.2.3. Host#
- class simbricks.orchestration.simulation.host.HostSim(simulation: Simulation, executable: str, name='')#
- toJSON() dict#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- full_name() str#
Full name of the simulator.
- abstractmethod supported_image_formats() list[str]#
- abstractmethod async copy_disk_image(inst: Instantiation, disk_image: DiskImage, ident: str) str#
- async prepare(inst: Instantiation)#
- 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().
- check_boot_artifact(host: FullSystemHost, kind: BootArtifact) bool#
- boot_artifact(host: FullSystemHost, kind: BootArtifact) str#
Path of a boot artifact previously fetched by pull_boot_artifacts.
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- 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#
- 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.
- abstractmethod run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- property wait_terminate: bool#
4.3.2.4. PCIDev#
- class simbricks.orchestration.simulation.pcidev.PCIDevSim(simulation: Simulation, executable: str, name: str)#
Base class for PCIe device simulators.
- full_name() str#
Full name of the simulator.
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- 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 prepare(inst: Instantiation) None#
- 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.
- abstractmethod run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- toJSON() dict#
- property wait_terminate: bool#
- class simbricks.orchestration.simulation.pcidev.NICSim(simulation: Simulation, executable: str, name: str = '')#
Base class for NIC simulators.
- toJSON() dict#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- full_name() str#
Full name of the simulator.
- add(nic: SimplePCIeNIC)#
- run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- 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 prepare(inst: Instantiation) None#
- 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.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- property wait_terminate: bool#
4.3.2.5. Net#
- class simbricks.orchestration.simulation.net.NetSim(simulation: Simulation, executable: str, name: str = '')#
Base class for network simulators.
- full_name() str#
Full name of the simulator.
- init_network() None#
- toJSON() dict#
- classmethod fromJSON(simulation: Simulation, json_obj: dict) Self#
- checkpoint_commands() list[str]#
- cleanup_commands() list[str]#
- property extra_args: str#
- 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]#
- 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 prepare(inst: Instantiation) None#
- 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.
- abstractmethod run_cmd(inst: Instantiation) str#
Command to execute this simulator.
- sockets_cleanup(inst: Instantiation) list[Socket]#
- sockets_wait(inst: Instantiation) list[Socket]#
- start_delay() int#
- supports_checkpointing() bool#
- property wait_terminate: bool#