Analogue Mixed Signal Simulation Using Spice and SystemC Tobias Kirchner, Nico Bannow Robert Bosch GmbH Corporate Sector Research and Advance Engineering P.O. Box 30 02 40, 70442 Stuttgart, Germany Tobias.Kirchner@de.bosch.com Christoph Grimm Vienna University of Technology Institute of Computer Technology Grimm@ICT.TUWien.ac.at Abstract—SystemC is a discrete event simulator that enables the programmer to model complex designs with varying levels of abstraction. In order to improve precision, it can be coupled to more specialized simulators. This article introduces the concept of loose simulator coupling between an analogue simulator and SystemC. It explains the properties and advantages which include a higher simulation performance as well as a higher degree of flexibility. A design example in which SystemC will be connected to SwitcherCad will demonstrate the benefits of loose coupling. I. I NTRODUCTION Some progress has been made in simulation technology over the past couple of years. With more and more manufacturers supporting it, SystemC [1], [2] has grown in importance constantly. Using SystemC it is possible to reach very high levels of abstraction. However, its ability to extend simulation coverage down to analogue level is limited. So far there is no way for SystemC to simulate designs with better precision than register transfer level (RTL). Still, there are circuits which just cannot be simulated inside the digital domain since they require feedback from the analogue world. This is where more specialized, mostly continuous time simulators need to be used. Because SystemC is essentially C++, it can do both, be a simulator and act as connecting and coordinating element between different other simulators. With a specialized simulator like MatLab Simulink, Spice or Saber connected to it, SystemC capabilities are extended towards analogue continuous time simulation. Another attempt to extend SystemC simulation capabilities is SystemC AMS Extensions. It is an extension to the SystemC language that aims at analogue designs [3], [4]. II. RELATED WORK When coupling an analogue simulator to SystemC, the usual way of interfacing is by using the simulators built-in programming language interface and extending the SystemC kernel with co-simulation capability. In a tightly synchronized co-simulation all simulators start at simulation time t 0 =0s. This paper refers to the simulator that runs first as the master. In a tight simulator coupling the simulator is usually not pre loaded with a bias point or an internal state. Master and slave simulator are synchronised at fixed intervals. In an improved approach the master determines when its next event occurs and commands the slave to advance to that point. The slave reports back to the master and indicates whether it has encountered an event of its own before the end of this time step. If it has, the master advances to that time instead [5]. As seen in Fig. 1 all simulators are instantiated at the beginning of the simulation and remain in memory until they are finished. Between simulations they are just halted, retaining their internal state. The advantage of this kind of coupling is a very tight and synchronous interaction of the simulators chosen. The outputs can be examined at any time during the simulation and they will be synchronized in regular intervals. SC SPICE time steps 2 1 SC SPICE SC Fig. 1. Execution of tightly coupled simulators. Both of them start at t 0 and are executed at least once every simulation timestep. Tight coupling also brings some problems with it. Most of all, only simulators which support a co-simulation interface can be used. There is also a lot of communication necessary in order to keep the simulators synchronized. Depending on the implementation of the coupling interface, this communication overhead may even use more computational power than the simulation itself. Especially simulations that are distributed across a network suffer from additional network latency de- lays. III. LOOSE SIMULATOR COUPLING In contrast to the tight coupling, with loose coupling there is a clear difference between the master and a slave simulator. 978-3-9810801-5-5/DATE09 © 2009 EDAA