![]() |
KiCad PCB EDA Suite
|
#include <spice_simulator.h>
Public Member Functions | |
SPICE_SIMULATOR () | |
virtual | ~SPICE_SIMULATOR () |
Create a simulator instance of particular type (currently only ngspice is handled) More... | |
virtual void | Init (const SPICE_SIMULATOR_SETTINGS *aSettings=nullptr)=0 |
virtual bool | LoadNetlist (const std::string &aNetlist)=0 |
Load a netlist for the simulation. More... | |
virtual bool | Run ()=0 |
Execute the simulation with currently loaded netlist. More... | |
virtual bool | Stop ()=0 |
Halt the simulation. More... | |
virtual bool | IsRunning ()=0 |
Check if simulation is running at the moment. More... | |
virtual bool | Command (const std::string &aCmd)=0 |
Execute a Spice command as if it was typed into console. More... | |
virtual std::string | GetXAxis (SIM_TYPE aType) const =0 |
Set a SPICE_REPORTER object to receive the simulation log. More... | |
virtual void | SetReporter (SPICE_REPORTER *aReporter) |
virtual std::vector< std::string > | AllPlots () const =0 |
Return a list with all vectors generated in current simulation. More... | |
virtual std::vector< COMPLEX > | GetPlot (const std::string &aName, int aMaxLen=-1)=0 |
Return a requested vector with complex values. More... | |
virtual std::vector< double > | GetRealPlot (const std::string &aName, int aMaxLen=-1)=0 |
Return a requested vector with real values. More... | |
virtual std::vector< double > | GetImagPlot (const std::string &aName, int aMaxLen=-1)=0 |
Return a requested vector with imaginary values. More... | |
virtual std::vector< double > | GetMagPlot (const std::string &aName, int aMaxLen=-1)=0 |
Return a requested vector with magnitude values. More... | |
virtual std::vector< double > | GetPhasePlot (const std::string &aName, int aMaxLen=-1)=0 |
Return a requested vector with phase values. More... | |
virtual const std::string | GetNetlist () const =0 |
Return current SPICE netlist used by the simulator. More... | |
virtual std::vector< std::string > | GetSettingCommands () const =0 |
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > & | Settings () |
Return the simulator configuration settings. More... | |
const std::shared_ptr< SPICE_SIMULATOR_SETTINGS > & | Settings () const |
Static Public Member Functions | |
static std::shared_ptr< SPICE_SIMULATOR > | CreateInstance (const std::string &aName) |
static wxString | TypeToName (SIM_TYPE aType, bool aShortName) |
Return a string with simulation name based on enum. More... | |
Protected Attributes | |
SPICE_REPORTER * | m_reporter |
< Reporter object to receive simulation log. More... | |
std::shared_ptr< SPICE_SIMULATOR_SETTINGS > | m_settings |
Definition at line 45 of file spice_simulator.h.
|
inline |
Definition at line 48 of file spice_simulator.h.
|
inlinevirtual |
Create a simulator instance of particular type (currently only ngspice is handled)
Definition at line 53 of file spice_simulator.h.
|
pure virtual |
Return a list with all vectors generated in current simulation.
Implemented in NGSPICE.
|
pure virtual |
Execute a Spice command as if it was typed into console.
aCmd | is the command to be issued.Return X axis name for a given simulation type |
Implemented in NGSPICE.
|
static |
Definition at line 30 of file spice_simulator.cpp.
References DisplayError().
Referenced by SIM_PLOT_FRAME::SIM_PLOT_FRAME().
|
pure virtual |
Return a requested vector with imaginary values.
If the vector is complex, then the imaginary part is returned. If the vector is reql, then only zeroes are returned.
aName | is the vector named in Spice convention (e.g. V(3), I(R1)). |
aMaxLen | is max count of returned values. if -1 (default) all available values are returned. |
Implemented in NGSPICE.
|
pure virtual |
Return a requested vector with magnitude values.
aName | is the vector named in Spice convention (e.g. V(3), I(R1)). |
aMaxLen | is max count of returned values. if -1 (default) all available values are returned. |
Implemented in NGSPICE.
|
pure virtual |
|
pure virtual |
Return a requested vector with phase values.
aName | is the vector named in Spice convention (e.g. V(3), I(R1)). |
aMaxLen | is max count of returned values. if -1 (default) all available values are returned. |
Implemented in NGSPICE.
|
pure virtual |
Return a requested vector with complex values.
If the vector is real, then the imaginary part is set to 0 in all values.
aName | is the vector named in Spice convention (e.g. V(3), I(R1)). |
aMaxLen | is max count of returned values. if -1 (default) all available values are returned. |
Implemented in NGSPICE.
|
pure virtual |
Return a requested vector with real values.
If the vector is complex, then the real part is returned.
aName | is the vector named in Spice convention (e.g. V(3), I(R1)). |
aMaxLen | is max count of returned values. if -1 (default) all available values are returned. |
Implemented in NGSPICE.
|
pure virtual |
Implemented in NGSPICE.
|
pure virtual |
Set a SPICE_REPORTER object to receive the simulation log.
Implemented in NGSPICE.
|
pure virtual |
Implemented in NGSPICE.
|
pure virtual |
Check if simulation is running at the moment.
Implemented in NGSPICE.
|
pure virtual |
Load a netlist for the simulation.
Implemented in NGSPICE.
|
pure virtual |
Execute the simulation with currently loaded netlist.
Implemented in NGSPICE.
|
inlinevirtual |
Definition at line 105 of file spice_simulator.h.
References m_reporter.
|
inline |
Return the simulator configuration settings.
Definition at line 187 of file spice_simulator.h.
References m_settings.
Referenced by NGSPICE::GetSettingCommands().
|
inline |
Definition at line 189 of file spice_simulator.h.
References m_settings.
|
pure virtual |
|
static |
Return a string with simulation name based on enum.
aType | is the enum describing simulation type |
aShortName | if true - return is in format "TRAN", "OP". if false - return is in format "Transient", "Operating Point". |
Definition at line 50 of file spice_simulator.cpp.
References _, ST_AC, ST_DC, ST_DISTORTION, ST_NOISE, ST_OP, ST_POLE_ZERO, ST_SENSITIVITY, ST_TRANS_FUNC, ST_TRANSIENT, and ST_UNKNOWN.
|
protected |
< Reporter object to receive simulation log.
We don't own this. We are just borrowing it from the SCHEMATIC_SETTINGS.
Definition at line 203 of file spice_simulator.h.
Referenced by NGSPICE::cbBGThreadRunning(), NGSPICE::cbSendChar(), and SetReporter().
|
protected |
Definition at line 206 of file spice_simulator.h.
Referenced by Settings().