sknrf.device.simulator.base module

exception sknrf.device.simulator.base.SimulatorError

Bases: Exception

class sknrf.device.simulator.base.AbstractSimulator(netlist_filename, dataset_filename, remote_host='', remote_user='', remote_password='', remote_key_filename='', remote_port=22)

Bases: object

set_netlist_filename(netlist_filename)
set_dataset_filename(dataset_filename)
is_remote()
preset()

Preset the simulation netlist :return:

abstract add(name, value)

Adds variable name to the end of the netlist with value :param name: added variable name :param value: added variable value

abstract add_block(block)

Adds general purpose code-block to the netlist file :param block: A netlist code block

abstract read_netlist(name)

Reads the value of a netlist variable “name”. Sub-component variables are specified with “group.name” notation :param name: name of the netlist variable :return value: value of the netlist variable

abstract write(name, value, add_string_quotes=True)

Writes the “value” of netlist variable “name”. Sub-component variables are specified with “group.name” notation :param name: name of the netlist variable :param value: value of the netlist variable :param add_string_quotes: optional flag to wrap string values with double quotes, default=True

abstract measure(shell_options='', timeout=None)

Run the simulation in the command line :param shell_options: shell option string :param timeout: simulation time-out in seconds :return (result, log): simulator exit status (0 = success), shell stdout string

abstract read(name, sweep_idx=slice(None, None, None), freq_idx=slice(None, None, None), time_idx=slice(None, None, None))

Reads the value of a dataset variable “name”[sweep_idx, freq_idx, time_idx] :param name: name of dataset variable :param sweep_idx: parameter sweep index :param freq_idx: frequency sweep index :param time_idx: time sweep index :return value: 3D array (sweep_idx.size, freq_idx.size, time_idx.size) of dataset value