Codebase list adms / 202bd848-88dc-493d-8345-b3fab52f3d01/upstream
Import upstream version 2.3.7+git20201211.1.2097728 Debian Janitor 2 years ago
22 changed file(s) with 507 addition(s) and 136 deletion(s). Raw diff Collapse all Expand all
0 image: Visual Studio 2019
01 environment:
12 matrix:
23 - MSYSTEM : MINGW64
2728
2829 ## Build
2930 - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./bootstrap.sh"
30 - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./configure --enable-maintainer-mode --prefix=/c/adms-win%MBITS% --disable-shared"
31 - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && ./configure --prefix=/c/adms-win%MBITS% --disable-shared"
3132 - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make distcheck"
3233 - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make install"
3334
3435 - bash -lc "exec 0</dev/null && /c/adms-win%MBITS%/bin/admsXml -v"
36
37 test_script:
38 - bash -lc "cd $APPVEYOR_BUILD_FOLDER/testcases && ./testADMS.sh /c/adms-win%MBITS%/bin/admsXml.exe"
3539
3640 after_build:
3741 # artifacts path is always relative to build folder, so put the zip there
11
22 sudo: required
33 dist: trusty
4 arch:
5 - ppc64le
6 - AMD64
47
58 compiler:
69 - gcc
2730 - case $BUILD_SYSTEM in
2831 autotools)
2932 ./bootstrap.sh &&
30 ./configure --enable-maintainer-mode --prefix=/usr &&
33 ./configure --prefix=/usr &&
3134 make distcheck &&
3235 sudo make install
3336 ;;
3437 cmake)
3538 mkdir build && cd build &&
36 cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_MAINTAINER_MODE=ON &&
39 cmake .. -DCMAKE_INSTALL_PREFIX=/usr &&
3740 make &&
3841 sudo make install
3942 ;;
2626 PROJECT(ADMS C)
2727 cmake_minimum_required(VERSION 2.8)
2828
29 # TODO: store version in a sensible place
30 # e.g. qucs: file(STRINGS "${qucs-project_SOURCE_DIR}/VERSION" QUCS_VERSION)
31
2932 SET(PACKAGE_NAME "adms")
30 SET(PACKAGE_VERSION "2.3.6")
33 SET(PACKAGE_VERSION "2.3.7")
3134 SET(PACKAGE_BUGREPORT "qucs-bugs@lists.sourceforge.net")
32
33 OPTION ( USE_MAINTAINER_MODE "Enable generation of code (parser source) from Perl scripts." OFF )
3435
3536 # Default to static libs ( shared needs work, BUG with MinGW).
3637 OPTION ( BUILD_STATIC_LIBS "Build static libraries." ON )
5354
5455 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
5556
56 # Only care about Perl in case maintainer needs to recreate sources
57 # Perl is used to recreate sources
5758 # * mkelements.pl
5859 # * mktext.pl
5960 # * mkgrammar.pl
60 if ( USE_MAINTAINER_MODE )
61 # Checking for perl modules requires FindPerlModules.cmake
62 # Check all required modules at once
63 SET(CMAKE_MODULE_PATH "${ADMS_SOURCE_DIR}/cmake/modules")
64 include(FindPerlModules)
65 find_package(PerlModules COMPONENTS XML::LibXML)
66 if(NOT PERLMODULES_FOUND)
67 message(FATAL_ERROR "Not all required perl modules were found on your system")
68 endif(NOT PERLMODULES_FOUND)
69 endif ( USE_MAINTAINER_MODE )
61 # Checking for perl modules requires FindPerlModules.cmake
62 # Check all required modules at once
63 SET(CMAKE_MODULE_PATH "${ADMS_SOURCE_DIR}/cmake/modules")
64 include(FindPerlModules)
65 find_package(PerlModules COMPONENTS XML::LibXML)
66 if(NOT PERLMODULES_FOUND)
67 message(FATAL_ERROR "Not all required perl modules were found on your system")
68 endif(NOT PERLMODULES_FOUND)
7069
7170
7271 find_package(BISON 2.5)
00 adms-2.3.6:
1 * Fix parser for parameter lists in subdevice instanciation.
1 * Fix parser for parameter lists in subdevice instantiation.
22 * Remove duplicated constants on provided headers.
33 * Fix crash on x64 when printing the message about standard headers.
44
1919 * Autotools, add back support for static and shared libraries build.
2020 * Build shared libraries by default. Tested on Linux, Mac OSX, and MSYS2.
2121 See the configure --disable-shared flag to change that.
22 * CMake contiues to builds static libraries only.
22 * CMake continues to builds static libraries only.
2323
2424 * Fix out-of-tree build for Autotools and CMake.
2525
26 * Check scaling factors againd LRM v2.4.0
26 * Check scaling factors against LRM v2.4.0
2727 * Add missing K scaling (uppercase kilo)
2828 * standard scale_factor T|G|M|K|k|m|u|n|p|f|a
2929 * Add testset (va and xml files) to test the scaling factors
4848 * avoid spurious fatal error from an included file which last line contains
4949 onlywhite space.
5050 * preprocessorYacc.y:
51 * fix BSIM6 parse problem, string macro arg broken by continuator
51 * fix BSIM6 parse problem, string macro arg broken by line continuation
5252 caused 'unexpected end-of-line' error.
5353 * verilogLex.l:
5454 * Change string recognition to allow embedded \" as literal quote
9393 mica: same c code as 1.1.8
9494 03-05-2005: removed admsNS directory
9595 release adms-2.0.1
96
97
98
96 ===== gap ====
97 21-11-2016: 2.3.6
98 **-08-2020: 2.3.7. minor release.
99 reproducible build, typo fixes,
100 include path, instructions
3838 - GNU Flex
3939 - GNU Bison (tested with 2.5+)
4040 - GNU Libtool
41 - Perl with XML::LibXml (only for maintainers)
41 - Perl with XML::LibXml
4242 - GD modules to manually update documentation images
4343
4444 Installing dependencies on Linux Debian/Ubuntu:
5757
5858 #### Compilation Using Autotools
5959
60 The `--enable-maintainer-mode` makes sure the required files are generated (using Perl and LibXml).
60 Use the default commands to compile, generate files and install.
6161
6262 sh bootstrap.sh
63 ./configure --enable-maintainer-mode
63 ./configure
6464 make install
6565
6666 Autotools it currently used for creating release packages, the `adms-x.x.x.tar.gz` source code archive.
6767
6868 sh bootstrap.sh
69 ./configure --enable-maintainer-mode
69 ./configure
7070 make clean
7171 make dist
7272
7373 #### Compilation Using CMake
7474
75 The `-DUSE_MAINTAINER_MODE=ON` makes sure the required files are generated (using Perl and LibXml).
76
7775 mkdir cmake; cd cmake
78 cmake .. -DUSE_MAINTAINER_MODE=ON -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/install/location/
76 cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/install/location/
7977 make install
8078
8179 Packaging is not yet supported with CMake. At the moment, only static libraries can be build with CMake.
8280
83
8481 ### Users Install from Tarball
8582
8683 This section is relevant in case ADMS is compiled from a source code archive (`adms-x.x.x.tar.gz`).
87 Users should be able to build without Perl (and the maintainer required modules XML::LibXml and GD).
8884
8985 #### Compilation Using Autotools
9086
10096 mkdir build; cd build
10197 cmake .. -DCMAKE_INSTALL_PREFIX=[/install/location/]
10298 make install
99
100
101 #### Building an RPM
102
103 Go through all the aclocal/automake/configure process to ensure you have all the dependencies installed.
104
105 Chances are you will need to install these packages: gcc-c++ flex bison libtool libtool-ltdl-devel
106
107 Then rename the ADSM directory to ADSM-2.3.0 and tar it to make ~/rpmbuild/SOURCES/ADMS-2.3.0.tar.gz
108
109 Then copy the spec file into your rpmbuild/SPECS directory
110
111 Then build with rpmbuild -ba SPECS/adms.spec
103112
104113
105114 ## Credits
188197 3- run: libtoolize --force --ltdl -c (create libltdl and config.guess, config.sub, ltmain.sh in auxconf)
189198 4- run: automake -a -c (create missing, mkinstalldirs, install-sh in auxconf and all Makefile.in)
190199 5- run: autoconf (create configure)
191 6- run: ./configure --enable-maintainer-mode
200 6- run: ./configure
192201 In three shots:
193202 rm -rf auxconf && autoheader && mkdir auxconf && aclocal && libtoolize --force --ltdl -c
194203 touch ChangeLog && automake -a -c && autoconf
195 ./configure --enable-maintainer-mode
196 ```
204 ./configure
205 ```
2121 INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) # for admsPreprocessor.h, amdsVeriloga.h
2222 INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) # for generated source code
2323
24 # Maintainer mode runs the Perl scrips that generate source code
25 if ( USE_MAINTAINER_MODE )
24 # Run the Perl scrips to generate source code
25 # Run mkelements.pl
26 # Read in `adms.xml` and generete portions of adms and admst
27 # Generate outputs:
28 # adms.h
29 # adms.c
30 # admstpathYacc.y
31 # admstpathYacc.h
32 # admstpath.dtd
33 MESSAGE(STATUS "Running mkelements.pl code generator")
2634
27 # Run mkelements.pl
28 # Read in `adms.xml` and generete portions of adms and admst
29 # Generate outputs:
30 # adms.h
31 # adms.c
32 # admstpathYacc.y
33 # admstpathYacc.h
34 # admstpath.dtd
35 MESSAGE(STATUS "Running mkelements.pl code generator")
35 EXECUTE_PROCESS(
36 COMMAND perl ${CMAKE_SOURCE_DIR}/admsXml/mkelements.pl ${CMAKE_SOURCE_DIR}
37 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
38 RESULT_VARIABLE element_result )
39
40 IF(element_result EQUAL 0)
41 MESSAGE(STATUS "mkelement.pl completed successfully")
42 ELSE(element_result EQUAL 0)
43 MESSAGE(FATAL_ERROR "mkelement.pl failed. Exit code: ${element_result}")
44 ENDIF(element_result EQUAL 0)
45
46
47 # Run mkctext.pl
48 # Wrap source files as C code
49 # Generate outputs:
50 # constants.vams.c
51 # disciplines.vams.c
52 # adms.implicit.xml.c
53 # dummy.va.c
54 # dummy.xml.c
55 SET(CTEXT
56 constants.vams
57 disciplines.vams
58 adms.implicit.xml
59 dummy.va
60 dummy.xml )
61
62 FOREACH( inc ${CTEXT} )
63 MESSAGE(STATUS "Running mkctext.pl code generator on ${inc}")
3664
3765 EXECUTE_PROCESS(
38 COMMAND perl ${CMAKE_SOURCE_DIR}/admsXml/mkelements.pl ${CMAKE_SOURCE_DIR}
66 COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkctext.pl ${CMAKE_CURRENT_SOURCE_DIR}/${inc}
3967 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
40 RESULT_VARIABLE element_result )
68 RESULT_VARIABLE text_result )
4169
42 IF(element_result EQUAL 0)
43 MESSAGE(STATUS "mkelement.pl completed successfully")
44 ELSE(element_result EQUAL 0)
45 MESSAGE(FATAL_ERROR "mkelement.pl failed. Exit code: ${element_result}")
46 ENDIF(element_result EQUAL 0)
70 IF(text_result EQUAL 0)
71 MESSAGE(STATUS "mkctext.pl completed successfully")
72 ELSE(text_result EQUAL 0)
73 MESSAGE(FATAL_ERROR "mkctext.pl failed. Exit code: ${text_result}")
74 ENDIF(text_result EQUAL 0)
75 ENDFOREACH()
4776
4877
49 # Run mkctext.pl
50 # Wrap source files as C code
51 # Generate outputs:
52 # constants.vams.c
53 # disciplines.vams.c
54 # adms.implicit.xml.c
55 # dummy.va.c
56 # dummy.xml.c
57 SET(CTEXT
58 constants.vams
59 disciplines.vams
60 adms.implicit.xml
61 dummy.va
62 dummy.xml )
78 # Run mkgrammar.pl
79 # Process verilogaYacc.y.in and generate the parser
80 # Generate output:
81 # verilogaYacc.y
82 #
83 MESSAGE(STATUS "Running mkgrammar.pl code generator")
6384
64 FOREACH( inc ${CTEXT} )
65 MESSAGE(STATUS "Running mkctext.pl code generator on ${inc}")
85 EXECUTE_PROCESS(
86 COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkgrammar.pl ${CMAKE_CURRENT_SOURCE_DIR}/verilogaYacc.y.in
87 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
88 RESULT_VARIABLE grammar_result )
6689
67 EXECUTE_PROCESS(
68 COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkctext.pl ${CMAKE_CURRENT_SOURCE_DIR}/${inc}
69 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
70 RESULT_VARIABLE text_result )
71
72 IF(text_result EQUAL 0)
73 MESSAGE(STATUS "mkctext.pl completed successfully")
74 ELSE(text_result EQUAL 0)
75 MESSAGE(FATAL_ERROR "mkctext.pl failed. Exit code: ${text_result}")
76 ENDIF(text_result EQUAL 0)
77 ENDFOREACH()
78
79
80 # Run mkgrammar.pl
81 # Process verilogaYacc.y.in and generate the parser
82 # Generate output:
83 # verilogaYacc.y
84 #
85 MESSAGE(STATUS "Running mkgrammar.pl code generator")
86
87 EXECUTE_PROCESS(
88 COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/mkgrammar.pl ${CMAKE_CURRENT_SOURCE_DIR}/verilogaYacc.y.in
89 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
90 RESULT_VARIABLE grammar_result )
91
92 IF(grammar_result EQUAL 0)
93 MESSAGE(STATUS "mkgrammar.pl completed successfully")
94 ELSE(grammar_result EQUAL 0)
95 MESSAGE(FATAL_ERROR "mkgrammar.pl failed. Exit code: ${grammar_result}")
96 ENDIF(grammar_result EQUAL 0)
97
98 ENDIF ( USE_MAINTAINER_MODE )
90 IF(grammar_result EQUAL 0)
91 MESSAGE(STATUS "mkgrammar.pl completed successfully")
92 ELSE(grammar_result EQUAL 0)
93 MESSAGE(FATAL_ERROR "mkgrammar.pl failed. Exit code: ${grammar_result}")
94 ENDIF(grammar_result EQUAL 0)
9995
10096 # Issue with flex:
10197 # BISON_TARGET, FLEX_TARGET and ADD_FLEX_BISON_DEPENDENCY
99 # use mkctext.pl to create C files containing the contents of each input file
1010 # in a C character array. The output is used by make check only
1111
12 # Perl XML::LibXml module are only required for maintainer
13 # Parser created by maintainer
14 # BUG: these rules are also required when building from git.
15 # workaround: default to maintainer mode when building from git.
16 if MAINTAINER_MODE
17
1812 $(incfilec):%.c:% ${srcdir}/mkctext.pl
1913 $(PERL) ${srcdir}/mkctext.pl $< $(top_srcdir)
2014
2317
2418 verilogaYacc.y: ${srcdir}/verilogaYacc.y.in ${srcdir}/mkgrammar.pl
2519 $(PERL) ${srcdir}/mkgrammar.pl ${srcdir}/verilogaYacc.y.in
26
27 endif
2820
2921 dist_man_MANS = admsXml.1 admsCheck.1
3022
4032 libadmsPreprocessor_la_LDFLAGS=-no-undefined
4133 libadmsPreprocessor_la_LIBADD=libadmsElement.la
4234
43 verilogYacc.h: verilogYacc.c
35 verilogaYacc.h: verilogaYacc.c
4436 libadmsVeriloga_la_SOURCES=verilogaYacc.y verilogaLex.l verilogaYacc.h
4537 libadmsVeriloga_la_CPPFLAGS=-DinsideVeriloga
4638 libadmsVeriloga_la_LDFLAGS=-no-undefined
5749
5850 admsXml_SOURCES=admsXml.c
5951 admsXml_LDADD=-lm libadmsElement.la libadmsVeriloga.la libadmsPreprocessor.la libadmsAdmstpath.la
52 admsXml_CPPFLAGS=${AM_CPPFLAGS} -DADMS_INCLUDEDIR=\"${pkgincludedir}\"
6053
6154 admsXml.c: adms.implicit.xml.c
6255
154154 <admst:value-to select="dependency" string="nonlinear"/>
155155 </admst:otherwise>
156156 </admst:choose>
157 </admst:when>
158 <admst:when test="[name='\$port_connected']">
159 <admst:value-to select="dependency" string="constant"/>
157160 </admst:when>
158161 <admst:otherwise>
159162 <admst:apply-templates select="arguments" match="e:dependency"/>
190193 name='idt' or
191194 name='ddt' or
192195 name='\$param_given' or
196 name='\$port_connected' or
193197 name='\$given' or
194198 name='ddx' or
195199 name='flicker_noise' or
615615 adms_slist_push(&pproot()->skipp_text,(p_adms)(long)(0));
616616 pproot()->includePath=getlist_from_argv(argc,argv,"-I","directory");
617617 adms_slist_push(&pproot()->includePath,(p_adms)".");
618 #ifdef ADMS_INCLUDEDIR
619 adms_slist_push(&pproot()->includePath,(p_adms)ADMS_INCLUDEDIR);
620 #endif
618621 adms_preprocessor_get_define_from_argv(argc,argv);
619622 adms_preprocessor_define_add_default("insideADMS");
620623 adms_message_verbose(("create temporary file %s\n",mytmpverilogamsfile))
4545 `define M_LN10 2.30258509299404568401
4646 `define P_C 299792458 // m / s
4747 `define P_H 6.62607004081e-34 //planck constant. in \text{ Jâ‹…s}
48 `define P_MU0 1.2566370614e-6 // v. perm. H / m or T·m / A or Wb / (A·m) or V·s / (A·m)
48 `define P_U0 1.2566370614e-6 // v. perm. H / m or T·m / A or Wb / (A·m) or V·s / (A·m)
4949
5050 `endif // CONSTANTS_VAMS
18831883 }
18841884 push @Location03," ENDIFIDENT\n";
18851885 }
1886 foreach(keys(%A))
1886 foreach(sort keys(%A))
18871887 {
18881888 my($aname,$ee)=($_,$A{$_});
18891889 push @Location03," IFIDENT($aname)\n";
7070 die "bisonrule should terminate with ';' - see $_" if(not m/^\s+;$/);
7171 }
7272 }
73 map {print OFH "\%token <_lexval> $_\n";} keys %Token;
73 map {print OFH "\%token <_lexval> $_\n";} sort keys %Token;
7474 print OFH "\n";
7575 map {print OFH "\%type <_yaccval> $_->{name}\n";} @allbisonrule;
7676 print OFH "\n";
11 # Process this file with autoconf to produce a configure script.
22
33 AC_PREREQ(2.61)
4 AC_INIT([adms],[2.3.6],[qucs-devel@lists.sourceforge.net])
4 AC_INIT([adms],[2.3.7],[qucs-devel@lists.sourceforge.net])
55 AC_CONFIG_HEADER([config.h])
66
77 # specific configuration.
2525 AM_INIT_AUTOMAKE([foreign])
2626 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
2727
28 # Maintainer mode is used to detect/run Perl (XML::LibXml) and make dist tarball
29 AM_MAINTAINER_MODE
30
3128 AC_CHECK_PROG(GIT,git,yes)
3229 AC_MSG_CHECKING([for git repo])
33 AS_IF([test x"$GIT" = "xyes" && test -d $srcdir/.git],
34 [have_git_repo=yes
35 AM_MAINTAINER_MODE([enable])],
36 [have_git_repo=no])
37 AC_MSG_RESULT([$have_git_repo])
3830
3931 AX_PROG_FLEX([],[AC_MSG_WARN(Program flex not found (found $LEX))
4032 AC_MSG_ERROR(Please install gnu flex from http://www.gnu.org/software/flex/)])
9688 AC_PROG_LIBTOOL
9789 AC_SUBST([LIBTOOL_DEPS])
9890
99 dnl Perl, XML::LibXML module required for maintainer
100 if test $USE_MAINTAINER_MODE = yes; then
91 dnl Perl, XML::LibXML module required
92 AC_PATH_PROG(PERL, perl, :)
93 if test "$PERL" = ":"; then
94 AC_MSG_ERROR([The $PACKAGE package requires an installed perl.])
95 fi;
10196
102 AC_PATH_PROG(PERL, perl, :)
103 if test "$PERL" = ":"; then
104 AC_MSG_ERROR([The $PACKAGE package requires an installed perl.])
105 fi;
106
107 AX_PERL_MODULE_VERSION([XML::LibXML 2],[],[
108 AC_MSG_RESULT(failed)
109 AC_MSG_ERROR([Perl package XML::LibXML may be downloaded from http://search.cpan.org/dist/libXML])])
110 fi
97 AX_PERL_MODULE_VERSION([XML::LibXML 2],[],[
98 AC_MSG_RESULT(failed)
99 AC_MSG_ERROR([Perl package XML::LibXML may be downloaded from http://search.cpan.org/dist/libXML])])
111100
112101 # Define preprocessor flag for static build (MinGW).
113102 AS_IF([test "x$enable_shared" = "xno"], [
130119 Configure Information:
131120 Host : $host
132121
133 Maintainer mode : $USE_MAINTAINER_MODE
134
135122 C Compiler : $CC
136123 DEFS : $DEFS
137124 CFLAGS : $CFLAGS
0 Name: ADMS
1 Version: 2.3.0
2 Release: 1%{?dist}
3 Summary: code generator that converts electrical compact device models.. transforms Verilog-AMS code into other target languages
4 License: GPL
5 URL: https://github.com/Qucs/ADMS
6 Source0: ADMS-2.3.0.tar.gz
7
8 #BuildRequires:
9 #Requires:
10
11 %description
12
13
14 %prep
15 %setup -q
16
17
18 %build
19 %configure
20 make %{?_smp_mflags}
21
22
23 %install
24 rm -rf $RPM_BUILD_ROOT
25 %make_install
26
27
28 %files
29 %doc
30 %{_bindir}/*
31 /usr/include/adms/*
32 /usr/lib64/*
33 /usr/share/man/man1/*
34
35
36 %changelog
(New empty file)
0 CLEANFILES = discipline.h .*.va.adms .adms.implicit.xml .interface.xml
0 # 1 "./0000_scale_factor.va"
1
2
3
4
5
6 module scaling();
7 parameter integer itera = 1T;
8 parameter integer igiga = 1G;
9 parameter integer imega = 1M;
10 parameter integer iKilo = 1K;
11 parameter integer ikilo = 1k;
12 parameter integer imili = 1m;
13 parameter integer imicro = 1u;
14 parameter integer inano = 1n;
15 parameter integer ipico = 1p;
16 parameter integer ifemto = 1f;
17 parameter integer iatto = 1a;
18
19 parameter integer iexa = 1E;
20 parameter integer ipeta = 1P;
21 parameter integer ihecto = 1h;
22 parameter integer ideca = 1D;
23 parameter integer ideci = 1d;
24 parameter integer icenti = 1c;
25 parameter integer iamgstron = 1A;
26
27 parameter real tera = 1.0T;
28 parameter real giga = 1.0G;
29 parameter real mega = 1.0M;
30 parameter real Kilo = 1.0K;
31 parameter real kilo = 1.0k;
32 parameter real mili = 1.0m;
33 parameter real micro = 1.0u;
34 parameter real nano = 1.0n;
35 parameter real pico = 1.0p;
36 parameter real femto = 1.0f;
37 parameter real atto = 1.0a;
38
39 parameter real exa = 1.0E;
40 parameter real peta = 1.0P;
41 parameter real hecto = 1.0h;
42 parameter real deca = 1.0D;
43 parameter real deci = 1.0d;
44 parameter real centi = 1.0c;
45 parameter real amgstron = 1.0A;
46
47 endmodule
0 # 1 "./0001_operator.va"
1
2
3 # 1 "discipline.h"
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 # 25 "discipline.h"
27
28
29
30 nature current
31 access = I;
32 units = "A";
33 abstol = 0.001234;
34 endnature
35
36
37 nature voltage
38 access = V;
39 units = "V";
40 abstol = 0.0004321;
41 endnature
42
43
44 nature power
45 access = Pwr;
46 units = "W";
47 abstol = 0.00101010;
48 endnature
49
50
51 nature flux
52 access = Phi;
53 units = "We";
54 endnature
55
56
57 nature temperature
58 access = Temp;
59 units = "K";
60 abstol = 3.14;
61 endnature
62
63
64 discipline thermal
65 potential temperature;
66 flow power;
67 enddiscipline
68
69
70 discipline electrical
71 potential voltage;
72 flow current;
73 enddiscipline
74
75 discipline magnetic
76 potential voltage;
77 flow current;
78 enddiscipline
79
80 discipline rotational_omega
81 potential voltage;
82 flow current;
83 enddiscipline
84
85
86
87 # 4 "./0001_operator.va"
88
89 module sometest(p,n);
90 inout p,n;
91 electrical p,n;
92
93 parameter real c=1e-6 from [0:inf);
94 analog begin
95 begin
96 I(p,n) <+ c*ddt(V(n,p)*9);
97 I(p,n) <+ exp(ddt(V(p,n)));
98 end
99 end
100 endmodule
101
102 module anothertest(p,n);
103 inout p,n;
104 electrical p,n;
105
106 parameter real c=1e-6 from [0:inf);
107 analog begin
108 begin
109 real foo; foo = c*idt(exp(V(p,n)));
110 I(p,n) <+ pow(ddt(foo*V(p,n)),2);
111 end
112 end
113 endmodule
0 # 1 "./0002_transition.va"
1
2 module trans();
3
4 real out1, expr1, td, rt, ft, ttol;
5
6 real out2, expr2;
7
8 analog begin
9 out1 = transition(expr1, td, rt, ft, ttol);
10
11 out2 = transition(expr2 - 1.5, td);
12 end
13
14 endmodule
0 # 1 "./0003_subdev.va"
1
2 # 1 "discipline.h"
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 # 25 "discipline.h"
26
27
28
29 nature current
30 access = I;
31 units = "A";
32 abstol = 0.001234;
33 endnature
34
35
36 nature voltage
37 access = V;
38 units = "V";
39 abstol = 0.0004321;
40 endnature
41
42
43 nature power
44 access = Pwr;
45 units = "W";
46 abstol = 0.00101010;
47 endnature
48
49
50 nature flux
51 access = Phi;
52 units = "We";
53 endnature
54
55
56 nature temperature
57 access = Temp;
58 units = "K";
59 abstol = 3.14;
60 endnature
61
62
63 discipline thermal
64 potential temperature;
65 flow power;
66 enddiscipline
67
68
69 discipline electrical
70 potential voltage;
71 flow current;
72 enddiscipline
73
74 discipline magnetic
75 potential voltage;
76 flow current;
77 enddiscipline
78
79 discipline rotational_omega
80 potential voltage;
81 flow current;
82 enddiscipline
83
84
85
86 # 3 "./0003_subdev.va"
87
88 module net(p, n);
89 inout p, n;
90 electrical p, n;
91
92
93 parameter real dummy=1 from [0:inf);
94
95 analog begin
96 begin
97 V(p, n) <+ 0;
98 end
99 end
100 endmodule
101
102 module RESISTOR(p, n);
103 inout p, n;
104 electrical p, n;
105
106 parameter real r=1 from [0:inf);
107 analog begin
108 begin
109 I(p, n) <+ V(p, n) / r;
110 end
111 end
112 endmodule
113
114 module schematic(pp, nn);
115 inout pp, nn;
116 electrical pp, nn;
117 electrical p_int, n_int;
118
119 net #(.dummy(0)) n1(p, p_int);
120 net #(.dummy(0)) n2(n, n_int);
121 RESISTOR #(.r(1)) r1(pp, nn);
122 endmodule
0 #
1 # Request admsXml as argument
2 #
3 if [ -z "$1" ]
4 then
5 echo " Missing path to admsXml executable."
6 echo " Example: $ sh testADMS.sh /usr/local/admsXml"
7 exit 1
8 else
9 ADMSXML=$1
10 echo " Testing admsXml"
11 echo " Using: $ADMSXML"
12 fi
13
14 #
15 # list of all the tests to be run
16 #
17 arrayTest=(
18 0000_scale_factor
19 0001_operator
20 0002_transition
21 0003_subdev)
22
23 # todo
24 srcdir=.
25 #
26 # run admsXml and check output against reference
27 #
28 for test in "${arrayTest[@]}"
29 do
30 $ADMSXML ${srcdir}/$test.va -e ${srcdir}/$test.xml
31 cmp ${srcdir}/out/.$test.va.adms .$test.va.adms
32 done