Import upstream version 2.3.7+git20201211.1.2097728
Debian Janitor
2 years ago
0 | image: Visual Studio 2019 | |
0 | 1 | environment: |
1 | 2 | matrix: |
2 | 3 | - MSYSTEM : MINGW64 |
27 | 28 | |
28 | 29 | ## Build |
29 | 30 | - 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" | |
31 | 32 | - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make distcheck" |
32 | 33 | - bash -lc "exec 0</dev/null && cd $APPVEYOR_BUILD_FOLDER && make install" |
33 | 34 | |
34 | 35 | - 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" | |
35 | 39 | |
36 | 40 | after_build: |
37 | 41 | # artifacts path is always relative to build folder, so put the zip there |
1 | 1 | |
2 | 2 | sudo: required |
3 | 3 | dist: trusty |
4 | arch: | |
5 | - ppc64le | |
6 | - AMD64 | |
4 | 7 | |
5 | 8 | compiler: |
6 | 9 | - gcc |
27 | 30 | - case $BUILD_SYSTEM in |
28 | 31 | autotools) |
29 | 32 | ./bootstrap.sh && |
30 | ./configure --enable-maintainer-mode --prefix=/usr && | |
33 | ./configure --prefix=/usr && | |
31 | 34 | make distcheck && |
32 | 35 | sudo make install |
33 | 36 | ;; |
34 | 37 | cmake) |
35 | 38 | mkdir build && cd build && |
36 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_MAINTAINER_MODE=ON && | |
39 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr && | |
37 | 40 | make && |
38 | 41 | sudo make install |
39 | 42 | ;; |
26 | 26 | PROJECT(ADMS C) |
27 | 27 | cmake_minimum_required(VERSION 2.8) |
28 | 28 | |
29 | # TODO: store version in a sensible place | |
30 | # e.g. qucs: file(STRINGS "${qucs-project_SOURCE_DIR}/VERSION" QUCS_VERSION) | |
31 | ||
29 | 32 | SET(PACKAGE_NAME "adms") |
30 | SET(PACKAGE_VERSION "2.3.6") | |
33 | SET(PACKAGE_VERSION "2.3.7") | |
31 | 34 | SET(PACKAGE_BUGREPORT "qucs-bugs@lists.sourceforge.net") |
32 | ||
33 | OPTION ( USE_MAINTAINER_MODE "Enable generation of code (parser source) from Perl scripts." OFF ) | |
34 | 35 | |
35 | 36 | # Default to static libs ( shared needs work, BUG with MinGW). |
36 | 37 | OPTION ( BUILD_STATIC_LIBS "Build static libraries." ON ) |
53 | 54 | |
54 | 55 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) |
55 | 56 | |
56 | # Only care about Perl in case maintainer needs to recreate sources | |
57 | # Perl is used to recreate sources | |
57 | 58 | # * mkelements.pl |
58 | 59 | # * mktext.pl |
59 | 60 | # * 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) | |
70 | 69 | |
71 | 70 | |
72 | 71 | find_package(BISON 2.5) |
0 | 0 | adms-2.3.6: |
1 | * Fix parser for parameter lists in subdevice instanciation. | |
1 | * Fix parser for parameter lists in subdevice instantiation. | |
2 | 2 | * Remove duplicated constants on provided headers. |
3 | 3 | * Fix crash on x64 when printing the message about standard headers. |
4 | 4 | |
19 | 19 | * Autotools, add back support for static and shared libraries build. |
20 | 20 | * Build shared libraries by default. Tested on Linux, Mac OSX, and MSYS2. |
21 | 21 | 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. | |
23 | 23 | |
24 | 24 | * Fix out-of-tree build for Autotools and CMake. |
25 | 25 | |
26 | * Check scaling factors againd LRM v2.4.0 | |
26 | * Check scaling factors against LRM v2.4.0 | |
27 | 27 | * Add missing K scaling (uppercase kilo) |
28 | 28 | * standard scale_factor T|G|M|K|k|m|u|n|p|f|a |
29 | 29 | * Add testset (va and xml files) to test the scaling factors |
48 | 48 | * avoid spurious fatal error from an included file which last line contains |
49 | 49 | onlywhite space. |
50 | 50 | * 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 | |
52 | 52 | caused 'unexpected end-of-line' error. |
53 | 53 | * verilogLex.l: |
54 | 54 | * Change string recognition to allow embedded \" as literal quote |
93 | 93 | mica: same c code as 1.1.8 |
94 | 94 | 03-05-2005: removed admsNS directory |
95 | 95 | 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 |
38 | 38 | - GNU Flex |
39 | 39 | - GNU Bison (tested with 2.5+) |
40 | 40 | - GNU Libtool |
41 | - Perl with XML::LibXml (only for maintainers) | |
41 | - Perl with XML::LibXml | |
42 | 42 | - GD modules to manually update documentation images |
43 | 43 | |
44 | 44 | Installing dependencies on Linux Debian/Ubuntu: |
57 | 57 | |
58 | 58 | #### Compilation Using Autotools |
59 | 59 | |
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. | |
61 | 61 | |
62 | 62 | sh bootstrap.sh |
63 | ./configure --enable-maintainer-mode | |
63 | ./configure | |
64 | 64 | make install |
65 | 65 | |
66 | 66 | Autotools it currently used for creating release packages, the `adms-x.x.x.tar.gz` source code archive. |
67 | 67 | |
68 | 68 | sh bootstrap.sh |
69 | ./configure --enable-maintainer-mode | |
69 | ./configure | |
70 | 70 | make clean |
71 | 71 | make dist |
72 | 72 | |
73 | 73 | #### Compilation Using CMake |
74 | 74 | |
75 | The `-DUSE_MAINTAINER_MODE=ON` makes sure the required files are generated (using Perl and LibXml). | |
76 | ||
77 | 75 | 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/ | |
79 | 77 | make install |
80 | 78 | |
81 | 79 | Packaging is not yet supported with CMake. At the moment, only static libraries can be build with CMake. |
82 | 80 | |
83 | ||
84 | 81 | ### Users Install from Tarball |
85 | 82 | |
86 | 83 | 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). | |
88 | 84 | |
89 | 85 | #### Compilation Using Autotools |
90 | 86 | |
100 | 96 | mkdir build; cd build |
101 | 97 | cmake .. -DCMAKE_INSTALL_PREFIX=[/install/location/] |
102 | 98 | 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 | |
103 | 112 | |
104 | 113 | |
105 | 114 | ## Credits |
188 | 197 | 3- run: libtoolize --force --ltdl -c (create libltdl and config.guess, config.sub, ltmain.sh in auxconf) |
189 | 198 | 4- run: automake -a -c (create missing, mkinstalldirs, install-sh in auxconf and all Makefile.in) |
190 | 199 | 5- run: autoconf (create configure) |
191 | 6- run: ./configure --enable-maintainer-mode | |
200 | 6- run: ./configure | |
192 | 201 | In three shots: |
193 | 202 | rm -rf auxconf && autoheader && mkdir auxconf && aclocal && libtoolize --force --ltdl -c |
194 | 203 | touch ChangeLog && automake -a -c && autoconf |
195 | ./configure --enable-maintainer-mode | |
196 | ``` | |
204 | ./configure | |
205 | ``` |
21 | 21 | INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ) # for admsPreprocessor.h, amdsVeriloga.h |
22 | 22 | INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) # for generated source code |
23 | 23 | |
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") | |
26 | 34 | |
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}") | |
36 | 64 | |
37 | 65 | 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} | |
39 | 67 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
40 | RESULT_VARIABLE element_result ) | |
68 | RESULT_VARIABLE text_result ) | |
41 | 69 | |
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() | |
47 | 76 | |
48 | 77 | |
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") | |
63 | 84 | |
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 ) | |
66 | 89 | |
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) | |
99 | 95 | |
100 | 96 | # Issue with flex: |
101 | 97 | # BISON_TARGET, FLEX_TARGET and ADD_FLEX_BISON_DEPENDENCY |
9 | 9 | # use mkctext.pl to create C files containing the contents of each input file |
10 | 10 | # in a C character array. The output is used by make check only |
11 | 11 | |
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 | ||
18 | 12 | $(incfilec):%.c:% ${srcdir}/mkctext.pl |
19 | 13 | $(PERL) ${srcdir}/mkctext.pl $< $(top_srcdir) |
20 | 14 | |
23 | 17 | |
24 | 18 | verilogaYacc.y: ${srcdir}/verilogaYacc.y.in ${srcdir}/mkgrammar.pl |
25 | 19 | $(PERL) ${srcdir}/mkgrammar.pl ${srcdir}/verilogaYacc.y.in |
26 | ||
27 | endif | |
28 | 20 | |
29 | 21 | dist_man_MANS = admsXml.1 admsCheck.1 |
30 | 22 | |
40 | 32 | libadmsPreprocessor_la_LDFLAGS=-no-undefined |
41 | 33 | libadmsPreprocessor_la_LIBADD=libadmsElement.la |
42 | 34 | |
43 | verilogYacc.h: verilogYacc.c | |
35 | verilogaYacc.h: verilogaYacc.c | |
44 | 36 | libadmsVeriloga_la_SOURCES=verilogaYacc.y verilogaLex.l verilogaYacc.h |
45 | 37 | libadmsVeriloga_la_CPPFLAGS=-DinsideVeriloga |
46 | 38 | libadmsVeriloga_la_LDFLAGS=-no-undefined |
57 | 49 | |
58 | 50 | admsXml_SOURCES=admsXml.c |
59 | 51 | admsXml_LDADD=-lm libadmsElement.la libadmsVeriloga.la libadmsPreprocessor.la libadmsAdmstpath.la |
52 | admsXml_CPPFLAGS=${AM_CPPFLAGS} -DADMS_INCLUDEDIR=\"${pkgincludedir}\" | |
60 | 53 | |
61 | 54 | admsXml.c: adms.implicit.xml.c |
62 | 55 |
154 | 154 | <admst:value-to select="dependency" string="nonlinear"/> |
155 | 155 | </admst:otherwise> |
156 | 156 | </admst:choose> |
157 | </admst:when> | |
158 | <admst:when test="[name='\$port_connected']"> | |
159 | <admst:value-to select="dependency" string="constant"/> | |
157 | 160 | </admst:when> |
158 | 161 | <admst:otherwise> |
159 | 162 | <admst:apply-templates select="arguments" match="e:dependency"/> |
190 | 193 | name='idt' or |
191 | 194 | name='ddt' or |
192 | 195 | name='\$param_given' or |
196 | name='\$port_connected' or | |
193 | 197 | name='\$given' or |
194 | 198 | name='ddx' or |
195 | 199 | name='flicker_noise' or |
615 | 615 | adms_slist_push(&pproot()->skipp_text,(p_adms)(long)(0)); |
616 | 616 | pproot()->includePath=getlist_from_argv(argc,argv,"-I","directory"); |
617 | 617 | adms_slist_push(&pproot()->includePath,(p_adms)"."); |
618 | #ifdef ADMS_INCLUDEDIR | |
619 | adms_slist_push(&pproot()->includePath,(p_adms)ADMS_INCLUDEDIR); | |
620 | #endif | |
618 | 621 | adms_preprocessor_get_define_from_argv(argc,argv); |
619 | 622 | adms_preprocessor_define_add_default("insideADMS"); |
620 | 623 | adms_message_verbose(("create temporary file %s\n",mytmpverilogamsfile)) |
45 | 45 | `define M_LN10 2.30258509299404568401 |
46 | 46 | `define P_C 299792458 // m / s |
47 | 47 | `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) | |
49 | 49 | |
50 | 50 | `endif // CONSTANTS_VAMS |
1883 | 1883 | } |
1884 | 1884 | push @Location03," ENDIFIDENT\n"; |
1885 | 1885 | } |
1886 | foreach(keys(%A)) | |
1886 | foreach(sort keys(%A)) | |
1887 | 1887 | { |
1888 | 1888 | my($aname,$ee)=($_,$A{$_}); |
1889 | 1889 | push @Location03," IFIDENT($aname)\n"; |
70 | 70 | die "bisonrule should terminate with ';' - see $_" if(not m/^\s+;$/); |
71 | 71 | } |
72 | 72 | } |
73 | map {print OFH "\%token <_lexval> $_\n";} keys %Token; | |
73 | map {print OFH "\%token <_lexval> $_\n";} sort keys %Token; | |
74 | 74 | print OFH "\n"; |
75 | 75 | map {print OFH "\%type <_yaccval> $_->{name}\n";} @allbisonrule; |
76 | 76 | print OFH "\n"; |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | 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]) | |
5 | 5 | AC_CONFIG_HEADER([config.h]) |
6 | 6 | |
7 | 7 | # specific configuration. |
25 | 25 | AM_INIT_AUTOMAKE([foreign]) |
26 | 26 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
27 | 27 | |
28 | # Maintainer mode is used to detect/run Perl (XML::LibXml) and make dist tarball | |
29 | AM_MAINTAINER_MODE | |
30 | ||
31 | 28 | AC_CHECK_PROG(GIT,git,yes) |
32 | 29 | 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]) | |
38 | 30 | |
39 | 31 | AX_PROG_FLEX([],[AC_MSG_WARN(Program flex not found (found $LEX)) |
40 | 32 | AC_MSG_ERROR(Please install gnu flex from http://www.gnu.org/software/flex/)]) |
96 | 88 | AC_PROG_LIBTOOL |
97 | 89 | AC_SUBST([LIBTOOL_DEPS]) |
98 | 90 | |
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; | |
101 | 96 | |
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])]) | |
111 | 100 | |
112 | 101 | # Define preprocessor flag for static build (MinGW). |
113 | 102 | AS_IF([test "x$enable_shared" = "xno"], [ |
130 | 119 | Configure Information: |
131 | 120 | Host : $host |
132 | 121 | |
133 | Maintainer mode : $USE_MAINTAINER_MODE | |
134 | ||
135 | 122 | C Compiler : $CC |
136 | 123 | DEFS : $DEFS |
137 | 124 | 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 |
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 |