emulator_engine.features.controller package

Controller which configures subcontrollers and their messaging setups.

class emulator_engine.features.controller.EmulatorController(config_str: str, initial_signals_config_str: str, bitstream_emulator_path: str, bitstream_emulator_id: str, pulse_interval: float = 1.0, generate_initial_signals: bool = False, pulses_from_router_map: dict[str, int] = {}, **kwargs)[source]

Bases: LoggingBase

Controller which configures IP block emulators and sends a pulse downstream.

Takes in a config JSON string which it uses to set up all the emulators and connections between them, among other configurations.

Parameters:
  • config_str (str) – A serialized JSON string containing the configuration for this emulator.

  • bitstream_emulator_path (str) – The path to the directory containing individual IP block emulator folders.

  • bitstream_emulator_id (str, optional) – ID of this bitstream emulator.

await_api_cleanup() None[source]

Wait for the API server to finish shutting down and halt the main API listener thread.

flush_all() None[source]

Flush all queues.

Attempts to flush all queues of all emulators the controller has configured.

start() None[source]

Start the emulator and begin subscriptions.

stop() None[source]

Stop the emulator and unsubscribe from any active subscriptions. Does not stop the API server.

terminate() None[source]

Terminate the emulator, unsubscribe from any active subscriptions, and kill the API server.