1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
This file is part of adms - http://sourceforge.net/projects/mot-adms.
adms is a code generator for the Verilog-AMS language.
Copyright (C) 2002-2012 Laurent Lemaitre <r29173@users.sourceforge.net>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE admst PUBLIC "-//adms//DTD admst 2.0//-" "http://mot-adms.sourceforge.net/xml-files/adms/admst.dtd">
<!--
Usage: admsXml -e attributes.xml
This example gives some hints on how to use Verilog-AMS attributes.
-->
<!--
$Id: attributes.xml 1102 2008-10-03 14:09:22Z r29173 $
$Log$
Revision 1.1 2006/03/28 13:22:34 r29173
initial import
Revision 1.4 2006/03/23 07:51:39 r29173
fixed bug in computation of ddx
-->
<admst version="2.3.0" xmlns:admst="http://mot-adms.svn.sourceforge.net/viewvc/*checkout*/mot-adms/trunk/adms/admst.dtd">
<admst:template match=":attribute">
<admst:for-each select="attribute">
<admst:text format="attr: %(name)=%(value)\n"/>
</admst:for-each>
<admst:text format="==============================================\n"/>
</admst:template>
<admst:open file="attributes.va">
`include "disciplines.h"
(* info_before="module info before" *) module mymodule (p,n) (* info_after="module info after" *) ;
(*globalterminal="my terminals"*) inout p, n;
electrical p(*localterm="my p term"*), n(*localterm="my n term"*);
(*globalbranch="my branches"*)branch (p,n) pn;
(*globalwidth="width applies to all parameters"*) parameter real w1=1u (*localwidth="local attribute of width1"*), w2=1u (*localwidth="local attribute of width2"*);
(*globallength="length applies to all parameters"*) parameter real l1=1u (*locallength="local attribute of length1"*), l2=1u (*locallength="local attribute of length2"*);
(*global="my conductances"*) real g1 (*local="this is g1"*),g2 (*local="this is g2"*),g3 (*local="this is g3"*),g4 (*local="this is g4"*);
analog
begin
g1=w1/l1;
g2=w2/l2;
I(p,n)<+g1*V(p,n) (*contrib_attr1="hello1" contrib_attr2="hello2"*);
I(p,n)<+g2*V(p,n) (*contrib1="hello1bis" contrib2="hello2bis" contrib3="hello3" contrib4="hello4"*);
end
endmodule
</admst:open>
<admst:read file="attributes.va"/>
<admst:for-each select="/module">
<admst:apply-templates select="." match=":attribute"/>
<admst:text format="branch\n"/>
<admst:for-each select="branch">
<admst:apply-templates select="." match=":attribute"/>
</admst:for-each>
<admst:text format="node\n"/>
<admst:for-each select="node">
<admst:apply-templates select="." match=":attribute"/>
</admst:for-each>
<admst:text format="variable\n"/>
<admst:for-each select="variable">
<admst:apply-templates select="." match=":attribute"/>
</admst:for-each>
<admst:text format="contribution\n"/>
<admst:for-each select="contribution">
<admst:apply-templates select="." match=":attribute"/>
</admst:for-each>
<admst:text format="source\n"/>
<admst:for-each select="source">
<admst:apply-templates select="." match=":attribute"/>
</admst:for-each>
</admst:for-each>
</admst>
|