Modeling for printed-circuit board simulation
The practical engineer
Simulation has long been one of the most important steps in the design of integrated circuits. When it is not possible to probe most points in the circuit and when mistakes can cost hundreds of thousands of dollars, simulation software can prove invaluable. But when it comes to printed-circuit boards many designers are reluctant to use simulation software. As a result, they are missing out on substantial advantages, which include better circuit performance and reliability, improved documentation, and deeper understanding of circuit operation.
The reasons, say engineers who shy away from simulation, are that simulation tools are expensive and difficult to learn. While this may have been true of an older generation of cumbersome, netlist-driven software, today's design tools are quite different. Stiffer competition has forced software vendors to deliver software that is easier to use, has a broader range of functionality, and offers a wider spectrum of pricing. Those not yet immersed in the world of electronics design automation will be pleasantly surprised to hear that an abundance of software is available to make them more productive—without long intimidating learning curves or expensive price tags.
Modeling is key to simulation
But a far more serious issue troubles printed-circuit board (PCB) designers who do not simulate: the lack of appropriate models for some of the components used in their PCB designs.
What makes the modeling problem for PCBs different from modeling for ICs is that PCBs have components of many different types, each with its underlying technology—electromechanical and high-power components, analog, digital, and mixed-signal ICs, wire jumpers, shields, and connectors.
For this reason, a PCB simulation tool that accommodates different types of models—Multisim, by Electronics Workbench, for example—should prove valuable.
A model is a set of mathematical or logical equations or other representations that approximates the behavior of a particular system or subsystem. In the case of analog or mixed-mode electronics, the subsystem usually modeled is an individual component , such as a capacitor, a transistor, or an operational amplifier. For digital design, the subsystem can be as simple as a logic gate or as complex as a network of processors. The modeling problem lies at the foundation of simulation. Simulation can be viewed as simply a process that allows models to communicate with one another, but if poor models or no models are used, poor or useless simulation results.
Simulation tool vendors have recognized this problem. To solve it, they have generally used some combination of two strategies: working with component vendors to build large databases of component models to include with their software and providing ways for users to create their own models.
Five of the most common approaches for the first strategy are using models based on component parameters, look-up tables, code to describe a circuit function, macromodeling, and hardware description languages. The second strategy leads to an additional approach, modeling utilities, which lets users create their own models from manufacturers' data.
In the first approach, parameters of such components as voltage sources and resistors are used to represent simple circuits, while in the second approach a look-up table is employed to describe the outputs of a digital circuit in terms of its inputs. Code-based modeling—the third approach—uses a programming language such as C to represent the function of such components as switches and indicators. In the fourth format, an operational amplifier calls for a macromodel for its description, one that is typically composed from a number of simpler basic models. A hardware description language, the fifth setup, is used to represent such logic elements as NAND gates [Fig. 1].
(1) Printed-circuit design benefits from co-simulating differently modeled components. The five types of modeling used in this counter circuit were (counterclockwise from lower left) macromodeling, component parameters, code for circuit functions, look-up tables, and hardware description language (HDL).Image: Electronics Workbench
Determining which model to choose means taking into account the type of component being modeled, the level of accuracy desired, and the type of simulator used. For example, the look-up table could easily be interchanged with a hardware description language (HDL) model, and the parameter-based model can be augmented into a macromodel that includes capacitors and inductors, as well as resistors, to simulate high-frequency parasitic effects.
Examples of low-cost printed-circuit board simulation tools, all of which can be used with several modeling approaches, are Protel's Protel 99 SE, Cadence's Pspice, and Electronics Workbench's Multisim [Table 1]. Each of these products sells for under US $5000, and less expensive editions are also available.
Large databases of models
Usually simulation tools for PCB design are shipped with large databases of models for discrete components and ICs. Often these models are created by component vendors and are licensed to the simulation tool vendors to distribute with their products. In the evaluation of a simulation tool's database, both breadth and depth should be considered, as well as quality. Typical questions to ask include: Are models of the less popular component types, like optocouplers, diacs, and instrumentation amplifiers, available? Are models of instrumentation amplifiers from several manufacturers obtainable? Are the models a good representation of the electrical behavior of the component in the ways it is most often used?
It is important to understand that no model can cover all the ways in which a given component can be used. Whenever possible, the model must be matched to the context of the circuit. One example is the transmission line effect on PCB traces. For accurate simulation at high frequencies (300-MHz to 10-GHz range), traces must be modeled as transmission lines that have capacitance, inductance, and resistance. The values of those parameters (capacitance, inductance, and loss per unit length) vary with frequency, however, so naturally a PCB trace model constructed for a 100-MHz signal will be inaccurate in a simulation at 1 GHz.
Simulation tool vendors have difficulty in maintaining models for components that are not highly popular. They also have trouble in ensuring that models are accurate over a large number of simulation contexts (frequency, temperature, and operating mode, for example) and in keeping up with the pace of new component introductions. To meet all these requirements by continually adding to the database of components distributed with the tools would drive up the cost of simulation tools prohibitively. Although component vendors may supply models of the latest analog components, some popular component models are often missing. Having recognized this, the vendors instead provide mechanisms to let users either customize the existing models being shipped with the simulator or create new ones.
User-defined component models
In creating their own models by any of these six approaches, users can employ simulation tools that offer some variations of their own. The first four approaches—parameters, look-up tables, code modeling, macromodeling, and sometimes the hardware description language approach—are basic, fundamental to the simulator. But the last two and the modeling utilities approach build upon other modeling methods. The main differences are that each has a different tradeoff between flexibility and required expertise of the user.
1. Parameter-based modeling
The most basic type of modeling, the parameter-based model, is provided in every simulator. Simply put, this approach makes use of the primitive models built into the simulator.
What constitutes a primitive model depends upon the type of simulator. For analog simulators, passive components such as resistors, capacitors, and active components like diodes and transistors are primitive models. In digital simulators, the primitive models are generally simple logic functions and storage elements such as AND, OR, NOT, and D flip-flops. Printed-circuit board designers typically select the simulation types—analog, digital, mixed mode simulation—that correspond to the types of components used on the board.
(2) Parameter-based modeling of this ac voltage source enables the user to set specific values for a variety of component parameters.Image: Electronics Workbench
These primitive models have parameters whose values the user can specify [Fig. 2]. For example, a capacitor model has a capacitance parameter, a resistor model has resistance and temperature coefficients, logic functions have delay and drive strength, and storage elements have setup and hold times. The designer in this case can build a component model by specifying which primitive to use and which values to set for its parameters.
There are two main advantages with this approach. One is that simulation is usually very fast, 20 to 1000 times faster than more complex models, because the simulator is highly optimized to support these fundamental models. Another is that, for modeling simple components with well-known parameters, the user needs to know little about how the underlying simulation works. These advantages make parameter-based modeling well suited for modeling simple components.
However, for practical circuits implemented on PCBs today, this approach can become tedious. Using this form of modeling alone, the designer can simulate only component models that are built into the simulation tool. What's more, for complex components, the parameters that are required by the simulator are often different from those available to circuit designers. This incompatibility happens because the parameters are in a form convenient for simulation but not available in manufacturers' databooks.
Another drawback with this setup is that modeling complex components can be done in many ways; the one used by the simulation software is not always the same as the one used by the engineer in designing the board. One such example comes from Spice, on which most analog simulators are based. For its primitive bipolar junction transistor (BJT), Spice implements a form of the Gummel-Poon model. Most engineers think of BJTs in terms of the hybrid-pi or T models, the ones taught in engineering schools and textbooks. For the Spice BJT model, though, a parameter called the junction grading coefficient, which approximates the nonlinear behavior of the transistor junction capacitances, is required. But no manufacturer databook specifies this parameter and, because it is an approximation, it cannot be measured. To set this parameter properly, a designer would have to be intimately familiar with Spice simulation.
2. Look-up table-based modeling
Another relatively simple modeling approach is to use a look-up table [Fig. 3]. In this setup, the input and operating conditions for the component versus the output and behavior of the component are placed in a table or graph. During simulation, the simulator simply gathers the input conditions and performs a look-up on the table or graph to find the output behavior. The simplest example of a table-based model is a digital truth table.
(3) Based on a look-up table, this model for a 7490 decade counter is, in fact, a truth table for the counter's four inputs and four outputs, with clock inputs A and B.
Another example is the I/O Buffer Information Specification (IBIS) standard for modeling the inputs and outputs of digital components. IBIS models contain information (in a look-up table form) on the amount of current the component can supply to, or absorb from, a pin, versus the pin's voltage.
A disadvantage with this form of modeling, though, is that the resulting model can be very large (on the order of several kilobytes per model) for a component of only moderate complexity. The reason is that the table size increases exponentially with the number of inputs and the amount of data stored in a digital component (for such components as flip-flops, counters, and memories). In a truth table, a two-input digital function requires four table entries, a three-input function needs eight, four-input functions take 16 entries, and so on. In the analog realm, the current-versus-voltage behavior of a diode can be expressed compactly with an exponential equation, but in a look-up table of current versus voltage, there can be dozens, or even hundreds, of data points to describe the same function.
A key advantage of look-up tables is that the user needs less specialized knowledge. Often this type of modeling requires just the ability to copy information from a data book into a table.
3. Code-based modeling
A more advanced form of model is one based on software code written by the user. Written in a programming language, typically C, these models take the form of a function that the simulator calls. For analog simulation, the calls occur at each time-point being simulated; for digital simulation, they occur at each event.
With this approach, the user's function can receive information from the simulator on what values (voltages, currents, or logic levels, for example) are present on its inputs, can perform some calculations, and can then return to the simulator the values that should appear on its outputs.
This mechanism is a powerful one. Because the "calculation" can be almost anything, the designer gains much flexibility on how the model behaves. In fact, the mechanism can be used to interface two simulations by making one simulation a "component model" within another.
Because it is compiled as software, this model can also be simulated very quickly. Unfortunately, to create an efficient model of a complex component, the circuit designer must have a good knowledge of how the simulator operates. He or she must also have software programming skills, as well as knowledge of software development tools such as compilers and debuggers.
Structural modeling builds upon one or more of the fundamental modeling techniques given above. Also known as macro modeling, it uses a number of simpler, fundamental submodels to mimic the behavior of a complex component. This form of modeling comes naturally to a designer.
Many designers already think of complex components in terms of simpler components. For example, when operating in its active region and for small currents, a transistor acts as a current amplifier. So a macromodel for a transistor can be as simple as resistance between the base and emitter pins and a controlled current source between the collector and emitter. This is the transistor pi model, which is taught in most engineering schools.
In digital design, structural modeling is even more common. For example, a memory module is broken into an array of storage elements, a controller, a row, and a column selector. Similarly, a timer is represented by two comparators, a binary circuit, and an output stage [Fig. 4].
(4) Macromodeling presents the 555 timer in terms of two comparators on the left, a binary circuit at the center, and an output stage.Image: Electronics Workbench
In addition to exploiting intuitiveness, another strength of this approach is that the model can be made as simple or as complex as necessary. In the transistor example, the pi model can be enhanced to include parasitic effects that are negligible at low frequencies (less than 100 MHz) but become pronounced at high frequencies (greater than 300 MHz). For these effects, additional resistances and capacitances must be added to the basic pi model.
The disadvantage of this form of modeling is that for complex components, the submodels and their connection topology must be chosen carefully. Especially when simulating an analog circuit, the various submodels may affect each other in unpredictable and undesirable ways. Furthermore, when simulating, the designer must bear in mind the conditions under which the macromodel is valid. (In the transistor example, temperature and frequency ranges, signal amplitudes, and biasing conditions are cases in point.)
5. Modeling utilities
Simulation vendors have acknowledged the difficulty users have in performing their own modeling. So they have tried to provide help in the form of utilities, tools that translate parameters from databook values to those needed for simulation. Generally, these utilities are made for a specific type of component or technology. Examples of components are transformers, bipolar junction transistors [Fig. 5], or tunnel diodes; an example of the technology is a MOSFET produced in a 0.18-µm process.
(5) A modeling utility helps a user without programming or modeling skills customize a bipolar junction transistor model.Image: Electronics Workbench
As input, the utilities take parameters found in a component manufacturer's databook and convert it into either a primitive model or a macromodel. Using a modeling utility removes the requirement for a designer to be a modeling expert. Often, simply typing values from the databook is sufficient, and the modeling utility handles all the details of performing interpolation and numerical analyses.
The drawback for this form of modeling, as with primitives, is that the circuit designer is again relying only on component types available from the simulator vendor. In some cases, too, the modeling utility is closely coupled with the specific simulator (a particular variation of Spice or of some particular extended delay model, for example). Another problem is that not all databooks have the same parameters, or that they lack ones needed for a particular modeling utility. This situation arises in BJTs, where databooks from Japanese manufacturers differ from those of North American manufacturers.
6. Hardware description languages
Modeling with hardware description languages (HDLs) is more commonly used in digital design than in analog design. The two most popular digital languages—very high-speed integrated circuit (VHSIC) hardware description language, known as VHDL, and Verilog HDL—provide standardized methods of exchanging information among simulation tools as well as between simulation tools and other design tools.
Because they have both become standards, VHDL and Verilog HDL are continuing to gain popularity over proprietary HDL formats from chip and electronic design automation (EDA) vendors. Consequently, a key plus is that VHDL and Verilog HDL models are portable between EDA tools and vendors. HDL modeling provides substantial speed benefits as well: simulating a digital chip modeled using HDL code is orders of magnitude faster than simulating that chip at the gate level.
While HDL modeling is powerful, it does come with a price. Creating HDL code in the more robust HDL formats is nothing short of programming. It will thus entail a substantial learning curve.
Another downside to HDL modeling is that HDL simulation is largely segregated from other simulation methods. In effect, HDL simulators are likely to simulate only HDL models, not any of the other model formats discussed above, and vice versa.
Still, the use of HDL for printed-circuit board simulation need not necessarily be time-consuming. For instance, the simulation of several microseconds of operation of a small piece of control logic in the form of a field-programmable gate array with, say, 1000 gates, typically lasts less than 1 minute. For larger ICs—more than 10 000 gates—the HDL model would probably represent a simplified version of the IC, rather than the entire IC. With this type of IC, it is envisioned that the designer would be most interested in the IC's interfacing to the remainder of the circuit board.
Putting it together
To sum up, many model formats are available for board-level design so users should ensure that their EDA tool supports a wide range of formats: parameter-based analog and digital Spice, look-up tables, C-code modeling, macromodeling, modeling utilities, VHDL, and Verilog.
An integrated environment that enables co-simulation of some or all the types of models mentioned above should prove useful. Multisim supports many of these types of models. Once a component model is created and dropped onto a schematic, the simulator ensures that it can be used in any circuit context. When an HDL model is used along with with other circuit models, for example, a so-called co-simulation feature in the software synchronizes the simulation time between the HDL model and the rest of the circuit. It also ensures input conditions occurring at the HDL-modeled components' inputs are passed on to the HDL simulator and outputs from the HDL simulator are returned to the remainder of the circuit.
Choosing a simulation tool with broad model support will ensure that designers create or use the most appropriate format for their applications. A case in point is printed-circuit board simulation, where different types of models are needed for the different components on the board. Most analog parts require parameter-based Spice for modeling, most small to medium digital circuits (up to 300 or so logic gates) use look-up tables, some parts might use macromodeling and, finally, complex digital or programmable devices might use VHDL or Verilog.
To probe further
A tutorial on the use of Multisim, Electronics Workbench's printed-circuit board simulation software, is presented at the company's Web site at https://www.electronicsworkbench.com/tutorial/.
Papers relevant to printed-circuit board simulation were presented at the International Conference on Computer-Aided Design 1998, see https://andante.eecs.umich.edu/ecad/conferences/papers/1998/iccad98/htmfiles/sun_sgi/iccadabs.htm.
Data sheets for Texas Instruments Inc.'s components are available at www-s.ti.com/cgi-bin/sc/generic1.cgi, and those for Motorola Inc.'s components are at https://mot-sps.com/lit/ldc_inv.html.
The use of Spice 3F5 for modeling is explained in Spice 3, Version 3F5 User's Manual, by T. Quarles, A. R. Newton, D. O. Pederson, and A. Sangiovanni-Vincentelli (Department of Electrical Engineering and Computer Science at the University of California, Berkeley, 1994).
Modeling software for subsystem design is described in the XSPICE Software User's Manual, by F. L. Cox, W. B. Kuhn, H. W. Li, J. P. Murray, and S. D. Tynor (Georgia Tech Research Institute, Georgia Institute of Technology, Atlanta, 1992).
The I/O buffer information specification (IBIS) standard is described at the Web site at https://www.eigroup.org/IBIS/.
About the author
Anil Balaram is technology manager at Electronics Workbench, Toronto, a producer of electronics design automation tools. He has been developing simulation tools for five years, and was the primary mover behind the U.S. patent for the development of a software algorithm that enables the co-simulation of Spice and HDL-modeled elements.
Spectrum Editor: Gadi Kaplan