|
KiCad PCB EDA Suite
|
#include <spice_simulator.h>
Public Member Functions | |
| SPICE_SIMULATOR () | |
| virtual | ~SPICE_SIMULATOR () |
| virtual void | Init (const SPICE_SETTINGS *aSettings=nullptr)=0 |
| virtual bool | LoadNetlist (const std::string &aNetlist)=0 |
| Load a netlist for the simulation. | |
| virtual bool | Command (const std::string &aCmd)=0 |
| Execute a Spice command as if it was typed into console. | |
| virtual wxString | GetXAxis (SIM_TYPE aType) const =0 |
| virtual void | SetReporter (SIMULATOR_REPORTER *aReporter) |
| Set a SIMULATOR_REPORTER object to receive the simulation log. | |
| virtual wxString | CurrentPlotName () const =0 |
| virtual std::vector< std::string > | AllVectors () const =0 |
| virtual std::vector< COMPLEX > | GetComplexVector (const std::string &aName, int aMaxLen=-1)=0 |
| Return a requested vector with complex values. | |
| virtual std::vector< double > | GetRealVector (const std::string &aName, int aMaxLen=-1)=0 |
| Return a requested vector with real values. | |
| virtual std::vector< double > | GetImaginaryVector (const std::string &aName, int aMaxLen=-1)=0 |
| Return a requested vector with imaginary values. | |
| virtual std::vector< double > | GetGainVector (const std::string &aName, int aMaxLen=-1)=0 |
| Return a requested vector with magnitude values. | |
| virtual std::vector< double > | GetPhaseVector (const std::string &aName, int aMaxLen=-1)=0 |
| Return a requested vector with phase values. | |
| virtual const std::string | GetNetlist () const =0 |
| Return current SPICE netlist used by the simulator. | |
| virtual std::vector< std::string > | GetSettingCommands () const =0 |
| std::shared_ptr< SPICE_SETTINGS > & | Settings () |
| Return the simulator configuration settings. | |
| const std::shared_ptr< SPICE_SETTINGS > & | Settings () const |
| std::mutex & | GetMutex () |
| virtual bool | Attach (const std::shared_ptr< SIMULATION_MODEL > &aModel, const wxString &aSimCommand, unsigned aSimOptions, const wxString &aInputPath, REPORTER &aReporter) |
| Point out the model that will be used in future simulations. | |
| virtual bool | Run ()=0 |
| Execute the simulation with currently loaded netlist. | |
| virtual bool | Stop ()=0 |
| Halt the simulation. | |
| virtual bool | IsRunning ()=0 |
| Check if simulation is running at the moment. | |
| virtual void | Clean ()=0 |
| Cleans simulation data (i.e. | |
Static Public Member Functions | |
| static wxString | TypeToName (SIM_TYPE aType, bool aShortName) |
| Return a string with simulation name based on enum. | |
| static std::shared_ptr< SPICE_SIMULATOR > | CreateInstance (const std::string &aName) |
Protected Attributes | |
| std::atomic< SIMULATOR_REPORTER * > | m_reporter |
| < Reporter object to receive simulation log (not owned, accessed from BG threads). | |
| std::shared_ptr< SPICE_SETTINGS > | m_settings |
| std::shared_ptr< SIMULATION_MODEL > | m_simModel |
| < Model that should be simulated. | |
Private Attributes | |
| std::mutex | m_mutex |
| < For interprocess synchronisation. | |
Definition at line 48 of file spice_simulator.h.
|
inline |
Definition at line 51 of file spice_simulator.h.
References m_reporter, m_settings, and SIMULATOR::SIMULATOR().
|
inlinevirtual |
Definition at line 57 of file spice_simulator.h.
|
pure virtual |
Implemented in NGSPICE.
|
inlinevirtualinherited |
Point out the model that will be used in future simulations.
Reimplemented in NGSPICE.
Definition at line 61 of file simulator.h.
References m_simModel.
Referenced by NGSPICE::Attach().
|
pure virtualinherited |
|
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.
Referenced by SIMULATOR_FRAME_UI::applyTuners(), SIMULATOR_FRAME_UI::applyUserDefinedSignals(), SIMULATOR_FRAME_UI::DoFourier(), SIMULATOR_FRAME_UI::onPlotChanged(), SIMULATOR_FRAME_UI::OnSimRefresh(), SIMULATOR_FRAME_UI::UpdateMeasurement(), and SIMULATOR_FRAME_UI::updateTrace().
|
staticinherited |
Definition at line 33 of file spice_simulator.cpp.
References DisplayError().
Referenced by KIBIS_PIN::getKuKdFromFile(), and SIMULATOR_FRAME::SIMULATOR_FRAME().
|
pure virtual |
Implemented in NGSPICE.
Referenced by SIMULATOR_FRAME_UI::OnSimRefresh().
|
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 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.
Referenced by SIMULATOR_FRAME_UI::UpdateMeasurement(), and SIMULATOR_FRAME_UI::updateTrace().
|
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.
|
inlineinherited |
Definition at line 51 of file simulator.h.
References m_mutex.
|
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.
Referenced by SIMULATOR_FRAME_UI::updateTrace().
|
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.
Referenced by SIMULATOR_FRAME_UI::OnSimRefresh().
|
pure virtual |
Implemented in NGSPICE.
|
pure virtual |
Implemented in NGSPICE.
|
pure virtual |
Implemented in NGSPICE.
|
pure virtualinherited |
Check if simulation is running at the moment.
Implemented in NGSPICE.
|
pure virtual |
Load a netlist for the simulation.
Implemented in NGSPICE.
|
pure virtualinherited |
Execute the simulation with currently loaded netlist.
Implemented in NGSPICE.
|
inlinevirtual |
Set a SIMULATOR_REPORTER object to receive the simulation log.
The reporter is accessed from ngspice background threads via atomic snapshot. Callers must ensure the reporter outlives any running simulation, or call SetReporter(nullptr) and stop the simulation before destroying the reporter.
Definition at line 91 of file spice_simulator.h.
References m_reporter.
Referenced by TEST_NETLIST_EXPORTER_SPICE_FIXTURE::CompareNetlists().
|
inline |
Return the simulator configuration settings.
Definition at line 176 of file spice_simulator.h.
References m_settings.
Referenced by NGSPICE::GetSettingCommands(), SIMULATOR_FRAME_UI::InitWorkbook(), SIMULATOR_FRAME_UI::LoadWorkbook(), and SIMULATOR_FRAME_UI::SaveWorkbook().
|
inline |
Definition at line 178 of file spice_simulator.h.
References m_settings.
|
pure virtualinherited |
|
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 53 of file spice_simulator.cpp.
References _, ST_AC, ST_DC, ST_DISTO, ST_FFT, ST_NOISE, ST_OP, ST_PZ, ST_SENS, ST_SP, ST_TF, ST_TRAN, and ST_UNKNOWN.
Referenced by BOOST_AUTO_TEST_CASE(), DIALOG_SIM_COMMAND::OnCommandType(), DIALOG_SIM_COMMAND::parseCommand(), SIMULATOR_FRAME_UI::SaveWorkbook(), and SIMULATOR_FRAME_UI::UpdateMeasurement().
|
privateinherited |
< For interprocess synchronisation.
Definition at line 102 of file simulator.h.
Referenced by GetMutex().
|
protected |
< Reporter object to receive simulation log (not owned, accessed from BG threads).
We don't own this. We are just borrowing it from the SCHEMATIC_SETTINGS.
Definition at line 192 of file spice_simulator.h.
Referenced by NGSPICE::cbBGThreadRunning(), NGSPICE::cbControlledExit(), NGSPICE::cbSendChar(), NGSPICE::IsRunning(), SetReporter(), and SPICE_SIMULATOR().
|
protected |
Definition at line 195 of file spice_simulator.h.
Referenced by Settings(), Settings(), and SPICE_SIMULATOR().
|
protectedinherited |
< Model that should be simulated.
Definition at line 98 of file simulator.h.
Referenced by Attach(), and SIMULATOR().