|
||||||||||
Guidelines for Verilog-A Compact Model CodingGilles Depeyrot, Frédéric Poullet, Benoît Dumas ABSTRACT The Verilog-AMS hardware description language [1] includes extensions dedicated to compact modeling, but does not define a reserved subset for compact modeling. This lack of specification combined with some SPICE related specificities are both responsible for the speed and memory consumption differences measured between simulations of Verilog-A compact models in Verilog-A simulators and SPICE simulators. That is the reason why, after presenting these differences, this paper [2] presents recommendations for developers of Verilog-A compact models who want to optimize their models for SPICE-like simulators and to facilitate the integration of said models into different simulators. 1. INTRODUCTION Circuit design, in any semiconductor manufacturing process, is based on an accurate description of the electrical behavior of devices - transistors, diodes, resistors - in so-called "Spice models", also known as Compact Models. These models are used by analog circuit simulators, such as SPICE, to predict the electrical behavior of the circuit. Accuracy and performance of these models determines, to a large extent, the validity of simulations results with respect to measurements on silicon. As semiconductor manufacturing processes move to smaller geometries, new physical effects impact the electrical behavior of devices. These effects must be modeled and require that additional equations be integrated into the compact models, which must then become available in analog simulators. Usually, such modifications in compact models must be performed directly in the simulator source code (generally based on the C programming language) by each EDA vendor or through a proprietary application programming interface (API) of the simulator by the model developers. This cumbersome process is a barrier to the adoption of new compact models as it is both time consuming and very inefficient. Indeed, coding the model behavior into a low level language like C, or worse FORTRAN, implies calculating and coding the partial derivatives of currents and charges. And these derivatives are difficult to validate. As a result, the majority of hand-coded compact models take months to develop and contain derivation errors which impact the accuracy of the simulation (mainly in small signal and in noise) and drastically impact the simulation time. Another drawback is that this approach is absolutely not portable; the code developed for one simulator cannot be used in another simulator without extensive customizations. Over the last few years, the Verilog-AMS hardware description language [1], and specifically its analog-only subset, called Verilog-A, has been adopted by leading compact model developers, following the strategy judiciously promoted both by the GSA Modeling Working Group (MOS-AK and GSA Modeling) workgroup [3] and the Compact Model Council [4]. At the same time, the Verilog-A language was supported by most analog circuit simulators on the market. Despite Verilog-A language enhancements to provide better support for compact modeling [5], a performance gap exists between “direct” Verilog-A simulations and their SPICE simulations counterparts using models converted from Verilog-A to C by the means of a compact model compiler such as ADMS-XML [6][7][8]. Figure 1: Verilog-A subset needed for compact modeling The main explanation for this performance gap is that, as shown by figure 1, compact models only need a subset of Verilog-A; subset on which additional optimizations can and must be applied. This paper is specifically intended for compact model developers who describe their models in Verilog-A, and want to optimize their models for SPICE like simulators. Section 2 reports the results of the comparison between Verilog-A compact models running in Verilog-A simulators and the same Verilog-A compact models running in SPICE simulators after conversion of the Verilog-A models into SPICE models. Section 2 also gives some hypotheses to explain the observed differences, while section 3 gives recommendations for writing efficient compact models for SPICE simulators with the three following main goals:
2. TEST RESULTS Verilog-A has the potential to change the paradigm for compact model integration into SPICE like simulators [9]. In spite of performance improvements over the last years, Verilog-A simulators still remain far away from SPICE simulators in terms of memory consumption as well as in terms of simulation speed. 2.1 Test Bench description The goal of the testbench is to test the model implementation, not the simulator engine solver. It must test the impact of the model implementation on the memory consumption and on the speed of transient simulation. For that, we force the number of iterations to be around 2550±5, we force the integration method to be trapezoidal, and we use the same tolerance (when possible). Thus, the solver has a constant impact on transient simulation speed. The testbench is composed of an inverter chain: each inverter is loaded with the next inverter and a capacitor (always simulated in SPICE). We use three configurations to test the impact of circuit size on memory consumption and speed: 200 inverters, 2,000 inverters and 20,000 inverters. We use only two models with default values for the parameters, one for the NMOS and another for the PMOS. The number of models is therefore far less than the number of MOS instances, just like in a typical SPICE simulation. This testbench was applied on two SPICE/Verilog-A simulators, SMASH 5.15 our mixed simulator and Simulator B, one of our well known competitors. This testbench was applied using the PSP model and the EKV3 model. This testbench was run under the same OS (Windows XP 32bits) and on the same PC. To compute the ratio between Verilog-A simulations and SPICE simulations, we take the best performances of each simulator to be less sensitive to their respective implementation. We also ran this testbench on three successive releases of SMASH and Simulator B and have observed important variations in the Verilog-A performance results. Generally the performances progress but we also noted regressions. These evolutions prove that the EDA vendors are working hard on the integration of Verilog-A. Thus, the order of magnitude of the ratio between Verilog-A and SPICE is more important than exact values as this ratio is likely to change from one EDA tool release to the next one. 2.2 Memory consumption results Table 1 shows the testbench results in terms of memory consumption. It must be noted that the EKV3 model is not yet available as a SPICE model in Simulator B. Table 1: Memory consumption results As SMASH runs with a graphic user interface, it consumes around 34Mb before loading the benchmark. Therefore, if we take this into account, the ratio increases and becomes (2.8; 3.5; 3.3) for the PSP model and (3.4; 3.9; 4.0) for the EKV3 model. After analysis, SPICE consumes less memory for three main raisons: a) As shown in figure 2, when converted into SPICE, the Verilog-A module is split into three structures: the instance (instantiated for each instance); the instance size (instantiated only once for all instances with the same size), and the model (instantiated only once for all instances that use the same model) b) The variables of the module are not allocated in memory (heap), but are allocated as local variables in the stack when the instance is evaluated. Theoretically, this optimization is possible in Verilog-A, except for output variables which can be probed with system function $simprobe, as well as for variables which are used before they are assigned (hidden states). c) Internal “extra” nodes are instantiated in Verilog-A and not in SPICE. This is the case for the PSP model which has two “extra” internal nodes dedicated to simulation of noise. Figure 2: Memory decomposition in SPICE versus Verilog-A The model/instance differentiation constitutes the main part of the memory differences. The study of the memory consumption of the SPICE models is given in table 2. The instance part consumes around 40 % of the memory. When the number of instances is far greater than the number of models, this memory consumption decomposition can explain a ratio up to 2.5 between Verilog-A and SPICE. Table 2: Memory decomposition of the SPICE models 2.3 CPU time results Tables 3 to 5 show the testbench results in terms of CPU time for the loading, the operating-point and the transient analysis. Again the ratio is very favorable to the SPICE simulations even for small simulations. Table 3: CPU loading time results The load measurement was done on the second load, thus the compilation time of the Verilog-A model is not included in these measures. As the model is initialized only once in SPICE, the model/instance differentiation can explain a ratio up to 2 between Verilog-A and SPICE. Table 4: CPU operating point time results The execution speed differences during operating-point analysis are mainly due to:
Table 5: CPU transient time results The execution speed differences during transient analysis are mainly due to:
The speed impacts of the Verilog-A/SPICE implementation differences above are summarized in table 4. The differences marked in bold have an impact that increases with the size of the circuit. Table 6: Speed impact of the Verilog-A/SPICE implementation differences 3. RECOMMENDATIONS 3.1 Subset of Verilog-A The Verilog-AMS hardware description language [1] is a general-purpose behavioral language for analog and mixed-signal systems available for both electrical and non-electrical systems description. As such, it includes a number of features that are not suited for compact modeling. Moreover, contrarily to the Verilog standard, where the IEEE has defined syntax and semantic rules for both simulation and synthesis (IEEE1364-2001[9] and IEEE 1364.1-2002[11]), the Verilog-AMS hardware description language does not define a subset reserved for compact modeling. Furthermore, the subpart of Verilog-AMS usable for compact modeling is reduced if we add constraints related to its integration into different electrical simulators. Here after this subpart we recommend:
3.2 Spice specificities The previous recommendations are quite generic concerning compact modeling, and weakly related to the SPICE simulators themselves. We don’t intend to normalize the writing of compact models, but to facilitate their integration into different SPICE simulators. We recall that the objectives are threefold:
System tasks and functions: limit to the use of explicit binding detection system functions, $vt, $temperature, and $mfactor.
This “idiom” has several drawbacks, one of the main ones being that the “if” statement can be repeated many times in the model which is a potential cause of error. That is why we propose another syntax which is based on the usage of attributes: Such an attribute can be automatically handled during conversion of Verilog-A models into SPICE models, for instance when using the ADMS-XML compact model compiler. 4. CONCLUSION AND PERSPECTIVES With the SPICE compatibility extensions of the Verilog-AMS Language Reference Manual (LRM) version 2.3.1 [1], Verilog-A has the potential to revolutionize the paradigm of analog design of integrated circuits and totally replace SPICE. The achievement of this goal depends on the adoption of Verilog-A by all the actors concerned: final users, semiconductor foundries, compact model developers as well as EDA vendors. But both final users and semiconductor foundries cannot accept degradation in simulation speed or loss of functionality. This paper introduces the sub-set of Verilog-A needed to write efficient compact models for different Verilog-A simulators. And, as SPICE simulators remain faster than most Verilog-A simulators, this paper presents some guidelines to help compact model developers improve the integration of their Verilog-A models into SPICE simulators while reaching the speed and the functionality of C based compact models. A recent study [14] shows that under some conditions, some Verilog-A simulators can be as efficient as SPICE simulators. The ball is now in the camp of the standard groups and EDA vendors to make Verilog-A simulators as fast as their SPICE counterparts, as well as to allow Verilog-A to address the challenges of deep submicron processes such as process dispersion, dynamic degradation, power consumption, system-level complexity… REFERENCES [1] Accellera Verilog Analog Mixed-Signal Group: http://www.accellera.org/activities/verilog-ams [2] This work is supported by the European Commission FP7 under contract number 218255 (COMON) [3] GSA Modeling Working Group: http://www.mos-ak.org/ [4] CMC - Compact Model Council: http://www.geia.org/index.asp?bid=597 [5] L. Lemaitre, G. Coram, C. McAndrew, K. Kundert, “Extensions to Verilog-A to support compact device modeling”, Proc. 2003 IEEE International Workshop on Behavioral Modeling and Simulation (BMAS 2003). [6] L. Lemaitre, C. McAndrew, S. Hamm, “ADMS - Automatic Device Model Synthesizer,” CICC 2002. [7] L. Lemaitre, C. McAndrew and W. Grabinski, “Standardization of Compact Device moding in High Level Description Language”, Nanotech 2003, Vol. 2 [8] ADMS-XML - Automatic Device Model Synthesizer: http://mot-adms.sourceforge.net/ [9] M. Mierzwinsk, P.O. Halloran, B. Troyanovsky and R. Dutton, “Changing the Paradigm for Compact Model Integration in Circuit Simulators Using Verilog-A”, Nanotech 2003, Vol. 2 [10] “1364-2001 IEEE Standard Verilog Hardware Description Language”, IEEE, Pascataway, New Jersey. Copyright 2005.ISBN:0-7381-2827-9. [11] “1364.1-2002 IEEE Standard for Verilog Register Transfer Level Synthesis”, IEEE, Pascataway, New Jersey. Copyright 2002. ISBN:0-7381-3502-X. [12] OpenMAST™ is the open source of the MAST language: http://www.openmast.org/ [13] M. Mierzwinski, P. O'Halloran, and B. Troyanovsky, “Developing and releasing compact models using Verilog-A”, MOS-AK San Fran 2008 [14] G. Coram and M. Ding, “Recent Achievements in Verilog-A Compact Modeling”, MOS-AK/GSA Baltimore 2009
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |