I’ve spent a fair amount of time recently troubleshooting a system simulation from a prospective customer. It’s always an interesting, and sometimes frustrating, process.
Fixing simulations can be slow going work. Simulation error messages are often cryptic at best, and the customer’s system is sometimes based on a technology that I know little about. Despite these challenges, however, there are useful yet general simulation troubleshooting methods that can help in almost any situation. Here are a few techniques I use to troubleshoot simulations.
First and foremost, it pays to double-check, and even triple-check, the connections in your circuit, particularly if it has more than a handful of components. It’s even worthwhile to have a colleague take a look at your work with a fresh pair of eyes. I’ve spent hours staring at a schematic trying to figure out why it isn’t simulating right, only to find I have a couple of nets crossed or components wired backwards – even after double- and triple-checking my circuit connections.
Along with making sure your system is wired correctly, ensure you don’t have any mismatched connections. This may not be an issue if you’re working on a single technology system (think electrical circuit), but in a mechatronic system containing a mix of technologies, it’s easy to connect pins of unmatched technologies – say an electrical pin on one component connected to a mechanical pin on another. In earlier posts I’ve written about VHDL-AMS being a strongly typed language, where model ports must have an assigned technology nature. This is one of the key features of VHDL-AMS that make it such a strong and capable language for mechatronic system modeling. But it’s also a feature that can cause problems when connecting schematic components together.
If you are sure your system is wired correctly, and you don’t have any mismatched pin connections, but you’re still getting simulation errors, analyzing the circuit netlist should be your next stop for investigating problems. When reviewing the netlist, you are seeing exactly what your simulator sees, and your netlist should exactly match your schematic. Studying your netlist can highlight problems that may not be obvious at the schematic level. Simulation error messages should at least give you a general idea of where in your netlist to look for problems, and what to look for.
At this point, if simulation problems persist, it’s time to start simplifying your schematic, particularly if your system is complex – either in the number of components or in its function. Divide your schematic into smaller, individually simulatable, subsystem blocks. Make sure that each subsystem simulates without errors. Once you know each subsystem works, start connecting them together, one or two at a time, until your entire system is back together. If your simulator reports errors along the way, you will have a better idea of where to look to troubleshoot the problem.
Troubleshooting system simulations can be grueling work, and progress is often slow. Using a systematic troubleshooting approach, however, will help you find better simulation solutions in a shorter time.