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@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
Andy Peters wrote: > On Sep 26, 2007, at 5:05 PM, Dan McMahill wrote: > >> That can get you closer. You probably don't want to build a complete >> model for a microcontroller in verilog to the point of being able >> to run >> the same firmware image as the real hardware, but you probably could. > > While it's a pretty simple processor, I've simulated designs with > Xilinx Picoblaze processors including the firmware. worked well > enough. Anything more complex could get slow and ugly. That's promising. I'm thinking of just a bit of code that gives a bitwise accurate model of the datastream, matching to the timing of the analog model in gnucap as test benches do in logic models. Just to test out your combination of sigma delta front end quantizer and numerical filter together, for instance. for "sensorless" motor control and such. John Griessen -- Ecosensory Austin TX ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
Andy Peters wrote: > On Sep 26, 2007, at 5:05 PM, Dan McMahill wrote: > > >> That can get you closer. You probably don't want to build a complete >> model for a microcontroller in verilog to the point of being able >> to run >> the same firmware image as the real hardware, but you probably could. >> I've written functional simulation for various digital logic in the past (vhdl, but applies to verilog too). It was just enough code to excercise the IO, and it was simple to write commands to do writes and reads then watch as the stuff responded. Made a great tool for debugging since the schematic used for simulation was the same as that used for pcb design. Now, if the simulator could couple IBIS models and synchronize the digital and analog simulations - that would be sweet! gene ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
On Sep 26, 2007, at 5:05 PM, Dan McMahill wrote: > That can get you closer. You probably don't want to build a complete > model for a microcontroller in verilog to the point of being able > to run > the same firmware image as the real hardware, but you probably could. While it's a pretty simple processor, I've simulated designs with Xilinx Picoblaze processors including the firmware. worked well enough. Anything more complex could get slow and ugly. -a ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
On 9/26/07, John Griessen <[EMAIL PROTECTED]> wrote: > John Doty wrote: > . > Wouldn't it be nice to be able to use a model of some of the micro's inouts > that is 2-way connected with a math model in Mathomatic, Octave, Mathematica? > For modeling some DSP being done with the HW multiply in a MSP430 for > instance. > Wouldn't that make the simulation really slow? -- http://www.coe.neu.edu/~efoss/ http://evanfoss.googlepages.com/ ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
John Griessen wrote: > 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. > > > >> 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. > > Wouldn't it be nice to be able to use a model of some of the micro's inouts > that is 2-way connected with a math model in Mathomatic, Octave, Mathematica? > For modeling some DSP being done with the HW multiply in a MSP430 for > instance. m Verilog-AMS. That can get you closer. You probably don't want to build a complete model for a microcontroller in verilog to the point of being able to run the same firmware image as the real hardware, but you probably could. ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
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. > 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. Wouldn't it be nice to be able to use a model of some of the micro's inouts that is 2-way connected with a math model in Mathomatic, Octave, Mathematica? For modeling some DSP being done with the HW multiply in a MSP430 for instance. John Griessen -- Ecosensory Austin TX ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
Re: gEDA-user: ngspice simulation with microcontrollers
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. > 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 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. > > Thanks very much in advance, > > -- > Amos Tibaldi > > > ___ > geda-user mailing list > geda-user@moria.seul.org > http://www.seul.org/cgi-bin/mailman/listinfo/geda-user John Doty Noqsi Aerospace, Ltd. http://www.noqsi.com/ [EMAIL PROTECTED] ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
gEDA-user: ngspice simulation with microcontrollers
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? 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? Thanks very much in advance, -- Amos Tibaldi ___ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user