6647a05380e12ce93428cc40 Bob Pease Computer Toss 000026

What’s All This Spicey Stuff, Anyhow? (Part 2.5)

Sept. 7, 2012
In this lost chapter in his long series of SPICE tirades Bob explains why you always need to verify your circuit designs on a breadboard, not just in Spice.

This is a continuation in the series from Part II, here.

First, Let’s have an esaeP’s Fable: A person (when I tell the story, I always say it was a Harvard graduate, but you can insult anybody you think is appropriate…) had died and was wandering through Limbo and Purgatory. He came to two paths with two signs. One sign pointed “To Heaven.” The other sign said “To a Lecture On Heaven.” So of course he decided to go to the Lecture On Heaven. End of Fable.

I was at an Evening Panel Session of the International Solid-State Circuits Conference (ISSCC) in February. Some engineers were talking about CAD—Computer-Aided Design—and its importantance in their work. They said that they got so wrapped up in their CAD that they almost forgot what their mission was. Was their mission to use CAD tools to build perfect circuits on the first silicon—no matter how long it takes to get all of the perfect answers from the CAD? NO! Their mission was to build good circuits quickly and with low cost.

If they used their CAD tools until they were convinced the layout and design were perfect, that might take months. But if they thought their layout and design were pretty good, they could go into a fab and get silicon in three weeks. Then they would really find out if their design was good. It’s easy to get tricked into following the path leading to the Lecture On Heaven. But, where is it that you’re really trying to go?

One of the things I do in my spare time here at National is to serve on the Patent Committee. About one morning a month, several of us engineers get together and review the patent proposals and Invention Disclosures. We try to encourage the good ones, and we grouse about the people who bring them in late. A couple of years ago, one of the inventors gave us a neat explanation of his new circuit that featured greatly improved frequency response. I looked at it. I waited patiently while he explained how well it worked, under all worst-case conditions. Then, I must admit, I pounced. “There’s just one problem, my friend. That circuit will not work at all.” He showed consternation on his face. “But I evaluated it thoroughly…” I broke in, “Yeah, in Spice.” He blanched. “How did you know? Yes, I evaluated it in Spice, and it worked perfectly.”

I told him that was just the problem. When you get a circuit perfectly balanced in Spice, it will stay perfectly balanced. Just like inverting the Great Pyramid and perching it on its tip. In Spice, that will stay balanced forever. But in the real world, it will fall over, even without waiting for a windy day. That was the first weakness of his circuit. I asked him, “If you take an operational amplifier with a dc gain of a million, and an offset voltage of 2 mV, and you put a 1-V ac signal right into its input and ask Spice to tell you the dc gain, what will it give you for an answer?” He thought and said, “It will tell you the gain is 1 million.” I agreed, that’s what Spice will say, but in the real world you can’t evaluate an op amp by feeding a volt right into the negative input. And in his circuit, which called for two perfectly matched and balanced stages, you could ask Spice to give you an answer. Spice might give you an answer, but that answer is NOT the real one. Spice is sometimes incapable of telling you what will really happen at a circuit’s output.

Later, I gave the would-be inventor some tips, and suggested he bring the circuit back to the Patent Committee if he could get it working on a breadboard—not just on Spice alone. Unfortunately, I haven’t seen the fellow since then. I’m not even sure where he is these days. But at least I saved him the embarrassment of getting a big circuit made up and discovering the silicon doesn’t work, and couldn’t ever be made to work. If you just trust Spice, and don’t verify with a breadboard (or a good sharp-pencil analysis), that can get you into real trouble when Spice gives you answers that don’t have any foundation in the real world. “Proverai no Doverai”—Trust, but Verify.

But you don’t have to take just the word of an analog freak like Pease. If your area of expertise is digital circuits, you know about metastability. A latch’s or flip-flop’s output may not be able to make up its mind for a surprisingly long time if the input data is moving at just the wrong time—when you’re CLOCKING it. Metastability is a real problem, but everything that I’ve heard says that Spice can’t model metastability, nor can any other form of CAD simulate that. Is that not still true? Breadboarding is NOT obsolete.

This problem in the digital realm is quite analogous to another analog problem in Spice. If you have an op amp and put feedback around it with the inputs inadvertently crossed, and ask the circuit’s gain, Spice can tell you the op amp’s gain—even though the inputs are reversed and the feedback is positive feedback. So you really can’t count on Spice to even give you a sanity check! Spice can look right at your crossed-up circuit and say that nothing is wrong!

Recently I was talking with a teacher who had a student come up to him, saying very enthusiastically, “Mr. Johnson, I just designed an operational amplifier with a gain of 10 million!” The teacher asked how he had designed it. The student said he had designed one good stage with a gain of 10—and then cascaded seven stages. Of course, it didn’t have a differential input, and it might have terrible offset, drift, and PSRR. But, it did have a gain of 10 million.

And if you tried to apply feedback from the output back to the input, would it work like an op amp? Could you control the gain and the response? The student stopped and thought for a while. He realized he didn’t have a clue. And he didn’t know how to wire it up and do a real evaluation to see how the real circuit would work. He had not developed an understanding of what makes an operational amplifier different from just any old amplifier.

Spice can insulate you, shield you away from an understanding, an appreciation, of what makes a real circuit work. You can now take a circuit in Spice, tweak the parameters—try out all sorts of values of resistors—and get a circuit that is “optimized.” In fact, if you are a really smart programmer, you can program the computer to do it all for you. But Spice doesn’t really UNDERSTAND your circuit—and neither do YOU if you only optimize things that way.

