Hello community, here is the log from the commit of package asco for openSUSE:Factory checked in at 2018-08-03 12:38:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/asco (Old) and /work/SRC/openSUSE:Factory/.asco.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "asco" Fri Aug 3 12:38:23 2018 rev:2 rq:627094 version:0.4.10 Changes: -------- --- /work/SRC/openSUSE:Factory/asco/asco.changes 2014-11-10 17:27:50.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.asco.new/asco.changes 2018-08-03 12:38:23.675666995 +0200 @@ -1,0 +2,14 @@ +Sun Jun 10 08:37:45 UTC 2018 - [email protected] + +- Update to version 0.9.10: + * Simulation re-runs are now supported in Spectre during an + optimization. + * Minor enhancements in the RF module. + * Support for the newest MPICH versions. + * The 'postp' tool is more robust to changes of each SPICE output + format. + * Support for the newest versions of MPICH documented. +- Fix implicit declaration error of 'gethostname': + * Add asco-0.4.10-fix-implicit-declaration.patch. + +------------------------------------------------------------------- Old: ---- ASCO-0.4.9.tar.gz New: ---- ASCO-0.4.10.tar.gz asco-0.4.10-fix-implicit-declaration.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ asco.spec ++++++ --- /var/tmp/diff_new_pack.woKV4n/_old 2018-08-03 12:38:24.375668036 +0200 +++ /var/tmp/diff_new_pack.woKV4n/_new 2018-08-03 12:38:24.379668042 +0200 @@ -1,7 +1,7 @@ # # spec file for package asco # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,13 +17,15 @@ Name: asco -Version: 0.4.9 +Version: 0.4.10 Release: 0 Summary: A SPICE Circuit Optimizer -License: GPL-2.0 +License: GPL-2.0-only Group: Productivity/Scientific/Electronics Url: http://asco.sourceforge.net/ Source0: http://downloads.sourceforge.net/asco/ASCO-%{version}.tar.gz +# PATCH-FIX-UPSTREAM asco-0.4.10-fix-implicit-declaration.patch +Patch0: asco-0.4.10-fix-implicit-declaration.patch # PATCH-FIX-OPENSUSE asco_unbuffered.patch -- patch from QUCS team Patch1: asco_unbuffered.patch BuildRequires: autoconf @@ -51,6 +53,7 @@ %prep %setup -qn ASCO-%{version} +%patch0 -p1 %patch1 -p1 tar -zxf Autotools.tar.gz touch NEWS @@ -66,7 +69,8 @@ %files %defattr(-,root,root) -%doc ChangeLog LICENSE README +%doc ChangeLog README +%license LICENSE %exclude %{_docdir}/%{name}/ASCO.pdf %{_bindir}/alter %{_bindir}/asco ++++++ ASCO-0.4.9.tar.gz -> ASCO-0.4.10.tar.gz ++++++ Binary files old/ASCO-0.4.9/Autotools.tar.gz and new/ASCO-0.4.10/Autotools.tar.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/ChangeLog new/ASCO-0.4.10/ChangeLog --- old/ASCO-0.4.9/ChangeLog 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/ChangeLog 2016-08-13 11:29:16.020731538 +0200 @@ -1,7 +1,20 @@ +ASCO 0.4.10: August 13, 2016 + * Simulation re-runs are now supported in Spectre during an optimization + * Minor enhancements in the RF module + * Support for the newest MPICH versions + * The 'postp' tool is more robust to changes of each SPICE output format + + Manual: + * Support for the newest versions of MPICH documented + + + + ASCO 0.4.9: July 21, 2013 * Initial support for ngspice simulator. Thanks to Holger Vogt for the 'ngspice examples' * Minor bug fixes in 'log' and 'postp' tools + Manual: * Spell and grammar check. Thanks to Elio Mazzocca * Initial support for ngspice added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/README new/ASCO-0.4.10/README --- old/ASCO-0.4.9/README 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/README 2016-08-13 11:29:16.252733860 +0200 @@ -1,4 +1,4 @@ -ASCO-0.4.9 +ASCO-0.4.10 ------------------------------------------------------------------------ 1. INSTALLING ASCO @@ -24,4 +24,4 @@ ------------------------------------------------------------------------ -Copyright (C) 1999-2013 Joao Ramos +Copyright (C) 1999-2016 Joao Ramos diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/asco.c new/ASCO-0.4.10/asco.c --- old/ASCO-0.4.9/asco.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/asco.c 2016-08-13 11:29:16.016731497 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -80,7 +80,7 @@ if (ntasks < 2) { printf("\nAt least 2 processors are required to run this program\n"); printf("\nExamples:\n"); - printf(" mpirun -p4pg machines.txt asco-mpi -<simulator> <inputfile>\n"); + printf(" mpirun -f machines.txt [-np X] asco-mpi -<simulator> <inputfile>\n"); printf(" mpirun -np 2 asco-mpi -<simulator> <inputfile>\n\n\n"); MPI_Finalize(); /* Quit if there is only one processor */ exit(EXIT_FAILURE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/auxfunc.c new/ASCO-0.4.10/auxfunc.c --- old/ASCO-0.4.9/auxfunc.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/auxfunc.c 2016-08-13 11:29:16.008731418 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -537,7 +537,7 @@ void InsertString(char *ret, char *data, int a, int b) { char begin[LONGSTRINGSIZE], end[LONGSTRINGSIZE]; - + strsub(begin, ret, 1, a-1); strsub(end, ret, b, (int)strlen(ret)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/auxfunc.h new/ASCO-0.4.10/auxfunc.h --- old/ASCO-0.4.9/auxfunc.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/auxfunc.h 2016-08-13 11:29:16.040731737 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -12,7 +12,7 @@ * global variable declarations */ -#define COPYRIGHT "Copyright (c) 1999-2013 Joao Ramos" +#define COPYRIGHT "Copyright (c) 1999-2016 Joao Ramos" #define GPL_INFO "This program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details." #define LONGSTRINGSIZE 4096 /* */ #define SHORTSTRINGSIZE 64 /* */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/auxfunc_alter.c new/ASCO-0.4.10/auxfunc_alter.c --- old/ASCO-0.4.9/auxfunc_alter.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/auxfunc_alter.c 2016-08-13 11:29:16.100732338 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -8,6 +8,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#ifdef __MINGW32__ +#include <winsock2.h> +#endif #include "auxfunc_alter.h" #include "auxfunc.h" @@ -216,6 +219,7 @@ printf("auxfunc_alter.c - CreateALTERinc -- LTspice not supported\n"); exit(EXIT_FAILURE); case 4: /*Spectre*/ + fseek(falterINC, 0, SEEK_END); /*properly position the pointer*/ break; case 50: /*Qucs*/ printf("auxfunc_alter.c - CreateALTERinc -- Qucs not supported\n"); @@ -243,7 +247,9 @@ printf("auxfunc_alter.c - CreateALTERinc -- LTspice not supported\n"); break; case 4: /*Spectre*/ - fprintf(falterINC, "simulator lang=spectre\n\n"); + if (append==0) { + fprintf(falterINC, "simulator lang=spectre\n\n"); + } break; case 50: /*Qucs*/ printf("auxfunc_alter.c - CreateALTERinc -- Qucs not supported\n"); @@ -346,6 +352,24 @@ InsertString(lkk, data, l, l); } fprintf(falterINC, "%s\n", lkk); + + //Updates <hostname>.mdl file with the required commands to execute each one of + //the simulation reruns by preliminary storing the information in alter[0].data[1]. + //Data that is written to <hostname>.mdl at the end of this function. + if (k==0) { + l = strpos2(lkk, " ", 1); + strsub(data, lkk, 1, l-1); + sprintf(lkk, "\nrun %s\nrun #MDLRUN# as #MDLRUN#_%s\n", data, data); + + /*data to be written to <hostname>.mdl file is temporarily stored in alter[0].data[1]*/ + if ( ((int)strlen(alter[0].data[1]) + (int)strlen(lkk) + 1) < LONGSTRINGSIZE) { + strcat(alter[0].data[1], lkk); + } else { + printf("auxfunc_alter.c - CreateALTERinc -- Cannot concatenate\n"); + exit(EXIT_FAILURE); + } + } + } else fprintf(falterINC, "%s\n", alter[k].text); if (!strcmp(alter[k].text, "}")) /*Detects the end of altergroup as soon as it finds '}'*/ @@ -401,5 +425,56 @@ fclose(fsweepINI); if (falterINC != NULL) fclose(falterINC); + + switch(spice) { /*Spectre special case to add simulation reruns to <hostname>.mdl*/ + case 1: /*Eldo*/ + case 2: /*HSPICE*/ + case 3: /*LTspice*/ + break; + case 4: /*Spectre*/ + if (append==1) { + //get <hostname>.mdl file + gethostname(data, sizeof(data)); + l = strpos2(data, ".", 1); + if (l) { + data[l]=0; + } + strcat(data, "mdl"); + if ((falterINC=fopen(data,"r+t")) == 0) { /*create an empty file for writing*/ + printf("auxfunc_alter.c - CreateALTERinc -- Cannot write to output file: %s\n", data); + exit(EXIT_FAILURE); + } + + //gets the simulation run name from the first line in the <hostname>.mdl file + fgets2(lkk, LONGSTRINGSIZE, falterINC); + l = strpos2(lkk, "{", 17); //start at 17 because the line is known to be 'alias measurement' + strsub(data, lkk, 18, l-18); + StripSpaces(data); + + //replace #MDLKEY# with the correct simulation run name + for (i = 0; i < (2*alter_times); i++) { + l = strpos2(alter[0].data[1], "#", 1); + InsertString(alter[0].data[1], data, l, l+8); + } + + //now appends the necessary information to <hostname>.mdl + fseek(falterINC, 0, SEEK_END); + fprintf(falterINC, alter[0].data[1]); + + //close the <hostname>.mdl file + if (falterINC != NULL) + fclose(falterINC); + } + break; + case 50: /*Qucs*/ + case 51: /*ngspice*/ + break; + case 100: /*general*/ + printf("auxfunc_alter.c - CreateALTERinc -- GENERAL not supported\n"); + exit(EXIT_FAILURE); + default: + printf("auxfunc_alter.c - CreateALTERinc -- Something unexpected has happened!\n"); + exit(EXIT_FAILURE); + } } /*CreateALTERinc*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/auxfunc_measurefromlis.c new/ASCO-0.4.10/auxfunc_measurefromlis.c --- old/ASCO-0.4.9/auxfunc_measurefromlis.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/auxfunc_measurefromlis.c 2016-08-13 11:29:16.240733739 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/de36.c new/ASCO-0.4.10/de36.c --- old/ASCO-0.4.9/de36.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/de36.c 2016-08-13 11:29:16.224733580 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Joao Ramos + * Copyright (C) 2005-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html Binary files old/ASCO-0.4.9/doc/ASCO.pdf and new/ASCO-0.4.10/doc/ASCO.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/errfunc.c new/ASCO-0.4.10/errfunc.c --- old/ASCO-0.4.9/errfunc.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/errfunc.c 2016-08-13 11:29:16.080732138 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/errfunc.h new/ASCO-0.4.10/errfunc.h --- old/ASCO-0.4.9/errfunc.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/errfunc.h 2016-08-13 11:29:16.096732299 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/evaluate.c new/ASCO-0.4.10/evaluate.c --- old/ASCO-0.4.9/evaluate.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/evaluate.c 2016-08-13 11:29:16.068732018 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/examples/HSPICE/classE/extract/P_OUT new/ASCO-0.4.10/examples/HSPICE/classE/extract/P_OUT --- old/ASCO-0.4.9/examples/HSPICE/classE/extract/P_OUT 2013-01-21 22:01:13.000000000 +0100 +++ new/ASCO-0.4.10/examples/HSPICE/classE/extract/P_OUT 2005-10-14 14:00:37.000000000 +0200 @@ -14,5 +14,5 @@ # Post Processing # MEASURE_VAR: fft: SEARCH_FOR:' ****** fft analysis': S_COL:01: P_LINE:16: P_COL:37:47 MEASURE_VAR: rl: SEARCH_FOR:' .param filt_res =' -MEASURE_VAR: #SYMBOL#: MATH:&fft: ^: 2 : /: &rl: /: +MEASURE_VAR: #SYMBOL#: MATH:&fft: 2: *: ^: 2 : /: &rl: /: # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/examples/LTspice/bandpass/bandpass.net new/ASCO-0.4.10/examples/LTspice/bandpass/bandpass.net --- old/ASCO-0.4.9/examples/LTspice/bandpass/bandpass.net 2006-01-25 15:03:31.000000000 +0100 +++ new/ASCO-0.4.10/examples/LTspice/bandpass/bandpass.net 2014-07-05 23:33:44.007642571 +0200 @@ -19,5 +19,5 @@ .AC DEC 1000 800e6 1200E6 .NET v(3) VIN rout=50 rin=50 .SAVE s11(VIN) s21(vin) -.OPTION POST PROBE +*.OPTION POST PROBE .END diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/examples/ngspice/inv/inv.sp new/ASCO-0.4.10/examples/ngspice/inv/inv.sp --- old/ASCO-0.4.9/examples/ngspice/inv/inv.sp 2013-01-26 18:29:53.000000000 +0100 +++ new/ASCO-0.4.10/examples/ngspice/inv/inv.sp 2016-08-13 11:29:16.280734140 +0200 @@ -21,7 +21,7 @@ MP OUT IN VDD VDD PMOS W='#WP#' L=#LMIN# pd='2*#WP#+2*#LMIN#' ps='2*#WP#+2*#LMIN#' MN OUT IN VSS VSS NMOS W='#WP#/3' L=#LMIN# pd='2*#WP#+2*#LMIN#' ps='2*#WP#+2*#LMIN#' -CL OUT VSS 10p +CL OUT VSS 3p *** *** ANALYSIS *** *** .TRAN 'INP_PERIOD/1000' 'NO_PERIODS*INP_PERIOD' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/initialize.c new/ASCO-0.4.10/initialize.c --- old/ASCO-0.4.9/initialize.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/initialize.c 2016-08-13 11:29:16.196733299 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/initialize.h new/ASCO-0.4.10/initialize.h --- old/ASCO-0.4.9/initialize.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/initialize.h 2016-08-13 11:29:16.208733419 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2013 Joao Ramos + * Copyright (C) 2004-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/nmlatest.c new/ASCO-0.4.10/nmlatest.c --- old/ASCO-0.4.9/nmlatest.c 2006-05-22 10:54:00.000000000 +0200 +++ new/ASCO-0.4.10/nmlatest.c 2016-08-13 11:29:16.284734180 +0200 @@ -52,7 +52,6 @@ #include <stdio.h> #include <stdlib.h> -#include <malloc.h> #include <math.h> /* #include "auxfunc.h" */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/rfmodule.c new/ASCO-0.4.10/rfmodule.c --- old/ASCO-0.4.9/rfmodule.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/rfmodule.c 2016-08-13 11:29:16.056731898 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Joao Ramos + * Copyright (C) 2005-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -29,7 +29,7 @@ /* * Receives a SPICE line and extract the device value. Currently only * R/L/C devices are supported and in a very simply input format as - * the device value is always the last paramenter in the SPICE line, + * the device value is always the last parameter in the SPICE line, * either after or before the in-line comment. * * DataSource=0 : reading from rfmodule.cfg => does not ignore characters after the in-line comment @@ -233,7 +233,7 @@ sprintf(laux3, "#%s#", laux2); ReadKey(laux2, laux3, fspice_cfg); /* looks for key defining the subcircuit */ if (strcmp(laux2, laux3)) { - printf("INFO: rfmodule.c - Step1 -- %s key not found\n", laux2); + printf("INFO: rfmodule.c - Step1 -- '%s' device key in '%s' not found in rfmodule.cfg\n", laux3, line); exit(EXIT_FAILURE); } @@ -243,10 +243,10 @@ printf("rfmodule.c - Step1 -- Incorrect line format, 'Device:' key is missing: %s\n", laux2); exit(EXIT_FAILURE); } else { - strsub(laux3, laux2, 8, (int)strlen(laux2)); /* detects device type:'resitor', 'inductor' and 'capacitor' */ + strsub(laux3, laux2, 8, (int)strlen(laux2)); /* detects device type:'resistor', 'inductor' and 'capacitor' */ switch (laux3[0]) { case 'r': /* resistor */ - if (strcmp(laux3, "resitor")) { + if (strcmp(laux3, "resistor")) { printf("rfmodule.c - Step1 -- Incorrect line format, 'resistor' key is missing: %s\n", laux2); exit(EXIT_FAILURE); } @@ -375,7 +375,7 @@ case 3: /*LTspice*/ break; case 4: /*Spectre*/ - fseek(fout, -1, SEEK_CUR); + //fseek(fout, -1, SEEK_CUR); fprintf(fout, "\nparameters "); break; case 50: /*Qucs*/ @@ -789,7 +789,9 @@ fprintf(fout, "\nparameters "); break; case 50: /*Qucs*/ + break; case 51: /*ngspice*/ + break; case 100: /*general*/ break; default: @@ -1170,6 +1172,7 @@ /*'prev' and 'next' index are known at this point*/ + while (strpos2(line, "=_RF_ ", 1)) { /* while there is values to replace... */ /*Step9.2: Y_VALUES for linear interpolation -- */ j = strpos2(line, "=_RF_ ", 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/rfmodule.h new/ASCO-0.4.10/rfmodule.h --- old/ASCO-0.4.9/rfmodule.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/rfmodule.h 2016-08-13 11:29:15.992731257 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2013 Joao Ramos + * Copyright (C) 2005-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/alter/Makefile.win32 new/ASCO-0.4.10/tools/alter/Makefile.win32 --- old/ASCO-0.4.9/tools/alter/Makefile.win32 2006-10-08 00:44:08.000000000 +0200 +++ new/ASCO-0.4.10/tools/alter/Makefile.win32 2016-08-11 00:31:00.625256866 +0200 @@ -7,7 +7,7 @@ all: ../auxfunc/auxfunc.o auxfunc_alter.o alter alter: - $(CC) $(CFLAGS) -o alter.exe ../auxfunc/auxfunc.o auxfunc_alter.o alter.c -lm + $(CC) $(CFLAGS) -o alter.exe ../auxfunc/auxfunc.o auxfunc_alter.o alter.c -lm -lws2_32 strip alter.exe clean:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/alter/auxfunc_alter.c new/ASCO-0.4.10/tools/alter/auxfunc_alter.c --- old/ASCO-0.4.9/tools/alter/auxfunc_alter.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/alter/auxfunc_alter.c 2016-08-13 11:29:16.128732618 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -8,6 +8,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#ifdef __MINGW32__ +#include <winsock2.h> +#endif #include "auxfunc_alter.h" #include "auxfunc.h" @@ -216,6 +219,7 @@ printf("auxfunc_alter.c - CreateALTERinc -- LTspice not supported\n"); exit(EXIT_FAILURE); case 4: /*Spectre*/ + fseek(falterINC, 0, SEEK_END); /*properly position the pointer*/ break; case 50: /*Qucs*/ printf("auxfunc_alter.c - CreateALTERinc -- Qucs not supported\n"); @@ -243,7 +247,9 @@ printf("auxfunc_alter.c - CreateALTERinc -- LTspice not supported\n"); break; case 4: /*Spectre*/ - fprintf(falterINC, "simulator lang=spectre\n\n"); + if (append==0) { + fprintf(falterINC, "simulator lang=spectre\n\n"); + } break; case 50: /*Qucs*/ printf("auxfunc_alter.c - CreateALTERinc -- Qucs not supported\n"); @@ -346,6 +352,24 @@ InsertString(lkk, data, l, l); } fprintf(falterINC, "%s\n", lkk); + + //Updates <hostname>.mdl file with the required commands to execute each one of + //the simulation reruns by preliminary storing the information in alter[0].data[1]. + //Data that is written to <hostname>.mdl at the end of this function. + if (k==0) { + l = strpos2(lkk, " ", 1); + strsub(data, lkk, 1, l-1); + sprintf(lkk, "\nrun %s\nrun #MDLRUN# as #MDLRUN#_%s\n", data, data); + + /*data to be written to <hostname>.mdl file is temporarily stored in alter[0].data[1]*/ + if ( ((int)strlen(alter[0].data[1]) + (int)strlen(lkk) + 1) < LONGSTRINGSIZE) { + strcat(alter[0].data[1], lkk); + } else { + printf("auxfunc_alter.c - CreateALTERinc -- Cannot concatenate\n"); + exit(EXIT_FAILURE); + } + } + } else fprintf(falterINC, "%s\n", alter[k].text); if (!strcmp(alter[k].text, "}")) /*Detects the end of altergroup as soon as it finds '}'*/ @@ -401,5 +425,56 @@ fclose(fsweepINI); if (falterINC != NULL) fclose(falterINC); + + switch(spice) { /*Spectre special case to add simulation reruns to <hostname>.mdl*/ + case 1: /*Eldo*/ + case 2: /*HSPICE*/ + case 3: /*LTspice*/ + break; + case 4: /*Spectre*/ + if (append==1) { + //get <hostname>.mdl file + gethostname(data, sizeof(data)); + l = strpos2(data, ".", 1); + if (l) { + data[l]=0; + } + strcat(data, "mdl"); + if ((falterINC=fopen(data,"r+t")) == 0) { /*create an empty file for writing*/ + printf("auxfunc_alter.c - CreateALTERinc -- Cannot write to output file: %s\n", data); + exit(EXIT_FAILURE); + } + + //gets the simulation run name from the first line in the <hostname>.mdl file + fgets2(lkk, LONGSTRINGSIZE, falterINC); + l = strpos2(lkk, "{", 17); //start at 17 because the line is known to be 'alias measurement' + strsub(data, lkk, 18, l-18); + StripSpaces(data); + + //replace #MDLKEY# with the correct simulation run name + for (i = 0; i < (2*alter_times); i++) { + l = strpos2(alter[0].data[1], "#", 1); + InsertString(alter[0].data[1], data, l, l+8); + } + + //now appends the necessary information to <hostname>.mdl + fseek(falterINC, 0, SEEK_END); + fprintf(falterINC, alter[0].data[1]); + + //close the <hostname>.mdl file + if (falterINC != NULL) + fclose(falterINC); + } + break; + case 50: /*Qucs*/ + case 51: /*ngspice*/ + break; + case 100: /*general*/ + printf("auxfunc_alter.c - CreateALTERinc -- GENERAL not supported\n"); + exit(EXIT_FAILURE); + default: + printf("auxfunc_alter.c - CreateALTERinc -- Something unexpected has happened!\n"); + exit(EXIT_FAILURE); + } } /*CreateALTERinc*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/auxfunc/auxfunc.c new/ASCO-0.4.10/tools/auxfunc/auxfunc.c --- old/ASCO-0.4.9/tools/auxfunc/auxfunc.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/auxfunc/auxfunc.c 2016-08-13 11:29:16.144732779 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/auxfunc/auxfunc.h new/ASCO-0.4.10/tools/auxfunc/auxfunc.h --- old/ASCO-0.4.9/tools/auxfunc/auxfunc.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/auxfunc/auxfunc.h 2016-08-13 11:29:16.152732859 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -12,7 +12,7 @@ * global variable declarations */ -#define COPYRIGHT "Copyright (c) 1999-2013 Joao Ramos" +#define COPYRIGHT "Copyright (c) 1999-2016 Joao Ramos" #define GPL_INFO "This program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details." #define LONGSTRINGSIZE 4096 /* */ #define SHORTSTRINGSIZE 64 /* */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/log/auxfunc_log.c new/ASCO-0.4.10/tools/log/auxfunc_log.c --- old/ASCO-0.4.9/tools/log/auxfunc_log.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/log/auxfunc_log.c 2016-08-13 11:29:16.180733139 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/log/dosdir.c new/ASCO-0.4.10/tools/log/dosdir.c --- old/ASCO-0.4.9/tools/log/dosdir.c 1998-03-06 17:54:12.000000000 +0100 +++ new/ASCO-0.4.10/tools/log/dosdir.c 2016-08-13 11:29:16.288734221 +0200 @@ -50,6 +50,7 @@ */ #include <string.h> +#include <errno.h> #include "dosdir.h" struct stat dd_sstat; /* global stat structure of last successful file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/postp/auxfunc_measurefromlis.c new/ASCO-0.4.10/tools/postp/auxfunc_measurefromlis.c --- old/ASCO-0.4.9/tools/postp/auxfunc_measurefromlis.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/postp/auxfunc_measurefromlis.c 2016-08-13 11:29:16.124732579 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/tools/postp/auxfunc_updatelis.c new/ASCO-0.4.10/tools/postp/auxfunc_updatelis.c --- old/ASCO-0.4.9/tools/postp/auxfunc_updatelis.c 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/tools/postp/auxfunc_updatelis.c 2016-08-13 11:29:16.108732418 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2013 Joao Ramos + * Copyright (C) 1999-2016 Joao Ramos * Your use of this code is subject to the terms and conditions of the * GNU general public license version 2. See "COPYING" or * http://www.gnu.org/licenses/gpl.html @@ -23,6 +23,65 @@ /* * */ +void SpectreStripSI (char *Result, char begin_char, char end_char) +{ + int i; + char laux[LONGSTRINGSIZE]; + + i=1; ReadSubKey(laux, Result, &i, begin_char, end_char, 5); + + i=strpos2(laux, " ", 2); + if ((laux[i]==109)) { /* 109=m; mV */ + laux[i-1]='\0'; + strcat(laux, "e-3"); + } + if ((laux[i]==117)) { /* 117=u; uV */ + laux[i-1]='\0'; + strcat(laux, "e-6"); + } + if ((laux[i]==110)) { /* 110=n; nV */ + laux[i-1]='\0'; + strcat(laux, "e-9"); + } + if ((laux[i]==112)) { /* 110=p; pV */ + laux[i-1]='\0'; + strcat(laux, "e-12"); + } + sprintf(Result, " %s", laux); /* Puts the value on the expected column for DoCalculations */ +} + + + + +/* + * + */ +void ReadKeyPrintLine(char *Result, char *key, FILE *streamIn, FILE *streamOut) +{ + char lkk1[LONGSTRINGSIZE]; + char STR1[LONGSTRINGSIZE]; + + while ((strpos2(lkk1, key, 1) == 0) & (!P_eof(streamIn))) { + fgets2(lkk1, LONGSTRINGSIZE, streamIn); + fprintf(streamOut, "%s\n", lkk1); + int i; + i=0; + i=strpos2(lkk1, key, 1); + i++; + } + + if (!P_eof(streamIn)) + strcpy(Result, lkk1); + else + Result[0]='\0'; +} /*ReadKeyPrintLine*/ + + + + +/* + * + */ void DoCalculations(char *lelement, char *lVGS, char *lVDS, char *lVth, char *lVDSAT, double Vovd, double Voff, double Vdst, char (*stats)[LONGSTRINGSIZE], FILE **fNoSat) { int a, i, j, k; @@ -89,7 +148,7 @@ while (*skip[k - 1] != '\0' && PrintNoSat == TRUE) { if (!strcmp(skip[k - 1], laux)) /*Is this transistor to be printed in the NOSAT.TXT?*/ PrintNoSat = FALSE; - a = strlen(skip[k - 1]); + a = (int)strlen(skip[k - 1]); strcpy(llaux, skip[k - 1]); if (llaux[a - 1] == '*') { /*do not print those starting by ... if they have an '*' at the end*/ sprintf(STR1, "%.*s", (int)(a - 1), skip[k - 1]); @@ -114,19 +173,19 @@ } } - sprintf(lOpRegion + strlen(lOpRegion), "%.*s", (int)(index[1] - index[0] - 6), empty); + sprintf(lOpRegion + (int)strlen(lOpRegion), "%.*s", (int)(index[1] - index[0] - 6), empty); if (vgs > vth) { sprintf(laux, "%6.3f", vgs - vth); - sprintf(lVovd + strlen(lVovd), "%s%.*s", laux, (int)(index[1] - index[0] - 6), empty); + sprintf(lVovd + (int)strlen(lVovd), "%s%.*s", laux, (int)(index[1] - index[0] - 6), empty); if (vds > vdsat) { sprintf(laux, "%6.3f", vds - vdsat); - sprintf(lVds_Vdsat + strlen(lVds_Vdsat), "%s%.*s", laux, (int)(index[1] - index[0] - 6), empty); + sprintf(lVds_Vdsat + (int)strlen(lVds_Vdsat), "%s%.*s", laux, (int)(index[1] - index[0] - 6), empty); } else - sprintf(lVds_Vdsat + strlen(lVds_Vdsat), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*LIN*/ + sprintf(lVds_Vdsat + (int)strlen(lVds_Vdsat), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*LIN*/ } else { - sprintf(lVovd + strlen(lVovd), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*OFF*/ - sprintf(lVds_Vdsat + strlen(lVds_Vdsat), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*OFF*/ + sprintf(lVovd + (int)strlen(lVovd), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*OFF*/ + sprintf(lVds_Vdsat + (int)strlen(lVds_Vdsat), " -----%.*s", (int)(index[1] - index[0] - 6), empty); /*OFF*/ } } @@ -295,41 +354,45 @@ sprintf(laux, "%.37s", lkk); if (!strcmp(laux, "0**** OPERATING POINT")) { - for (i = 1; i <= 6; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); + if ( (strpos2(lkk, " M", 1) != 0) || (strpos2(lkk, " X", 1) != 0) ) /*breaks loop only if string is found*/ + break; + } + if (i==9) { + printf("auxfunc_updatelis.c - Eldo netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); } - while ( (strpos2(lkk, " M", 1) != 0) || (strpos2(lkk, " X", 1) != 0)) { /*find operating region for all transistors*/ + while ( (strpos2(lkk, " M", 1) != 0) || (strpos2(lkk, " X", 1) != 0) ) { /*find operating region for all transistors*/ strcpy(lelement, lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - - //if (strpos2(lkk, "region", 1) !=0) { /* Due to HSPICE 2001.2 line */ - // fgets2(lkk, LONGSTRINGSIZE, fLIS); - // fprintf(fLJR, "%s\n", lkk); /* with the operation region */ - //} - - /* fgets2(lkk, LONGSTRINGSIZE, fLIS); */ - /* fprintf(fLJR, "%s\n", lkk); */ - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - - fgets2(lVGS, LONGSTRINGSIZE, fLIS); /*Vgs*/ - fprintf(fLJR, "%s\n", lVGS); - fgets2(lVDS, LONGSTRINGSIZE, fLIS); /*Vds*/ - fprintf(fLJR, "%s\n", lVDS); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - fgets2(lVDSAT, LONGSTRINGSIZE, fLIS); /*Vdsat*/ - fprintf(fLJR, "%s\n", lVDSAT); + ReadKeyPrintLine(lVGS, "VGS ", fLIS, fLJR); + if (!strpos2(lVGS, "VGS ", 1)) { + printf("auxfunc_updatelis.c - Eldo netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDS, "VDS ", fLIS, fLJR); + if (!strpos2(lVDS, "VDS ", 1)) { + printf("auxfunc_updatelis.c - Eldo netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVth, "VTH ", fLIS, fLJR); + if (!strpos2(lVth, "VTH ", 1)) { + printf("auxfunc_updatelis.c - Eldo netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDSAT, "VDSAT ", fLIS, fLJR); + if (!strpos2(lVDSAT, "VDSAT ", 1)) { + printf("auxfunc_updatelis.c - Eldo netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } - for (i = 1; i <= 24; i++) { + while ((int)strlen(lkk)) { /*empty line has been found, goes ahead*/ + //strcpy(laux,lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); } @@ -340,10 +403,12 @@ fprintf(fLJR, "%s\n\n\n", stats[2]); - for (i = 1; i <= 2; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); - if (i > 1) + if ((i > 1) || (int)strlen(lkk)) fprintf(fLJR, "%s\n", lkk); + if ( (strpos2(lkk, " M", 1) != 0) || (strpos2(lkk, " X", 1) != 0) ) /*breaks loop only if string is found, BUT unlike the code above in here it might be the last MOSTFET group*/ + break; } } @@ -368,9 +433,15 @@ sprintf(laux, "%.12s", lkk); if (!strcmp(laux, "**** mosfets")) { - for (i = 1; i <= 4; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); + if (strpos2(lkk, "element ", 1) != 0) /*breaks loop only if string is found*/ + break; + } + if (i==9) { + printf("auxfunc_updatelis.c - HSPICE netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); } while (strpos2(lkk, "element ", 1) != 0) { /*find operating region for all transistors*/ @@ -378,31 +449,29 @@ fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - - if (strpos2(lkk, "region", 1) !=0) { /* Due to HSPICE 2001.2 line */ - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); /* with the operation region */ + ReadKeyPrintLine(lVGS, "vgs ", fLIS, fLJR); + if (!strpos2(lVGS, "vgs ", 1)) { + printf("auxfunc_updatelis.c - HSPICE netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDS, "vds ", fLIS, fLJR); + if (!strpos2(lVDS, "vds ", 1)) { + printf("auxfunc_updatelis.c - HSPICE netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVth, "vth ", fLIS, fLJR); + if (!strpos2(lVth, "vth ", 1)) { + printf("auxfunc_updatelis.c - HSPICE netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDSAT, "vdsat ", fLIS, fLJR); + if (!strpos2(lVDSAT, "vdsat ", 1)) { + printf("auxfunc_updatelis.c - HSPICE netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); } - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - - fgets2(lVGS, LONGSTRINGSIZE, fLIS); /*Vgs*/ - fprintf(fLJR, "%s\n", lVGS); - fgets2(lVDS, LONGSTRINGSIZE, fLIS); /*Vds*/ - fprintf(fLJR, "%s\n", lVDS); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - fgets2(lVDSAT, LONGSTRINGSIZE, fLIS); /*Vdsat*/ - fprintf(fLJR, "%s\n", lVDSAT); - - for (i = 1; i <= 12; i++) { + while ((int)strlen(lkk)) { /*empty line has been found, goes ahead*/ + //strcpy(laux,lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); } @@ -413,10 +482,12 @@ fprintf(fLJR, "%s\n\n\n", stats[2]); - for (i = 1; i <= 4; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); - if (i > 2) + if ((i > 2) || (int)strlen(lkk)) fprintf(fLJR, "%s\n", lkk); + if (strpos2(lkk, "element ", 1)) /*breaks loop only if string is found, BUT unlike the code above in here it might be the last MOSTFET group*/ + break; } } @@ -436,9 +507,15 @@ sprintf(laux, "%.21s", lkk); if (!strcmp(laux, "--- BSIM3 MOSFETS ---")) { - for (i = 1; i <= 1; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); + if (strpos2(lkk, "Name: ", 1) != 0) /*breaks loop only if string is found*/ + break; + } + if (i==9) { + printf("auxfunc_updatelis.c - LTspice netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); } while (strpos2(lkk, "Name: ", 1) != 0) { /*find operating region for all transistors*/ @@ -446,45 +523,46 @@ fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); - //fgets2(lkk, LONGSTRINGSIZE, fLIS); - //fprintf(fLJR, "%s\n", lkk); - - //if (strpos2(lkk, "region", 1) !=0) { /* Due to HSPICE 2001.2 line */ - // fgets2(lkk, LONGSTRINGSIZE, fLIS); - // fprintf(fLJR, "%s\n", lkk); /* with the operation region */ - //} - - //fgets2(lkk, LONGSTRINGSIZE, fLIS); - //fprintf(fLJR, "%s\n", lkk); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - - fgets2(lVGS, LONGSTRINGSIZE, fLIS); /*Vgs*/ - fprintf(fLJR, "%s\n", lVGS); - fgets2(lVDS, LONGSTRINGSIZE, fLIS); /*Vds*/ - fprintf(fLJR, "%s\n", lVDS); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - fgets2(lVDSAT, LONGSTRINGSIZE, fLIS); /*Vdsat*/ - fprintf(fLJR, "%s\n", lVDSAT); + ReadKeyPrintLine(lVGS, "Vgs: ", fLIS, fLJR); + if (!strpos2(lVGS, "Vgs: ", 1)) { + printf("auxfunc_updatelis.c - LTspice netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDS, "Vds: ", fLIS, fLJR); + if (!strpos2(lVDS, "Vds: ", 1)) { + printf("auxfunc_updatelis.c - LTspice netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVth, "Vth: ", fLIS, fLJR); + if (!strpos2(lVth, "Vth: ", 1)) { + printf("auxfunc_updatelis.c - LTspice netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + ReadKeyPrintLine(lVDSAT, "Vdsat: ", fLIS, fLJR); + if (!strpos2(lVDSAT, "Vdsat: ", 1)) { + printf("auxfunc_updatelis.c - LTspice netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } - for (i = 1; i <= 17; i++) { + while (lkk[0]!='\r') { /*empty line has been found, goes ahead*/ + //strcpy(laux,lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); } + fseek(fLJR, -2, SEEK_CUR); /*properly position the pointer*/ DoCalculations(lelement, lVGS, lVDS, lVth, lVDSAT, Vovd, Voff, Vdst, stats, &fNoSat); /*gets three lines with operating region*/ fprintf(fLJR, "%s\n", stats[0]); fprintf(fLJR, "%s\n", stats[1]); - fprintf(fLJR, "%s\n\n", stats[2]); + fprintf(fLJR, "%s\n\r\n", stats[2]); - for (i = 1; i <= 2; i++) { + for (i = 1; i <= 9; i++) { fgets2(lkk, LONGSTRINGSIZE, fLIS); - if (i > 1) + if ((i > 1) || (int)strlen(lkk)) fprintf(fLJR, "%s\n", lkk); + if (strpos2(lkk, "Name: ", 1)) /*breaks loop only if string is found, BUT unlike the code above in here it might be the last MOSTFET group*/ + break; } } @@ -514,7 +592,8 @@ char l1[LONGSTRINGSIZE], l2[LONGSTRINGSIZE]; /*l1 and l2 are hold places for previous lines*/ fgets2(l1, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", l1); fgets2(l2, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", l2); -/*bsim3v3*/ while ((strcmp((sprintf(laux, "%.18s", lkk), laux), "Primitive: bsim3v3") != 0) & (!P_eof(fLIS))) { + while ((strcmp((sprintf(laux, "%.15s", lkk), laux), "Primitive: bsim") != 0) & (!P_eof(fLIS))) { +/*bsim3v3*/ // while ((strcmp((sprintf(laux, "%.18s", lkk), laux), "Primitive: bsim3v3") != 0) & (!P_eof(fLIS))) { /*bsim4*/ // while ((strcmp((sprintf(laux, "%.16s", lkk), laux), "Primitive: bsim4") != 0) & (!P_eof(fLIS))) { strcpy(l1, l2); strcpy(l2, lkk); @@ -527,8 +606,10 @@ } } -/*bsim3v3*/ sprintf(laux, "%.18s", lkk); -/*bsim3v3*/ if (!strcmp(laux, "Primitive: bsim3v3")) { + sprintf(laux, "%.15s", lkk); + if (!strcmp(laux, "Primitive: bsim")) { +/*bsim3v3*/ // sprintf(laux, "%.18s", lkk); +/*bsim3v3*/ // if (!strcmp(laux, "Primitive: bsim3v3")) { /*bsim4*/ // sprintf(laux, "%.16s", lkk); /*bsim4*/ // if (!strcmp(laux, "Primitive: bsim4")) { for (i = 1; i <= 0; i++) { @@ -536,126 +617,45 @@ fprintf(fLJR, "%s\n", lkk); } -/*bsim3v3*/ while (strpos2(lkk, "Primitive: bsim3v3", 1) != 0) { /*find operating region for all transistors*/ + while (strpos2(lkk, "Primitive: bsim", 1) != 0) { /*find operating region for all transistors*/ +/*bsim3v3*/ // while (strpos2(lkk, "Primitive: bsim3v3", 1) != 0) { /*find operating region for all transistors*/ /*bsim4*/ // while (strpos2(lkk, "Primitive: bsim4", 1) != 0) { /*find operating region for all transistors*/ strcpy(lelement, l1); if (strpos2(lelement, " of ", 1)) { /*to remove the library name if and when it appears*/ lelement[strpos2(lelement, " of ", 1)]='\0'; } -/*bsim3v3*/ for (i = 1; i <= 9; i++) { -/*bsim4*/ // for (i = 1; i <= 7; i++) { - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - } - fgets2(lVGS, LONGSTRINGSIZE, fLIS); /*Vgs*/ - fprintf(fLJR, "%s\n", lVGS); - { - i=1; ReadSubKey(laux, lVGS, &i, '=', 'V', 5); - i=strpos2(laux, " ", 2); - if ((laux[i]==109)) { /* 109=m; mV */ - laux[i-1]='\0'; - strcat(laux, "e-3"); - } - if ((laux[i]==117)) { /* 117=u; uV */ - laux[i-1]='\0'; - strcat(laux, "e-6"); - } - if ((laux[i]==110)) { /* 110=n; nV */ - laux[i-1]='\0'; - strcat(laux, "e-9"); - } - sprintf(lVGS, " %s", laux); /* Puts the value on the expected column for DoCalculations */ - } - fgets2(lVDS, LONGSTRINGSIZE, fLIS); /*Vds*/ - fprintf(fLJR, "%s\n", lVDS); - { - i=1; ReadSubKey(laux, lVDS, &i, '=', 'V', 5); - i=strpos2(laux, " ", 2); - if ((laux[i]==109)) { /* 109=m; mV */ - laux[i-1]='\0'; - strcat(laux, "e-3"); - } - if ((laux[i]==117)) { /* 117=u; uV */ - laux[i-1]='\0'; - strcat(laux, "e-6"); - } - if ((laux[i]==110)) { /* 110=n; nV */ - laux[i-1]='\0'; - strcat(laux, "e-9"); - } - sprintf(lVDS, " %s", laux); /* Puts the value on the expected column for DoCalculations */ - } - fgets2(lkk, LONGSTRINGSIZE, fLIS); - fprintf(fLJR, "%s\n", lkk); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - { //begin -- required for versions after the 2nd half of 2006 who have 3 more lines in between "vds" and "vth" - if (!strpos2(lVth, "vth =", 1)) { - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - fgets2(lVth, LONGSTRINGSIZE, fLIS); /*Vth*/ - fprintf(fLJR, "%s\n", lVth); - } - if (!strpos2(lVth, "vth =", 1)) { /*Double-check just to be sure that vth was found*/ - printf("auxfunc_updatelis.c - Spectre netlist format not supported\n"); - exit(EXIT_FAILURE); - } - } //end -- required for versions after the 2nd half of 2006 who have 3 more lines in between "vds" and "vth" - { - i=1; ReadSubKey(laux, lVth, &i, '=', 'V', 5); - i=strpos2(laux, " ", 2); - if ((laux[i]==109)) { /* 109=m; mV */ - laux[i-1]='\0'; - strcat(laux, "e-3"); - } - if ((laux[i]==117)) { /* 117=u; uV */ - laux[i-1]='\0'; - strcat(laux, "e-6"); - } - if ((laux[i]==110)) { /* 110=n; nV */ - laux[i-1]='\0'; - strcat(laux, "e-9"); - } - sprintf(lVth, " %s", laux); /* Puts the value on the expected column for DoCalculations */ - } - fgets2(lVDSAT, LONGSTRINGSIZE, fLIS); /*Vdsat*/ - fprintf(fLJR, "%s\n", lVDSAT); - { - i=1; ReadSubKey(laux, lVDSAT, &i, '=', 'V', 5); - i=strpos2(laux, " ", 2); - if ((laux[i]==109)) { /* 109=m; mV */ - laux[i-1]='\0'; - strcat(laux, "e-3"); - } - if ((laux[i]==117)) { /* 117=u; uV */ - laux[i-1]='\0'; - strcat(laux, "e-6"); - } - if ((laux[i]==110)) { /* 110=n; nV */ - laux[i-1]='\0'; - strcat(laux, "e-9"); - } - sprintf(lVDSAT, " %s", laux); /* Puts the value on the expected column for DoCalculations */ + ReadKeyPrintLine(lVGS, "vgs = ", fLIS, fLJR); + if (!strpos2(lVGS, "vgs = ", 1)) { + printf("auxfunc_updatelis.c - Spectre netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + SpectreStripSI(lVGS, '=', 'V'); + ReadKeyPrintLine(lVDS, "vds = ", fLIS, fLJR); + if (!strpos2(lVDS, "vds = ", 1)) { + printf("auxfunc_updatelis.c - Spectre netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + SpectreStripSI(lVDS, '=', 'V'); + ReadKeyPrintLine(lVth, "vth = ", fLIS, fLJR); + if (!strpos2(lVth, "vth = ", 1)) { + printf("auxfunc_updatelis.c - Spectre netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); + } + SpectreStripSI(lVth, '=', 'V'); + ReadKeyPrintLine(lVDSAT, "vdsat = ", fLIS, fLJR); + if (!strpos2(lVDSAT, "vdsat = ", 1)) { + printf("auxfunc_updatelis.c - Spectre netlist (%s) format has changed significantly\n", InputFile); + exit(EXIT_FAILURE); } + SpectreStripSI(lVDSAT, '=', 'V'); - for (i = 1; i <= 45; i++) { + while ((int)strlen(lkk)) { /*empty line has been found, goes ahead*/ + //strcpy(laux,lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); fprintf(fLJR, "%s\n", lkk); } - { //begin -- required for versions after the 2nd half of 2006 who have 3 more lines in between "vds" and "vth" - fgets2(lkk, LONGSTRINGSIZE, fLIS); - //fprintf(fLJR, "%s\n", lkk); - //if ((int)(strlen(InputFile))) { /*empty line has been found, goes ahead*/ - // i=0; - //} - while (strpos2(lkk, " = ", 1)) { /*empty line has been found, goes ahead*/ - fprintf(fLJR, "%s\n", lkk); - fgets2(lkk, LONGSTRINGSIZE, fLIS); - } - } //end -- required for versions after the 2nd half of 2006 who have 3 more lines in between "vds" and "vth" + fseek(fLJR, -1, SEEK_CUR); /*properly position the pointer*/ DoCalculations(lelement, lVGS, lVDS, lVth, lVDSAT, Vovd, Voff, Vdst, stats, &fNoSat); /*gets three lines with operating region*/ fprintf(fLJR, "%s\n", stats[0]); @@ -663,13 +663,14 @@ fprintf(fLJR, "%s\n\n", stats[2]); - - for (i = 1; i <= 3; i++) { + for (i = 1; i <= 9; i++) { strcpy(l1, l2); strcpy(l2, lkk); fgets2(lkk, LONGSTRINGSIZE, fLIS); if (i > 0) fprintf(fLJR, "%s\n", lkk); + if (strpos2(lkk, "Primitive: bsim", 1)) /*breaks loop only if string is found, BUT unlike the code above in here it might be the last MOSTFET group*/ + break; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ASCO-0.4.9/version.h new/ASCO-0.4.10/version.h --- old/ASCO-0.4.9/version.h 2013-07-21 09:21:55.000000000 +0200 +++ new/ASCO-0.4.10/version.h 2016-08-13 11:29:16.252733860 +0200 @@ -1 +1 @@ -#define VERSION "ASCO-0.4.9" +#define VERSION "ASCO-0.4.10" ++++++ asco-0.4.10-fix-implicit-declaration.patch ++++++ diff -up ASCO-0.4.10/auxfunc_alter.c.orig ASCO-0.4.10/auxfunc_alter.c --- ASCO-0.4.10/auxfunc_alter.c.orig 2018-06-16 11:06:54.670370834 +0200 +++ ASCO-0.4.10/auxfunc_alter.c 2018-06-16 11:07:09.850371354 +0200 @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #ifdef __MINGW32__ #include <winsock2.h> #endif diff -up ASCO-0.4.10/tools/alter/auxfunc_alter.c.orig ASCO-0.4.10/tools/alter/auxfunc_alter.c --- ASCO-0.4.10/tools/alter/auxfunc_alter.c.orig 2018-06-16 11:07:01.150371056 +0200 +++ ASCO-0.4.10/tools/alter/auxfunc_alter.c 2018-06-16 11:07:18.942371665 +0200 @@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #ifdef __MINGW32__ #include <winsock2.h> #endif
