# Beyond SPICE – Analog/Mixed Signal Simulation

13/08/2019, hardwarebee

Many electronics developers are very familiar in doing circuit simulation using SPICE (Simulation Program with Integrated Circuit Emphasis) models, netlist and a SPICE simulator tool. There are quite some tools in the market, even some of them free of charge. In this article, I like to inspire a little bit to go beyond using only SPICE in circuit simulation and do AMS – Analog/Mixed Signal simulation.

Now, what is AMS?

A simple, yet striking example will be a H-Bridge circuitry driving an electrical motor. The H-Bridge itself being driven by more or less complex digital PWM signal (clk1, clk2) coming from say a Microcontroller or an FPGA. See a schematic of such a setup. Essentially, we have several domains. The PWM might be described by some piece of C-language code running inside a Microcontroller or as shown in the example in VHDL. The discrete components, such as the power transistors and diode could be easily represented by SPICE models.

How could be model the DC-Motor? A DC-Motor is a device having two terminals, thru which is flowing an electrical current and across which is an electrical voltage. Depending on the motor’s characteristic equations, current is turned into a torque at the motor shaft and an angular velocity. If you are familiar with SPICE, you will agree, this is not so straight forward to model a DC-motor using SPICE notation. Even more, the DC-Motor shaft has some “load” attached to it. So we could be interessted to model the behavior of a moment of inertia. In the particular example, the shaft shall have a min. and max. position and when motor turns the shaft into min/max positions, we like to mimic in the simulation a stronger counter force. All this is too much for SPICE notation, or say better, SPICE wasn’t developed to descibe all of this in any easy way. However, the language VHDL-AMS was designed to deal with such use case. VHDL-AMS is an extension of the VHDL that FPGA and IC-Designer are used to work with. It got extended to described analog behavior. See the Spice or VHDL-AMS code behind some symbols.

Transistor modelled in SPICE. PWM Signal in this case modelled like a Clock in VHDL DC-Motor modelled in VHDL-AMS by it system equations Let me show three fundamental examples and a more complex one. A Resistor, a Capacitor, an Inductor and a Fuse. While in SPICE, essentially R, L and C and primitives, they aren’t primitives in VHDL-AMS but described by their system equations. R, L, C have two terminals and a physical quantity (electrical current) THROUGH the terminals and a physical quantity (electrical voltage) ACROSS the terminals. And with this, R, L, C is described like this.

Resistor fulfills Ohm’ law: Voltage = Resistance * Current Here the code of an Inductor: Voltage = Inductance * dI/dt Likewise a Capacitor described by equations: Voltage = C * dI/dt

Now let us see a “fuse”. A “fuse” is not a primitive component in SPICE and you can search the web for even PhD works about how to model the behavior of a fuse in SPICE by using a mix of controlled current and voltage sources and those alike primitives of SPICE. Here is the code how a fuse could be modelled in VHDL-AMS and describing its thermal behavior until melting point. This is just one example to model a fuse.  Coming back to the H-Bridge driving a DC-Motor. Now that we modelled all relevant parts, if we do a simulation, we might look into time-domain plots. Putting all together, you see simulation results being a true mix of digital and analog electrical signals along with other physical quantities such a torque in NM or the angle of the shaft in radians. Now you understand better what is meant by “Analog Mixed Signal”.

Such a AMS Tool, like PADS AMS, comes with a library. The library brings a lot more models of functionality like Filters, Pumps, Gears. But moreover, you can also find in the web VHDL-AMS model libraries. Search for example the Web with key such as VHDL AMS, Automotive and you will find plenty of resources.

I find it pretty cool and like to mention that there is also a free cloud based version available for this technology. AMS Cloud

Hans Hartmann, Consultant

Acronyms

SPICE = (Simulation Program with Integrated Circuit Emphasis)

FPGA = Field Programmable Gate Array

VHDL = VHSIC Hardware Description Language

VHSIC = Very High-Speed Integrated Circuit

Sources