C++ Simulation with Linear Nodal Analysis and Verilog® Modules Using Verilator
Icarus Verilog® Simulation with Linear Nodal Analysis and C++ Modules
Spice Simulation to Support System Level Modeling in CppSim/VppSim
View the frequently asked questions
About the developer of CppSim
Q: What is the best way to get started once I install CppSim?
A: Read the CppSim/VppSim Primer
Q: What if NGspice has trouble running in Windows?
A: Some computers require installation of the Microsoft Visual C++ 2008 Redistributable Package (x86) in order to run NGspice. This is a small set of DLL files, and is easily downloaded and installed directly from Microsoft's website at:
Q: I created a new schematic in Sue2 and it did not seem to save - what happened?
A: There is a bug in Sue2 such that new schematics are sometimes saved in the wrong directory. The directory for .sue schematics should always be in SueLib/Library_Name, but sometimes it saves instead to SueLib. You simply need to move the file back into SueLib/Library_Name using the Windows Browser. This bug will be corrected in the future.
Q: I created a new library in Sue2 and it has disappeared - what happened?
A: There is a bug in Sue2 such that new libraries must have at least one module in them in order to appear within Sue2. When you create a new library, but sure to place at least one module inside of it.
Q: I imported my CppSim library into a different platform (i.e., Mac instead of Windows), and now Verilator seems to get stuck?
A: Verilator output is not platform independent, so you need to erase directories named verilator_* within the CppSim/SimRuns/Library_name/Module_name directory and then re-run CppSim.
Q: I am including circuit elements for linear nodal analysis, and the waveforms look incorrect. What went wrong?
A: CppSim inverts a matrix corresponding to the nodal network, and problems arise if that matrix ends up being close to singular. In such case, a warning message appears in the CppSim Run Window that states something like
electrical cluster '_____'
may not have an accurate solution due to numerical issues
---> The following elements are in this electrical cluster: ...
CppSim deals with the above by truncating the lowest singular values (and corresponding vectors) within the SVD representation of the matrix which is inverted. If you cannot alter your circuit to improve this issue, then another thing to try is to change the line
#define INV_DP_SV_L 1E-20
#define INV_DP_SV_L 1E-28
within the cppsim_classes.h file within directory CppSim/CppSimShared/CommonCode. In doing the above change, you are increasing the allowed spread in singular values before truncation occurs. The risk you take is that all the singular values will remain, but some will be corrupt and there will be no warning message.