Skip to content

sagasm/cspice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSPICE

A simple SPICE in C/C++

(C) 2010 Andrew Liu (C) 2010 Stimim Chen

Compile

Tools like lex and yacc are used in parsing, please install flex' and bison'. Simply just `make', tested on 32/64bit GNU/Linux.

Usage

  cspice [NETLIST] [PLOT]

The output format is a gnuplot setting file, using `gnuplot [PLOT]' to plot the output of simulation. For more information of gnuplot, please check the website (http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.2/).

Support elements and simulations

Support elements

Resistor, Inductor, Capacitor, Voltage Control Current Source, Voltage source input, Current source input

Support simulations

Transient response, Frequency response

Netlist format

  # Elements
  V[ID] [NODE1] [NODE2] [VALUE] # Voltage source
  I[ID] [NODE1] [NODE2] [VALUE] # Current source
  R[ID] [NODE1] [NODE2] [VALUE] # Resistor
  L[ID] [NODE1] [NODE2] [VALUE] # Inductor
  C[ID] [NODE1] [NODE2] [VALUE] # Capacitor
  G[ID] [NODE1] [NODE2] [NODE3] [NODE4] [VALUE]
  # VCCS: (V3-V4) = (VALUE) * (V1 - V2)

  # Simulations
  FREQ  [START] [END] [STEP] [SRC] [OUTPUT] # Frequency response
  TIME  [START] [END] [STEP] [OUTPUT]       # Transient response

About

A simple spice in C/C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 78.8%
  • Lex 12.3%
  • Yacc 6.8%
  • Makefile 2.1%