kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #40245
Re: XSPICE code models in the simulator
Hi Dmitry,
You probably want to start by looking at the netlist exporter:
./eeschema/netlist_exporters/netlist_exporter_pspice.cpp
I think much of what you are looking for is in that class.
Best,
Jon
On Tue, Apr 23, 2019 at 3:53 AM Dmitry Salychev <darkness.bsd@xxxxxxxxx>
wrote:
> Hi list.
>
> KiCad uses NGSpice as a simulation engine, and NGSpice has an extension
> called XSPICE which allows to create/program SPICE models in C.
>
> Could you briefly explain what should I start looking at in KiCad to
> generate a correct netlist for NGSpice to be able to use custom code
> models?
>
> I'm asking because there is a little effort of mine [1] to provide code
> models for 8-bit AVR RISC microcontrollers. There is a simulation of a
> simple ATmega8A-based circuit available [2] to give you an idea how it
> looks like. The circuit itself is drawn in KiCad, but I had to use NGSpice
> and mcusim.cm to manually create a netlist [3] to obtain a plot.
>
> Thanks for any help.
>
> Regards,
> Dmitry
>
> [1] https://github.com/mcusim/MCUSim
> [2]
> https://raw.githubusercontent.com/mcusim/MCUSim/master/examples/ATMEGA8A-pwm-to-sine/ngspice-simulation.png
> [3]
> https://github.com/mcusim/MCUSim/blob/master/examples/ATMEGA8A-pwm-to-sine/pwm-to-sine.cir
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References