At that ISSCC Evening Panel Session, a member of the audience asked one of the panelists, a university professor, “In your department, what is the ratio of students studying CAD to the number studying circuit design?” The ratio, he estimated, was 25 to 1. I thought that was a shocker. But some panelists thought, hey, no problem, you can learn to drive the Spice and UNIX and CAD tools first, and then learn to design circuits later. They said that, but I don’t think that it’s that simple. It bothers me that designing circuits is considered just a minor, trivial task, an exercise that can be learned later by any good computer jockey. In my experience, there are very few engineers who can design amplifiers (or circuits) worth a darn without lots of experience in amplifier design (or circuit design).

I bet a lot fewer than 1/25 of the students are learning anything about measuring these days—measuring voltages, measuring currents, measuring signals, measuring noise. I’ve gotten letters from readers who explain that at some schools, you can earn your BSEE, and even a master’s degree, by studying just computer-simulated circuits. That’s because they don’t have lab courses anymore—no op amps, no flip-flops, probably not even any gates. There are no CVMs, no VOMs, no scopes—just computers! Everything is simulated. That sure sounds scary to me.

At the ISSCC, there was also an evening session on the topic of Designing Integrated Circuits with Mixed Signals (Analog and Digital). And what the impediments are to making good designs. Some of the panelists said that CAD is making great strides, “and even though we cannot always believe Spice when it says a circuit will work, at least we can believe it when it says a circuit will not work.”I stood up and took the microphone. I asked for a straw vote—how many engineers in the audience had a lot of trouble with the case of a circuit that does work, but Spice said it does not work? About 15% or 20% of the audience held up a hand. They could not easily trust Spice because 20% of the time they had caught it lying about circuits that really do work. I shut up and sat down. But that just confirmed my suspicion that more CAD (even more powerful CAD) isn’t going to be the solution.

For example, every year, I can tell when spring is here: In April, I start getting calls from students who can’t get the LM117 to run on Spice. I tell them that, no, there’s not an error in the schematic. The schematic in the data sheet really is the schematic for an LM117 (just to be sure that Q19 and Q3 and Q7 and Q24 each have 10 emitters). I tell them, hey, don’t feel bad, a lot of other people can’t get the LM117 to run in Spice either. Now someday, if I can get all my other projects cleaned up (that’s supposed to be a joke…), I’ll try to run the LM117 in Spice and see what trouble I get into.

Come to think of it, every time I do a Spice run on a high-powered regulator I’m amused, because the output transistor can run at 1 A and Vce = 20 V, but the Vbe never decreases as time goes on because the circuit never gets hot. If you have a circuit like that, which runs well on Spice, you’re headed for deep trouble when you try to lay it out. That’s because in the actual silicon, the transistors really do get hot. And they heat up the adjacent transistors, with various gradients and isothermal lines. A smart engineer will lay out his critical matched transistors along the isothermal lines. But most CAD systems won’t help you at all with that. Just as a digital designer won’t get any help on metastability problems, designers of high-power linear circuits won’t get help from Spice or from most any CAD system on thermal gradients, isotherms, thermal run-away, or secondary breakdown.

The final proof of the pudding for any circuit is how well does it work in the system. When people design an ASIC, they know there’s only one customer, and the customer’s specifications are very specific. So the engineers and designers use CAD very heavily to confirm that the IC will do exactly what the customer says he wants.

These days, CAD works well enough that about 50% of the ASICs meet their specs on the first try (OK, that’s not a wonderful success rate, but I don’t want to worry about that here). However, of the ASICs that do meet every spec, 20% of them don’t work in the customer’s system. All of the CAD tools in the world—all of the models and computers and number-crunchers and timing diagrams—are worth very little if the chip designer made an error in understanding what his system really needs. Compared to computers (or even some people) that can only follow instructions, people who can think and comprehend the entire system are still worth quite a bit.

Now, some people have asked me, “Bob, why do you keep saying all these terrible things about Spice? When we come out with our Spice models, people will say you have wrecked our credibility. Can’t you say anything nice about Spice?”

I respond: “Ah—that is exactly the point. If I only said good things about Spice, smart engineers would refuse to believe us. We would lose our credibility. This industry already has too many people who can do nothing but say good things about CAD and Spice. What I am doing is drawing attention to specific problem areas of Spice and other CAD told, so that our friends will be educated about problem areas to be aware of.”

Now, it’s true that there are, despite the things I grouse about, some good things I can say about Spice and similar circuit-simulation programs. Primarily, Spice is good for a first estimate of a circuit’s feasibility—as an aid to help you compute how the circuit is likely to work, ideally.

Spice can help you decide what’s a good circuit to breadboard. Then when you have the breadboard running, you want to confirm that the Spice results really are consistent with the breadboard data, so you can cross-check that your models are good. If you have good models, you can use Spice to exercise the system through a first round of worst-case tests, more quickly than with a breadboard. For example, it might be really hard to find any really worst-case op amps, but it might be easier to use Spice models than to do many hand calculations. So, Spice can be a useful tool in the hands of a good engineer, to help him analyze variations on the central theme. It’s only when people start making euphoric statements that breadboarding is passé and superfluous that we get worried. So, why do I keep saying these “terrible” things about Spice? Well, it’s not my fault that it only takes five sentences to say what Spice is generally good for and five pages to list some of the pitfalls.

All for now. / Comments invited! / RAP / Robert A. Pease / Engineer

The next part of this series is here.

About the Author

Bob Pease

Bob obtained a BSEE from MIT in 1961 and was a staff scientist at National Semiconductor Corp., Santa Clara, CA, for many years. He was a well known and long time contributing editor to Electronic Design.

We also have a number of PDF eBooks by Bob that members can download from the Electronic Design Members Library.

Sponsored Recommendations


To join the conversation, and become an exclusive member of Electronic Design, create an account today!