dut_xyce module

The interface to the Xyce circuit simulator from Sandia

class DMT.xyce.dut_xyce.DutXyce(database_dir, dut_type, input_circuit, name='xyce_', simulator_command=None, simulator_arguments=None, simulator_options=None, build_xyce_plugin_command='buildxyceplugin', inp_name='xyce_circuit.cir', **kwargs)[source]

Bases: DutCircuit

Class to interface the Xyce circuit simulator

create_inp_header(inp_circuit)[source]

Creates the input header of the given circuit description and returns it.

Parameters:
inputDMT.core.Circuit or DMT.core.MCard

If a MCard is given, the circuit is created from it.

Returns:
netliststr
classmethod from_json(json_content: Dict, classes_technology: List[Type[Technology]], subclass_kwargs: Dict | None = None) DutXyce[source]

Static class method. Loads a DutXyce object from a json or pickle file with full path save_dir.

Calls the from_json method of DutView with all dictionary inside the “parent” keyword. Afterwards the additional parameters are set correctly.

Parameters:
json_contentdict

Readed dictionary from a saved json DutNgspice.

classes_technologyList[Type[Technology]]

All possible technologies this loaded DutNgspice can have. One will be choosen according to the serialized technology loaded from the file.

subclass_kwargsDict, optional

Additional kwargs necessary to create the concrete subclassed DutView.

Returns:
DutXyce

Loaded object.

import_output_data(sweep, delete_sim_results=False, key=None)[source]

Read the output files that have been produced while simulating sweep and attach them to self.db.

Parameters:
sweepDMT.core.sweep.Sweep

Sweep that has been simulated for the desired output files.

delete_sim_results{False, True}, optional

If True, the simulation folder is deleted after reading.

Raises:
NotImplementedError

If the Dut is not a simulatable dut.

IOError

If the given sweep can not be read.

info_json(**_kwargs) Dict[source]

Returns a dict with serializeable content for the json file to create.

The topmost dict MUST have only one key: The string casted class name. Inside the parameters are:

  • A version key,

  • all extra parameters of DutXyce compared to DutCircuit and

  • the info_json of DutCircuit.

Returns:
dict

str(DutXyce): serialized content

make_input(sweep)[source]

Creates the sweep definition for the given sweep

Parameters:
sweepSweep
Returns:
str

header with added bias definitions

validate_simulation_successful(sweep)[source]

Checks if the simulation of the given sweep was successful.

Parameters:
sweepDMT.core.sweep.Sweep

Sweep that has been simulated.

Raises:
NotImplementedError

If the Dut is not a simulatable dut.

SimulationUnsuccessful

If the simulation output is not valid.

FileNotFoundError

If the sim log file does not exist.