CSIM
SPICE-like Circuit Simulator, for Transient Analysis, DC/AC Sweep and Operating Point Analysis
Install / Use
/learn @cassuto/CSIMREADME
CSIM
This is a SPICE-like analog circuit simulator, for DC/AC Sweep and Transient (time-domain) analysis.
It mainly supports the following device models:
- BSIM3v3.2 (MOSFET Model)
- CCCS (Current Controlled Current Source)
- CCVS (Current Controlled Voltage Source)
- VCCS (Voltage Controlled Current Source)
- VCVS (Voltage Controlled Voltage Source)
- DC and AC voltage and current sources
- Resistor
- Capacitor
- Inductor
- PN Junction
- and more (by the dynamic link library loader)
And the following sweep methods:
- Linear
- Decade
- Octave
- Logarithm
What I have done:
- MNA (Modified Nodal Analysis) with Newton-Raphson iteration
- GEAR numerical integration
- LU decomposition
- HSPICE-like model parser
- Some unit tests
TODO:
- CLI/GUI Frontend
- Improve the sparse matrix algorithm
- Parallel computing acceleration (with GPU)
- Mixed digital domain (with Verilator, IcarusVerilog, etc.)
Guides
Build
Build unit tests with code coverage:
- mkdir build && cd build
- cmake .. -Denable_testcases=ON -Denable_coverage=ON -DCMAKE_BUILD_TYPE=Debug
- make -j
Run
Running tests with code coverage:
- make coverage
The result will be reported in build/coverage.html
Running tests without coverage:
- make check
or
- export LD_LIBRARY_PATH=`pwd`
- ./tstall
API document
Generating documents:
Before that, Doxygen needs to be installed. If not, rerun cmake after the installation.
- make docs
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
