Vhdl-Ams Rules 2.0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Guidelines for the Development of a

VHDL-AMS Model Library


Version 2.0

Date: June 11, 2008


VHDL-AMS Modeling Guidelines

Summary

The available proposal summarizes rules that should be considered in order to establish
consistent VHDL-AMS models for modeling and simulation of automotive systems. It is in-
tended to assure that the models are running inside different VHDL-AMS simulators and
models of different origin can be combined. The draft proposal outlines the results of discus-
sions of the Working Group “Simulation of Mixed Systems with VHDL-AMS” (VDA/FAT AK
30).

In the following, rules are specified that shall help to fulfill these expectations. It is distin-
guished between requirements and recommendations. A rule that is specified as a re-
quirement has to be kept without restrictions. This is necessary to assure that the documen-
tation can be generated automatically. A recommendation should be mentioned in order to
unify the layout of the models. This helps to make the models better readable. An example
of a VHDL-AMS model that considers rules is given in appendix G.

Furthermore, a proposal is represented how to administrate the model library in section 4.

Modification History

Version Date Comment

0.1 April 15, 2004 First German version


0.2 April 30, 2004 Revised version after discussion in the group
„Modeling Guidelines“ of VDA/FAT-AK 30
on April 20, 2004
1.0 June 3, 2004 Revised version after discussion in the Working Group
VDA/FAT AK30 on May 24, 2004
1.1 August 25, 2004 English translation and some revisions with respect to
experiences concerning model generation
1.2 September 1, 2004 Revision of version 1.1
2.0 June 11, 2008 Update with respect to new documentation guidelines

Comments to
Joachim Haase

E-Mail: [email protected]

Version 2.0 -2- June 11, 2008


VHDL-AMS Modeling Guidelines

1 Objectives
It is intended to establish a library of VHDL-AMS models that describe aspects of automotive
systems. To guarantee a unified layout of the library some guidelines that should be consid-
ered are summarized in the following.

These guidelines were influenced by

• commitments that were worked out by the working group AK 30 “Modeling and simu-
lation with VHDL-AMS” (ref. to appendices A, B, and C),
• documents that settle VHDL modeling [1-3],
• the SAE standard „Model Specification Process Standard“ [4],
• IEEE standards or standard proposals [5-6],
• special problems concerning the design of models discussed in the working group
AK 30 (current limitations of tools etc.)

The aim of this document is to support the development of VHDL-AMS models that can be
combined and correspond to each other easier.

2 Fundamentals of the Model Development


2.1 Structure of the Model Library

R2.1-1 (Requirement): The models are compiled into logical libraries. The characteristics of
the libraries are explained in table 2.1-1.

Table 2.1-1: Identifiers of the logical libraries

Logical library Comments


FUNDAMENTALS_VDA Basic models
SPICE2VHD Spice-like models
SPICE2VHD_DEVICES Parameterized Spice-like models
AUTOMOTIVE_VDA Special models for automotive applications
MEGMA Models of the MSR group [11]
MODELICA_TRANSLATIONAL Modelica equivalent VHDL-AMS models [12]
MODELICA_ROTATIONAL Modelica equivalent VHDL-AMS models [12]

The source code of the models, test benches and other appropriate files are stored in a spe-
cial structure of the file system that is given in appendix A. A subdivision of the libraries for
administration purposes is introduced in this way.

2.2 Modeling Principles

R2.2-1 (Requirement): The values of branch through and across quantites of conservative
systems are measured in SI units with respect to the corresponding nature declaration given
in [6].

Version 2.0 -3- June 11, 2008


VHDL-AMS Modeling Guidelines

In the case of nonconservative systems, a used unit has to be added as a comment after the
port quantity declaration if it makes sense (see section 3.2). To avoid inconsistencies the
rules summarized in table 2.2-1 must be considered.

Table 2.2-1: Modeling principles to avoid inconsistencies

Nature/Port Comments
THERMAL An external heat flow source is directed to the correspond-
ing node. The across quantity (temperature) is measured
in Kelvin.
TRANSLATIONAL An external force is modeled as a through source directed
TRANSLATIONAL_VELOCITY to the corresponding node.
Optical net Optical networks for data transmission are modeled by
nonconservative systems. The quantity port represents the
optical power that is measured in W.
Digital signals Digital signal ports belong to the type STD_LOGIC of the
IEEE package STD_LOGIC_1164. The index range of
array should be descending (… downto …).

Example

y F

F
x
x x
z

Figure 1: Translational system and network model (FFeder = k.x)

Note

It should be mentioned that inconsistencies can occur if models of different provenience shall
be combined [8]. This especially concerns the common usage of MAST models and VHDL-
AMS models that are established with respect to rule 2.2-1.

2.3 Temporary Regulation


