[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: ngspice simulation with microcontrollers



On Wednesday 26 September 2007, John Doty wrote:
> On Sep 25, 2007, at 1:03 AM, Amos Tibaldi wrote:
> > Hello,
> >  I write this mail in order to obtain help if possible for
> > the use of the ngspice simulator. How can I simulate the
> > behaviour of a microcontroller that is present in the
> > schematic of a circuit with ngspice?
>
> Basically, you can't.
>
> What I do in these situations is substitute voltage sources
> for the microcontroller output pins and generate PWL stimuli
> for them. Put probes where the inputs would be, .PRINT those
> voltages, and use an AWK or C program to extract bits from
> the recorded voltages. Of course, that's a one-way data flow:
> if you really want the microcontroller to participate, you
> can't do it that way. What I think you want is very
> difficult, and likely impractical.

That's one way.  Given the tools we have, the only way that 
works.

Amos, I am curious what you want to accomplish.  Do you want a 
complete simulation of a system containining a microprocessor?  
If so, Spice, or anything Spice-like, is not for you.

Do you want to simulate the analog portion of a circuit that 
connects to a pin on the micro?  That's what John's approach 
will do.

What are you using for a model of the micro?  With our tools, 
the only one we have is John's approach.  With some commercial 
products, an IBIS model might be the answer.
>
> > In the netlist there is a row starting for example with U3
> > but I don't know how to implement its behaviour in a way
> > that the ngspice simulation considers it. I have seen in
> > the gEDA Suite GUI that there is a row with written "Chip
> > programs" that has leafs verilog .v files. May be that is
> > the way? But in such a case how can I inform ngspice to use
> > the verilog listing?

Perhaps you want a digital Verilog simulator instead?  How about 
Icarus Verilog?

> Perhaps Al will chime in about gnucap: I suppose you could
> write some sort of plugin that allows the program you'd run
> in the microcontroller to interact in an event-driven way
> with an analog sim.

For now, it's the same as Spice.

The plugin system is developed enough now to allow more people 
to get involved with development.  I see plugins coming to do 
things like other languages, and other kinds of models.

Eventually, I see plugins that will do things like Verilog-AMS 
behavioral models, interface to Icarus Verilog, interface to 
GHDL, interface to octave, IBIS, etc..  That's not ready yet.

You could write a plugin to do something very specific, but it 
isn't practical yet.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user