For novel ideas about building embedded systems (both hardware and firmware), join the 35,000 engineers who subscribe to The Embedded Muse, a free biweekly newsletter. The Muse has no hype and no vendor PR. Click here to subscribe.
By Jack Ganssle
Is it live, or is it Memorex?
Firmware people are scum.
At least, that's the way we're treated. The hardware will be late. It's always late. And then we're supposed to make up the schedule?
At best it's very hard to seriously test the code till the hardware is ready. So developers come up with a variety of schemes to do some level of testing before the EEs release finished PCBs. Maybe one can use a previous iteration of the product that shares much of the same I/O as the new version. Or use a CPU vendor's evaluation board, which might have only ten or twenty percent commonality with our product. but is at least a start.
Then there's simulation. For decades vendors have touted various simulators. Most were just awful. Few ever garnered much market share. Even fewer developers take simulation seriously, having been burned by too many promises and too little performance.
I've played with Keil's 8051 simulator, which is the first I've seen that accurately and easily handles both the CPU and the part's many varied peripherals.
Now the operative word is "virtualization," which means abstracting out the physical aspects of computing using software. To us embedded heads that's still simulation.
Recently Virtutech (www.virtutech.com) sent me a demo of their simulation/virtualization product called "Simics," which promises an environment so faithful to reality that the application can't tell whether it's running live. or on the simulator. And the demo is seriously cool.
Like many of us I use VMware (another virtualization environment that's free from www.vmware.com) on my main Windows machine to run Linux. That by itself is pretty amazing. VMware harnesses the awesome and usually neglected power of the Pentium to create a new virtual machine on the PC. (I think the Pentium's 3GHz processing is used mostly to wait for keypresses and download Windows updates). It's fun to watch Linux boot in its own Windows window. The simulation is so accurate that the filesystems aren't shared; one uses networking utilities to move files between Windows and Linux.
Simics runs under Linux, so I started Debian up in the VMware window. Then, under Debian, I fired up Simics. Within that environment I then started MontaVista Linux.
So MontaVista was simulated by Simics, running on top of Debian which VMware simulated under Windows. Amazingly, the performance was pretty reasonable.
Simics makes no attempt to be cycle-accurate. It's an environment aimed at software developers, to help us get our code running on virtualized hardware. Libraries offer a large number of standard simulated peripherals, and a sort of macro-language lets one fairly-easily build models of other I/O devices. Since the entire environment is virtual, it can even run backwards in time (like Green Hills' TimeMachine).
Virtutech is hardly alone. VaST, CoWare, and Synopsys/Virtio, for instance, offer similar approaches.
Simulation is no panacea. Costs can be high. But the idea is intriguing and now, after decades of vendor promises, actually works. One agony I'm hearing more often in recent years is from developers who no longer have access to development platforms since the hardware became obsolete. yet they still have to maintain a product. Some stuff a complete development system in a closet, ready to be resurrected when needed. But components do go bad; electrolytic caps, for instance, dry out over the years. Simulated hardware never ages or fails.
What do you think? What's the future for simulation in your environment?