When the library development started the IEEE_ENV package MATERIAL_CONSTANTS [6]
that provides the constant AMBIENT_TEMPERATURE was not standardized and available
in all commercial simulators. That is why special constants were defined to characterize the
global temperatures. This concerns in the package SPICE_FUNDAMENTAL_CONSTANTS
of the SPICE2VHD library the default value of instance temperatures
(SPICE_TEMPERATURE) and the global nominal temperature (SPICE_TNOM) and the con-
stants AUTOMOTIVE_VDA_TEMP and AUTOMOTIVE_VDA_TNOM resp. of the package
AUTOMOTIVE_VDA_FUNDAMENTALS_CONSTANTS.

Version 2.0 -4- June 11, 2008


VHDL-AMS Modeling Guidelines

3 Rules for the Development of VHDL-AMS Models


3.1 Organization of Models and Naming of Identifiers

R3.1-1 (Requirement): The entity declaration should be organized in the following way:
entity ....
generic (

port (

begin
-- assert statements to check the scope of application of parameters
end entity entity_name;

Each declaration of a generic parameter or a port has to be done in a separate line. It should
be checked using assert statements whether the current values of parameters are in the
scope of application or not. Default values should be assigned to parameters.

Example
entity RESISTOR is
generic (
R : REAL := 1.0 -- resistance [Ohm], MIN: 0.0, MAX: INF
);
port (
terminal P : ELECTRICAL; -- plus terminal
terminal N : ELECTRICAL -- minus terminal
);
begin
assert R > 0.0
report “ERROR: Value R > 0.0 required.”
severity error;
end entity RESISTOR;

R3.1-2 (Recommendation): The declarational part of each architecture should be organized


in the following way:

• At first: Declaration of local functions and procedures (Requirement)


• Declaration of types
• Declaration of constants
• Declaration of signals
• Declaration of internal nodes (terminal declaration)
• Declaration of branches (branch quantity declaration)
• Declaration of free quantities (free quantity declaration)
• Declaration of AC sources (spectrum quantity declaration)

The real-valued signals have to be initialized in their declaration (Requirement). The state-
ments of an architecture should observe the following order:

• concurrent statements (without concurrent BREAK statement)


• simultaneous statements
• break statements

Version 2.0 -5- June 11, 2008


VHDL-AMS Modeling Guidelines

Example
library IEEE;
use IEEE.MATH_REAL.all;

architecture BASIC of DIODE is


function LIM_EXP (ARG: REAL) return REAL is
variable RESULT : REAL; -- result of function

begin
if ARG >

return RESULT;
end function LIM_EXP;

quantity V across I through ANODE to CATHODE;


begin
I == IS*(LIM_EXP(V/VT)-1.0);
end architecture BASIC;

R3.1-3 (Recommendation): All reserved words in VHDL-AMS shall be written lower case.
User-defined identifiers shall be written upper case. Also identifiers of predefined packages
shall be written upper case.

Example
library IEEE;
use IEEE.MATH_REAL.all;
entity BENCH is end entity BENCH;

R3.1-4 (Recommendation): User-defined designations shall be meaningful. Constituent


parts of names shall be separated by underscores. Identifiers are chosen with respect to
their English meaning.

Example
PROGRAM_COUNTER
LEFT_DATA_BUS

R3.1-5 (Recommendation): Identifiers should be named in accordance with table 3.1-1 (see
appendix A). It should be avoided to use names that are reserved words in Verilog (see ap-
pendix D).

Version 2.0 -6- June 11, 2008


VHDL-AMS Modeling Guidelines

Tabelle 3.1-1: Recommendation for naming conventions of identifiers

Object Rule for identifier Example


entity If it makes sense, the name should end with QTRPF_VDA
_VDA
architecture The following identifiers are recommended

BASIC plainest basic model


EXTENDED e. g. models that switch
between different parts
PRECISION consideration of secondary
effects
SPECIAL other models that consider
special effects

type, subtype User-defined types and subtypes should end DATA_TYP


with _TYP
package Identifiers of user-defined packages should package

INT_64_BIT_PKG is

end with _PKG


signal Identifiers should start in the case of S_1
internal signals with S_ ,
input signals with S_IN_ ,
output signals with S_OUT_ .

quantity Identifiers of free quantities should start in Q_IN_1, Q_IN_2, ...


the case of
General continuous waveforms with Q_ ,
nonconservative input ports with Q_IN_ ,
nonconservative output ports with Q_OUT_
terminal Nature ELECTRICAL: EL_1
Identifiers should start with EL_
nature TRANSLATIONAL: MT_BEAM
Identifiers should start with MT_
nature ROTATIONAL: MR_78
Identifiers should start with MR_
nature TRANSLATIONAL_VELOCITY: MTV_IN
Identifiers should start with MTV_
nature ROTATIONAL_VELOCITY: MRV_VEHICLE
Identifiers should start with MRV_
nature MAGNETIC:
Identifiers should start with MA_
nature THERMAL: TH_1
Identifiers should start with TH_
nature RADIANT (optisch):
Identifiers should start with OP_
Further recommendations
- hydraulic terminals: HY_
- pneumatic terminals: PN_
- acoustic terminals: AC_

Version 2.0 -7- June 11, 2008


VHDL-AMS Modeling Guidelines

R3.1-6 (Recommendation): Design units should be stored in separate files. The file names
should be chosen in accordance with the following table [1].

Design unit Naming convention for file name


entity entityName.vhd
and possibly associated architectures
architecture entityName-architectureName.vhd
package header packageName.vhd
package body packageName-body.vhd

3.2 Annotation
R3.2-1 (Requirement): The comments have to be in English. The code has to start and stop
with the disclaimers (see R3.2-2). The start disclaimer has to be followed by the introduc-
tionary comment. Other comments have to be placed ahead the concerning statement.

3.2.1 Disclaimer
R3.2-2 (Requirement): At the beginning of a VHDL-AMS model the first disclaimers given in
appendix B has to be included. It must be followed by the comment for the file header (see
Appendix C). The model description must end with the second disclaimer shown in Appendix
B.

Note

After the comment for the file header the introductionary comment must follow.

3.2.2 Introductionary Comment


R3.2-3 (Requirement): The introductionary comment starts with --/** end ends with --*/
Between start and end string the comments should follow the rules from Table 3.2-1.

Note

The comments are used to generate the model documentation automatically. Thus, the rules
should be applied carefully to avoid problems during the generation of the documentation.
Explanations are given in table 3.2-1.

Keywords to structure the comments start with a @ sign.


Each line must start with --that characterize a comment.

There are currently some known limitations of the generation tool. To avoid problems the
hints in Table 3.2-1 should be considered.

Version 2.0 -8- June 11, 2008


VHDL-AMS Modeling Guidelines

Table 3.2-1: Introductionary Comment between --/** and --*/

Purpose Description
Title The first line of the comment is interpreted as title. It must
end with a point (.)

Example
-- SPICE-like Model of a Resistor.

Note:
Avoid double quotes and points in the title.
Description After the title the description follows. It ends at the next
keyword that starts with an @.

The readability of the documentation can be improved by


using HTML tags;

<p> tag to describe a section:


<p> text </p>

<pre> tag to describe a code section


<pre> code </pre>

<table> tag to describe a table with


• <thead> tag to describe the header
o <tr> tag to describe a row
o <th> tag to describe a column in a row
• <tbody> tag to describe the body
- <tr> tag to describe a row
- <td> tag to describe a column in a row

Example
-- <p>The following context clause should
-- be included:</p>

-- <pre>
-- library IEEE;
-- use IEEE.MATH_REAL.all;
-- </pre>
@generic After this keyword the description the identifier of generic
parameter and its description may follow. The unit of the
parameter must be included in brackets [ ]. For the abbre-
viation of units see Table 3.2-3.

Example
-- @generic FBRAKE Braking force [N]

Note
• The identifier has to be written in the same way as it is
written in the VHDL-AMS code.
• Restrictions of parameters should be explained using
passive concurrent assert statements in the entity
declaration.

Version 2.0 -9- June 11, 2008


VHDL-AMS Modeling Guidelines

@port After this keyword the description the identifier of a port


may follow.

Example
-- @port EL_VCC Electrical terminal

Notes
• The identifier has to be written in the same way as it is
written in the VHDL-AMS code of the model.
• Directions in and out should be added using lower
letters to describe signal and quantity ports.
• Avoid squared brackets [ ] in the description.

@test The name of the file with the test.bench in the subdirectory
tb may follow (without .vhd extension).

Note
The structure of a model subdirectory is shown in Table
4.2-1.

Example
The model is saved in the file res.vhd in the subdirectory
src. The test-bench is saved in the corresponding subdi-
rectory in bench_res.vhd. Thus include in res.vhd

-- @test bench_res
@reference .The reference description should follow.

Example
-- @reference Isermann, R.:
-- Fahrdynamik-Regelung.
-- Vieweg-Verlag, 2006.
@author The name(s) of the authors may follow.

Notes:

• The order of the keyword comments is arbitrary.

• There are special rules to comment package headers (see section 3.6).

• The units of parameters should be used in accordance with the tables 3.2-2 to 3.2-4. Units
that are derived from basic units should be composed using the multiplication sign “*“ or
the power sign “^” (compare [6]).

Examples

Usual notation: Nm, m2


Notation in the comments: N*m, m^2

Version 2.0 -10- June 11, 2008


VHDL-AMS Modeling Guidelines

Table 3.2-2: Abbreviation of Units

Unit Abbreviation (see [5])


Joule J
Watt W
Volt V
Coulomb C
Ohm Ohm
Weber Wb
Tesla T
Henry H
radian rad
Newton N
second s
kilogram kg
candela cd
lumen lm
Kelvin K
Pascal P

Table 3.2-3: Operators to Compose Units

Operator Operator sign


Multiplication *
Division /
Exponentiation ^

3.2.3 Entity declararion

R3.2-4 (Requirement): Generic parameters should be declared in separate lines.

R3.2-5 (Requirement): Ports should be declared in separate lines.

Example

library EXAMPLE_ECAR;
library IEEE;
use IEEE.ELECTRICAL_SYSTEMS.all;

entity BATTERY is
generic (
SOC_0 : REAL := 0.71
);
port (
terminal EL : ELECTRICAL;
quantity SOC : out REAL
);
begin
assert (SOC_0 > 0.0);
assert (SOC_0 <= 1.0);
end entity BATTERY;

Version 2.0 -11- June 11, 2008


VHDL-AMS Modeling Guidelines

3.2.4 Annotation of Model Descriptions

R3.2-6 (Recommendation): Data objects should be described after their declaration.

Example
constant VT : REAL := PHYS_K*AMBIENT_TEMPERATURE/PHYS_Q; -- temperature voltage

R3.2-7 (Recommendation): Comments shall immediately be followed by the concurrent,


sequential, and/or simultaneous statements they describe. Single concurrent, sequential,
and simultaneous statements (and their descriptive comments) shall be separated by two
blank lines. Groups of statements and declarations that belong together shall be separated
by one blank line

Example
-- Clock generator
CLOCK <= not CLOCK after 5 ns;

-- State Transition
process (CLOCK) is
begin
STATE <= NEW_STATE;
end process;

-- Decode the instruction


STATEMENT;
STATEMENT;

3.3 Error Messages

R3.3-1 (Requirement):The hints concerning the usage and design of error messages given
in table 3.3-1 have to be taken into account.

Table 3.3-1: Design of error messages (see also [2], p. 8)

Severity level Comment


ERROR Serious error that allows the continuation of the simula-
tion only in exceptional cases. Examples:
- Violation of time conditions
- Violation of the range of parameters
WARNING Error that can implicate an erroneous behavior of the
model. The simulation can be continued in general.
Examples:
- Exceed or undershoot of recommended limits
NOTE Important hint

Version 2.0 -12- June 11, 2008


VHDL-AMS Modeling Guidelines

Error messages can be arranged using the assert or report statement. The messages should
be constructed in the following way:

• The message starts with the severity level in upper cases followed by a colon, e. g.
ERROR:
• A short description of the problem follows. This should not exceed one line.
• The full path name to the model using the attribute ´INSTANCE_NAME should be in-
cluded in the error message if possible.

The severity levels FAILURE and ERROR cause in general the termination of the simulation.
Warnings and hints should be applied economically.

Error numbers are not used.

3.4 Hints to Layout Design of Models

R3.4-1 (Recommendation): VHDL-AMS source layout should consider the following rules:

• Declarative regions and blocks of statements shall be intended by 2 spaces.


• Lines shall not exceed 80 characters in length.
• The TAB character shall not be used to indent. Only use the SPC character.
• Named association shall be used preferable to positional association.
• process statements and loop statements shall be labeled.
• Arrays of digital signals shall be preferable declared in descending direction (range
downto).
• Variable-width ports shall be constrainted using generics.

Example

entity EXAMPLE is
generic (N: NATURAL -- number of elements in the array MIN: 0
);
port (S : out BIT_VECTOR (N downto 1) -- output of signal generator
);
end entity EXAMPLE;

• No space shall preceed the signs “(“, “)“, “;“ and “,“. No space shall surround a single
quote or dot.

3.5 Limitations

R3.5-1 (Requirement): In accordance with the current coverage of the VHDL-AMS language
by the implementation of different EDA vendors the language constructs given in table 3.5-1
should be avoided.

Version 2.0 -13- June 11, 2008


VHDL-AMS Modeling Guidelines

Table 3.5-1: Language constructs that should be avoided

VHDL-AMS Language constructs Comment


configuration
two and multi-dimensional arrays
data objects of type access see [5], section 3.3
data objects of type record The usage of the type COMPLEX declared in
the package MATH_COMPLEX of the IEEE
library is possible.
noise source see [5], section 4.3.1.16
nature arrays see [5], section 3.6.2.1
nature records see [5], section 3.6.2.2
simultaneous case statement see [5], section 15.3
simultaneous procedural statement see [5], section 15.4
tolerance aspect In many simulators the tolerance aspect is not
supported. From the language point of view in
some cases tolerance aspects may be re-
quired in simultaneous statements by the stan-
dard ([5], section 15.1). If a problem occurs
because of missing tolerance aspects VHDL-
AMS compiler directives should be modified.
generate
wait for real_time_expression Real expressions are allowed but not sup-
ported by all simulation engines.

Note:
A real number can be converted to a number
of type TIME by multiplication with (1 sec):
wait for real_expression*(1 sec);

The usage of the following language construct is subject to restrictions:

• break:
The definition of initial conditions using the break statement should be avoided.

The requirements concerning tool dependent restrictions will be updated from time to time.

3.6 Documentation

A HTML documentation will be generated. This is possible if the requirements from section 3
are taken into account. The HTML document contains a link to the associated source code.

3.6.1 Entity Declaration

The following information will be documented if possible and necessary:

• entity-Name
• Symbol
• Generic parameters with

Version 2.0 -14- June 11, 2008


VHDL-AMS Modeling Guidelines

o Identifier
o Typ
o Default-Wert
o Unit
o Description
o Assertions (if report is available)

• Ports
o Kind of (signal | terminal | quantity)
o Identifier
o Nature or type
o Mode (only for signal and quantity ports: in| out | inout)
o Description

• Description (see Table 3.2-1)


o Short description of functionality and limitations of the model

• References
• Libraries and design units/design entities that support the model

3.6.2 Architecture

The following information will be documented if possible and necessary

• Name of the architecture


• Title of the description
• Description (see Table 3.2-1)
o Short description of functionality and limitations of the model.
• References
• Libraries and design units/design entities that support the model

If entity and architectures are stored in the same file the descriptions (sections 3.6.1 and
3.6.2) are combined in one document. This is usually applied.

3.6.3 Package

The following information will be documented if possible and necessary

• Name of the package and title


• Title of the description
• Description (see Table 3.2-1)
o Short description of functionality
• References
• Libraries and design units/design entities that support the model

There special facilities to comment

• constants
• functions
that are declared in a package header (see Table 3.6-1).

Version 2.0 -15- June 11, 2008


VHDL-AMS Modeling Guidelines

Table 3.6-1 Declaration of constants and functions in a package header declaration

Purpose Description
constant In front of a constant declaration add:

--/**
-- Headline that ends with.
-- Description
--
--*/

Example
--/**
-- Air density.
-- The value describes the air density.
--*/

constant AIR_DENSITY : REAL := 1.2;

function In front of a function declaration should be included:

--/**
-- Headline that ends with.
-- Description
--
-- @arg Identifier1 Description
-- @arg Identifier2 Description
-- @return Description of return value
--
--*/

Example

--/**
-- MIN Function.
-- The function determines the minimum
-- of two INTEGER numbers.
--
-- @arg VALUE_1 First argument
-- @arg VALUE_2 Second argument
-- @return Minimum of both values
--*/

function MIN (VALUE_1, VALUE_2 : INTEGER)


return INTEGER;

Version 2.0 -16- June 11, 2008


VHDL-AMS Modeling Guidelines

4 Administration of the Model Library


4.1 Installation of the Library
The files that constitute the model libraries are stored in a SubVersion-Repository [9]. The
access to the files is password protected.

Table 4.1-1: WWW addresses of the library for development purposes

WWW address Comment


http://projects.eas.iis.fraunhofer.de/vdalibs Central access (Documentation, Subversion
Repository, Downloads)
http://svn.eas.iis.fraunhofer.de/view/vdalibs Subversion Repository
with WWW Version Control
http://svn.eas.iis.fraunhofer.de/vdalibs Subversion Repository
http://projects.eas.iis.fraunhofer.de/vdalibs/ Documentation
nightly/vdalibs/doc

The repository contains

• Separate directories for each logical (FUNDAMENTALS_VDA, SPICE2VHD,


AUTOMOTIVE_VDA, … )
• Each of these directories is structured again (see Appendix A)
• At the lowest level the models are saved in accordance with Table 4.2-1

The administration of the accounts is done by the SVN repository administrator. The respon-
sibility is appointed by the working group.

At the root level of the SVN repository there exists

• a subdirectory libs that contains scripts and information concerning the compilation
of the libraries

4.2 Transfer of Models


For each model, a subdirectory named by the entity or package identifier has to be created.
All of these model subdirectories have the same structure. They consist of

• src subdirectory that contains the source code of the model


• symbol subdirectory that contains symbol information
• doc subdirectory that contains the generated model documentation
• tb subdirectory that contains testbenches

The model developer shall deliver

• file <model>.vhd that contains the VHDL-AMS source code and follows the rules
given in this document
• file <model>.png that contains the symbol information

Note
A proposal for a general symbol format [13] that will replace the png files if supported by the
EDA vendors.

Version 2.0 -17- June 11, 2008


VHDL-AMS Modeling Guidelines

For verification, the following files have to be delivered

• <bench>.vhd with a (simple) testbench that demonstrates the usage of the model
• <bench>.jpg with results of testbench simulation
• README file that contains
- summary files that have to be compiled to run the testbench (i. e. a list of logical
target library identifiers and appropriate files)
- Spice commands that specify simulation parameters (HMIN, HMAX, EPS, …)
- description of output nets

These files have to be integrated in the SVN respository as shown in table 4.2-1. This inte-
gration can be done by the SubVersion repository administrator or the model developer.

Table 4.2-1: Structure of a model subdirectory

Subdirectory File Comment


src <model>.vhd VHDL-AMS source code. This file should follow
the rules of this document.
symbol <model>.png File with model symbol.
Preferable size: 100x100 Pixel
doc <model>.xml Generated XML file with model description
doc <model>.html Generated HTML file with model description
tb <bench>.vhd Testbench for the model <model>.vhd. This file
should follow the rules of this document.
tb/subdirectory Tool-dependent testbenches. Subdirectory name
in accordance with appendix E
tb/doc README Hints how to run the testbench <bench>.vhd
(optional).
tb/doc <bench>.jpg Simulation results (plot)

Tool-dependent versions of the source code and the testbench or additional material can be
stored in subdirectories of src and tb. The names of the subdirectories are chosen w.r.t. the
tools in accordance to appendix E.

At the root level there exists

• a subdirectory libs with a file vhdlfilelist_ordered

4.3 Organization of the Model Development Process


After verification of a model by the developer and a second person it will be made available
to the members of the working group AK 30. Afterwards, the following steps are carried out:

• Modification proposals are sent to the model author.


• The model author or the SubVersion repository administrator carry out modifications.
• After request of the author, the working group decides whether the model can be
made available for general use.
• General available versions of the model libraries will be updated from time to time.

Tool developers will be asked to make tool-dependent modifications.

Version 2.0 -18- June 11, 2008


VHDL-AMS Modeling Guidelines

4.4 Corrections of Models of the General Library


Modification proposals of the general available library are collected by the working group. A
special mail address will be created for this purpose.
The working group decides about updates of the model libraries.

References
[1] Bergeron, J.: Guidelines for Writing VHDL Models in a Team Environment.
Available: http://www.eda.org/misc/ModelingGuidelines.paper.ps
[2] Creasey, R.; Coirault, R.: VHDL Modelling Guidelines. estec European Space Re-
search and Technology Centre, Issue 1, September 1994.
Available: http://www.eda.org/misc/esa.model.guidelines/ModelGuide.ps
[3] VHDL Modelling Guidelines. Simulation and Documentation Aspects.
Second Draft, 23 February 1997.
[4] Model Specification Process Standard. Surface Vehicle Standard SAE J 2546.
February 2002. Informationen verfügbar über (Suchwort J2546):
Available: http://www.sae.org
[5] IEEE Std. 1076.1: IEEE Standard VHDL Analog and Mixed-Signal Extensions.
Approved 15 November 2007.
Available (1999 version): http://www.designers-guide.com/Modeling/1076.1-1999.pdf
[6] IEEE Std. 1076.1.1: Standard VHDL Analog and Mixed-Signal Extensions –
Packages for Multiple Energy Domain Support. Approved 5 April 2005.
[7] Verilog-AMS Language Reference Manual: Analog & Mixed-Signal Extensions
to VerilogHDL, Version 2.2, November 2004. Accellera.
Available: http://www.designers-guide.com/VerilogAMS/VlogAMS-2.2-pub.pdf
[8] Fedder, G.: Issues in MEMS Macromodeling. Proc. 2003 Int. Workshop on Behavioral
Modeling and Simulation BMAS, October 7-8, 2003, San Jose, pp. 64-89.
Available: http://www.bmas-conf.org/2003/papers/bmas03-fedder.pdf
[9] Version Control System SubVersion
Available: http://subversion.tigris.org
[10] SubVersion client TortoiseSVN
Available : http://tortoisesvn.tigris.org
[11] Standardizaition of library blocks for graphical model exchange. Version 1.12.
Manufacturer Supplier Relationship (MSR) Working group.
Available: http://www.msr-wg.de/megma/downlo.html
[12] Modelica Libraries.
Available : http://www.modelica.org/libraries
[13] Symbol Exchange with SVG (Version 10, January 24, 2008)
URL: http://fat-ak30.eas.iis.fraunhofer.de/exchange/index_de.html

Version 2.0 -19- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix A

Definition of the Library Structure

-- library: FUNDAMENTALS_VDA Library name


-- structure: domains/electrics/capacitor Path to the model (here: domains/electrics)
-- name: Capacitor Short name of the model

Structure of the Model Library FUNDAMENTALS_VDA


fundamentals_vda
domains
electrics

magnetics
mechanics
position_force
translational
rotational
transducer energy transducer (translational↔rotational)
velocity_force
translational_v
rotational_v
transducer_v energy transducer (translational↔rotational)
thermal
hydraulics
pneumatics
acoustics
optics
transducer Energy transducer for physical domains
(simple models of heterogeneous systems like motor, ...)
control_systems time-continous transfer blocks
discrete_systems time-discrete transfer blocks
digital_systems digital blocks (gates, flip flops etc.)
data_conversion conversion between different waveform representations
a2s_vda converter (analog quantities to signals)
s2a_vda converter (signals to analog quantities)
s2s_vda converter (conversion between different signal
representations)
time_sources time continous waveform generators (non-conservative)
functions characteristics, sets of characteristic curves
table_look_up
algorithm e. g. mathematical functions
preliminary non standard packages

Version 2.0 -20- June 11, 2008


VHDL-AMS Modeling Guidelines

Structure of the Model Library SPICE2VHD

general general models (R, L, C, sources, ...)

semiconductor semiconductor models

Structure of the Model Library AUTOMOTIVE_VDA


general general models
sources independent signal sources
loads general loads

electrical_system models for powernet simulation


energy_supply energy supply
fuses automotive fuses
lines automotive lines
relais relays
lamps automotive lamps
energy_loads loads for powernet simulation

transducer electrical-nonelectrical transducers


sensors sensors
actuators actors

Recommendation for Naming of Ports and Internal Objects


Conservative terminals:

In general, an identifier consists of the first two letters of the corresponding domain followed
by an underscore and a number if it makes sense. An exception should be made in the case
of mechanical terminals. The first letter is an “M”. The second letter is either a “T” (transla-
tional) or an “R” (rotational). The third letter is a “V” if the velocity-force-analogy is used.

EL_1, EL_2, . . . elektrical terminal


MT_1, MT_2, . . . mechanical translational terminal (position-force representation)
MR_1, MR_2, . . . mechanical rotational terminal (angle-torque representation)
MTV_1, MTV_2, . . . mechanical translational terminal (velocity-force representation)
MRV_1, MRV_2, . . . mechanical rotational terminal (angular velocity-torque represent.)
MA_1, MA_2, . . . magnetic terminal
TH_1, TH_2, . . . thermal terminal
HY_1, HY_2, . . . hydraulic terminal
PN_1, PN_2, . . . pneumatic terminal
AC_1, AC_2, . . . acoustic terminal

Version 2.0 -21- June 11, 2008


VHDL-AMS Modeling Guidelines

signals (time-discrete)

S_1, s_2, . . . no special direction, internal signals (in, out)


S_IN_1, S_IN_2, . . . inputs
S_OUT_1, S_OUT_2, . . . outputs

quantities / nonconservative connection points (time-continuous):

Q_1, Q_2, . . . no special direction, internal signals (in, out)


Q_IN_1, Q_IN_2, . . . inputs (in)
Q_OUT_1, Q_OUT_2, . . . outputs (out)

OP_1, OP_2, . . . optical port (optical power)

Recommendations for Naming of Architectures


BASIC very simple basic model
EXTENDED e. g. models that switch between different parts
PRECISION consideration of secondary effects
SPECIAL further models with some special effects

Version 2.0 -22- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix B
Disclaimer for File Header
-------------------------------------------------------------------------------
-- Copyright (c) 2004 VDA / FAT
--
-- This model is a component of the open source library created by the VDA / FAT
-- working group number 30 and is covered by this license agreement .
-- This model including any updates, modifications, revisions, copies, and
-- documentation are copyrighted works of the VDA / FAT.
-- USE OF THIS MODEL INDICATES YOUR COMPLETE AND
-- UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS
-- SET FORTH IN THIS LICENSE AGREEMENT.
-- The VDA / FAT grants a non-exclusive license to use, reproduce,
-- modify and distribute this model under the condition, that:
-- (a) no fee or other consideration is charged for any distribution except
-- compilations distributed in accordance with Section (d) of this license
-- agreement
-- (b) the comment text embedded in this model is included verbatim
-- in each copy of this model made or distributed by you, whether or not such
-- version is modified
-- (c) any modified version must include a conspicuous
-- notice that this model has been modified and the date of modification; and
-- (d) any compilations sold by you that include this model must include a
-- conspicuous notice that this model is available from the VDA / FAT in its
-- original form at no charge.
--
-- THIS MODEL IS LICENSED TO YOU "AS IT IS" AND WITH NO WARRANTIES,
-- EXPRESSED OR IMPLIED. THE VDA / FAT AND ALL COMPANIES CONTRIBUTING
-- TO THIS LIBRARY SPECIFICALLY DISCLAIM ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-- THE VDA / FAT AND ALL COMPANIES ORGANIZED WITHIN MUST NOT
-- HAVE ANY RESPONSIBILITY FOR ANY DAMAGES, FINANCIAL OR LEGAL CLAIMS
-- WHATEVER.
-------------------------------------------------------------------------------

Disclaimer for File End


-------------------------------------------------------------------------------
-- Copyright (c) 2004 VDA / FAT
-------------------------------------------------------------------------------

Version 2.0 -23- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix C
Comment for File Header
-- ----------------------------------------------------------------
-- Source:
-- <File name>
--
-- Development simulator:
-- <Simulator and version>
--
-- Tested on:
-- ------------------------------------------------------------------
-- Model Vers. Simulator Version OS Validator Date
-- ------------------------------------------------------------------
-- 1.0 …
--
-- Modification History:
-- ------------------------------------------------------------------
-- Version Author Date Description
-- ------------------------------------------------------------------
-- 1.0 N.N. ...... Original version
--
--
--
--
-- ------------------------------------------------------------------
-- $Version$
-- $Revision$
-- $Date$
-- $Author$
-- ------------------------------------------------------------------

Notes

Marker Description
-- Source: Name of the file with the model.
-- Development simulator:Simulator name follows in the next line.
-- Tested on: The description of the validation of the model has to be
-- ----------------------done in accordance with appendix C. The comment starts
-- Model Version … ....
-- ----------------------in the next line:
- Version of the model
- Simulator
- Simulator Version
- Operating system (version, release)
- Validator
- Date in the form YYYY/MM/DD
-- Modification History: The description of the modification history of the model
-- ----------------------- has to be done in accordance with appendix C. The com-
-- Logical Library ....
-- ----------------------- ment starts in the next line:
- Version of the model
- Author of the model
- Date in the form YYYY/MM/DD
- Comment
-- ----------------------- Variables for version control
-- $Id$
-- -----------------------

Version 2.0 -24- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix D
Reserved Words in VHDL-AMS [5]

Version 2.0 -25- June 11, 2008


VHDL-AMS Modeling Guidelines

Reserved Words in Verilog [7]

Version 2.0 -26- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix E
Subdirectory Names

Tool Current Version EDA Vendor Identifier for


subdirectory
ADVance MS Mentor Graphics ADMS
AMS Designer Cadence AMSDesigner, dfII
FTL Systems Tools FTL Systems FTL
Simplorer ANSOFT SIMPL
SystemVision Mentor Graphics SV
SaberHDL Synopsys SaberHDL
SMASH Dolphin Smash

Version 2.0 -27- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix F
Administration of Models

Generation of tool-dependent
libraries by the EDA vendors

AK 30
Feedback
To author Feedback to
one AK address

At the instigation of At the instigation of


the author the author

SVN-Server WWW-Account WWW-Account


for (general)
AK30 Members

Version 2.0 -28- June 11, 2008


VHDL-AMS Modeling Guidelines

Appendix G
VHDL-AMS Model Example

-- ----------------------------------------------------------------------------
-- Copyright (C) 2004-2006 VDA/FAT
--
-- This model is a component of the open source library created by the VDA/FAT
-- working group number 30 and is covered by this license agreement. This model
-- including any updates, modifications, revisions, copies, and documentation
-- are copyrighted works of the VDA/FAT. Use of this model indicates your
-- complete and unconditional acceptance of the terms and conditions set forth
-- in this license agreement.
--
-- The VDA/FAT grants a non-exclusive license to use, reproduce, modify and
-- distribute this model under the condition, that:
-- (a) no fee or other consideration is charged for any distribution except
-- compilations distributed in accordance with Section (d) of this license
-- agreement;
-- (b) the comment text embedded in this model is included verbatim in each
-- copy of this model made or distributed by you, whether or not such
-- version is modified;
-- (c) any modified version must include a conspicuous notice that this model
-- has been modified and the date of modification; and
-- (d) any compilations sold by you that include this model must include a
-- conspicuous notice that this model is available from the VDA/FAT in
-- its original form at no charge.
--
-- THIS MODEL IS LICENSED TO YOU "AS IT IS" AND WITH NO WARRANTIES, EXPRESSED
-- OR IMPLIED. THE VDA/FAT AND ALL COMPANIES CONTRIBUTING TO THIS LIBRARY
-- SPECIFICALLY DISCLAIM ALL IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
-- FOR A PARTICULAR PURPOSE. THE VDA/FAT AND ALL COMPANIES ORGANIZED WITHIN
-- MUST NOT HAVE ANY RESPONSIBILITY FOR ANY DAMAGES, FINANCIAL OR LEGAL CLAIMS
-- WHATEVER.
-- ------------------------------------------------------------------------
-- Source:
-- capacitor.vhd
--
-- Development simulator:
-- SimulatorA
--
-- Tested on:
-- ------------------------------------------------------------------
-- Version Simulator Version OS Validator Date
-- ------------------------------------------------------------------
-- 1.1 SimulatorA 1.0 W2000 Mustermann_1 2004/07/05
-- 1.1 SimulatorB 4.1 W2000 Mustermann_2 2005/01/10
--
-- Modification History:
-- ------------------------------------------------------------------
-- Version Author Date Description
-- ------------------------------------------------------------------
-- 1.1 Mustermann_3 2004/07/05 Original Version
--
--
-- ----------------------------------------------------------------------------
-- $Version: 2.0.0 $
-- $Revision: 2135 $
-- $Date: 2007-05-14 16:35:43 +0200 (Mo, 14 Mai 2007) $
-- $Author: andre $
-- ----------------------------------------------------------------------------

--/**
--
-- Spice Capacitor Model.
-- The model describes an ideal capacitor in the same way as in Spice
-- (SPICE3 Version 3f3 User's Manual 3.1.5).
--
-- @generic C capacitance [F]
-- @generic IC (optional) initial condition [V]
--
-- @port P plus terminal
-- @port N minus terminal
--
-- @library SPICE2VHD
-- @structure general/basic
-- @test basic_test

Version 2.0 -29- June 11, 2008


VHDL-AMS Modeling Guidelines

-- @reference T. Quarles et al: SPICE3 Version 3f3 User's Manual.


-- University of California, May 1993.
-- @reference Verilog-AMS Language Reference Manual.
-- Analog & Mixed-Signal Extensions to VerilogHDL.
-- Version 2.1, January 20, 2003.
--
--*/

library IEEE;
use IEEE.ELECTRICAL_SYSTEMS.all;

entity CAPACITOR is
generic (
C : REAL;
IC : REAL := REAL'LOW
);
port (
terminal P : ELECTRICAL;
terminal N : ELECTRICAL
);
end entity CAPACITOR;

architecture SPICE of CAPACITOR is


quantity V across I through P to N;
begin
if DOMAIN = QUIESCENT_DOMAIN and IC /= REAL'LOW use
V == IC;
else
I == C*V'DOT;
end use;
end architecture SPICE;

-- ------------------------------------------------------------------------
-- Copyright (C) 2004-2006 VDA/FAT
-- ------------------------------------------------------------------------

Version 2.0 -30- June 11, 2008

You might also like