Re: System simulation
Thomas Lundin <[email protected]>
| Newsgroups | gmane.comp.gnu.gnucap.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Scott, > KTechLab implements a system simulator... sort of. It's not a full blown > extensible simulator like gnucap but it does combine Microcontroller > simulation with analog simulation. For the microcontroller simulation, > KTechLab uses gpsim. > It seams like KtechLab has hibernated. The site is down and according to Wikipedia it sounds rather final. The sources are laying around so I can try it but I'm a bit hesitant to before I know if its maintained or not. Pity, sounds very promising. > Since both gpsim and gnucap support a concept of plugins then > theoretically one could be plugged into the other. I don't know exactly > how gnucap implements the simulation model, but I'm certain it's different > than gpsim! So there would have to be some work to merge the two. > My though was that it looked fairly easy, that most work done in both gnucap and any MCU simulator with I/O control. You can already run gnucap for a MCU clockcyle, probe all the inputs then go another clock cycle and probe again. To me it looks like a way to arbitrarily set a digital output in gnucap would be the only gnucap work, and some interface code in the MCU sim to fetch and set the I/O pins through a simple pipe. snip! > My system simulations are tailored to firmware development. There are many > things that I can test and develop in a simulation environment. For > example, I've created behavioral models of the RF ID transmitters. I can > instantiate these in a gpsim simulation and evaluate how well my RF > receiver can tolerate a variety of corner case anomalies like slow > transmitter clocks, single bit errors, bit burst errors, etc. At the same > time I can simulate switches, and LCD display, LEDs, an RS232 interface, > etc. My gpsim configuration script is a couple hundred lines long > sometimes! But I've uncovered all sorts of weird bugs over the last few > years that would have been extremely difficult to capture with just an ICD > (or with MPLAB). This is what exactly what I'm looking. Both running the full system interactively and being able to set up a test-bench and sweep a number of parameters to catch those strange parameter-combination bugs that appear way to often. Let it be that it has to run over night when the number of parameters increases. > > There are times I've wish gpsim had an even more accurate analog > simulator. For example, the sort of sigma delta style 1-pin A2D converter > found: > > http://www.dattalo.com/technical/software/software.php > http://www.dattalo.com/technical/software/pic/a2d.asm > > If gpsim had accurate I/O pin models then I could better predict the > behavior of this example. Furthermore I could possibly optimize it and > evaluate it over corner cases. > I can imagine that you get quite far with what you've done in gpsim (was quite some time since I used it in a project), and it's a huge improvement to just software simulation. But I also see a lot cases that would require more accurate analog simulation. Thomas