Browse Source

flag for compatibility mode

pre-master-46
h_vogt 17 years ago
parent
commit
13819432bd
  1. 6
      ChangeLog
  2. 35
      src/frontend/numparam/xpressn.c
  3. 12
      src/include/compatmode.h
  4. 32
      src/main.c
  5. 9
      visualc/vngspice.vcproj

6
ChangeLog

@ -1,3 +1,7 @@
2009-11-15 Holger Vogt
* main.c, src/include/compatmode.h: compatibility mode flag for HSPICE and SPICE3
xpressn.c: compatmode removed
============================ Rework-20 ==================================
2009-11-09 Dietmar Warning
* subckt.c: support of 5-terminal bjt's in subckt's by prepending subckt name (similar
@ -8,7 +12,7 @@
* numparam/mystring.c: using floor and ceil from math lib for rounding and truncation
2009-11-07 Holger Vogt
* winmain.c: replace strdup()y copy()
* winmain.c: replace strdup() by copy()
2009-10-31 Holger Vogt
* winmain.c: windows updated more often

35
src/frontend/numparam/xpressn.c

@ -1,7 +1,8 @@
/* xpressn.c Copyright (C) 2002 Georg Post
*
* This file is part of Numparam, see: readme.txt
* Free software under the terms of the GNU Lesser General Public License
This file is part of Numparam, see: readme.txt
Free software under the terms of the GNU Lesser General Public License
$Id$
*/
#include <stdio.h> /* for function message() only. */
@ -9,36 +10,15 @@
#include "general.h"
#include "numparam.h"
#include "ngspice.h"
/* preliminary, until upload problem h_vogt is solved */
//#include "../compatmode.h"
#include "cpdefs.h"
#include "ftedefs.h"
#include "dvec.h"
#include "../frontend/variable.h"
/* end preliminary */
#include "compatmode.h"
/* random numbers in /maths/misc/randnumb.c */
extern double gauss();
/* preliminary until upload problem h_vogt is solved */
typedef enum {
COMPATMODE_NATIVE = 0,
COMPATMODE_HSPICE = 1
} COMPATMODE_T ;
COMPATMODE_T ngpsice_compat_mode(void)
{
char behaviour[80] ;
if( cp_getvar("ngbehavior", VT_STRING, behaviour)){
if (strcasecmp(behaviour,"hspice")==0)
return( COMPATMODE_HSPICE ) ;
}
return(COMPATMODE_NATIVE) ;
} /* end ngspice_compat_mode() */
/* end preliminary */
extern COMPATMODE_T ngspice_compat_mode(void) ;
/************ keywords ************/
@ -198,7 +178,8 @@ initdico (tdico * dico)
dico->stack[dico->tos] = 0; /* global data beneath */
initkeys ();
compat_mode = ngpsice_compat_mode() ;
compat_mode = ngspice_compat_mode() ;
if( compat_mode == COMPATMODE_HSPICE )
dico->hspice_compatibility = 1 ;
else

12
src/include/compatmode.h

@ -0,0 +1,12 @@
#ifndef _COMPATMODE_H
#define _COMPATMODE_H
#include <config.h>
typedef enum {
COMPATMODE_NATIVE = 0,
COMPATMODE_HSPICE = 1,
COMPATMODE_SPICE3 = 2
} COMPATMODE_T ;
#endif

32
src/main.c

@ -53,6 +53,7 @@ extern int rl_catch_signals; /* missing from editline/readline.h */
#include "frontend/variable.h"
#include "frontend/display.h" /* added by SDB to pick up Input() fcn */
#include "frontend/signal_handler.h"
#include "compatmode.h"
/* saj xspice headers */
#ifdef XSPICE
@ -188,9 +189,14 @@ bool ft_nutmeg = FALSE;
extern struct comm spcp_coms[ ];
struct comm *cp_coms = spcp_coms;
extern int OUTpBeginPlot(), OUTpData(), OUTwBeginPlot(), OUTwReference();
extern int OUTwData(), OUTwEnd(), OUTendPlot(), OUTbeginDomain();
extern int OUTendDomain(), OUTstopnow(), OUTerror(), OUTattributes();
extern int OUTpBeginPlot(void *,void *,IFuid,IFuid,int,int,IFuid *,int,void **);
extern int OUTpData(void *,IFvalue *,IFvalue *);
extern int OUTwBeginPlot(void *,void *,IFuid,IFuid,int,int,IFuid *,int,void **);
extern int OUTwReference(void *,IFvalue *,void **);
extern int OUTwData(void *,int,IFvalue *,void *), OUTwEnd(void *), OUTendPlot(void *);
extern int OUTbeginDomain(void *,IFuid,int,IFvalue *);
extern int OUTendDomain(void *), OUTstopnow(void), OUTerror(int,char *,IFuid *);
extern int OUTattributes(void *,IFuid *,int,IFvalue *);
IFfrontEnd nutmeginfo = {
IFnewUid,
@ -346,6 +352,26 @@ double CONSTe;
IFfrontEnd *SPfrontEnd = NULL;
int DEVmaxnum = 0;
/* -------------------------------------------------------------------------- */
/* Set a compatibility flag.
Currently available are flags for:
ngspice (standard)
HSPICE
Spice3
*/
COMPATMODE_T ngspice_compat_mode(void)
{
char behaviour[80] ;
if( cp_getvar("ngbehavior", VT_STRING, behaviour)){
if (strcasecmp(behaviour,"hspice")==0)
return( COMPATMODE_HSPICE ) ;
if (strcasecmp(behaviour,"spice3")==0)
return( COMPATMODE_SPICE3 ) ;
}
return(COMPATMODE_NATIVE) ;
} /* end ngspice_compat_mode() */
/* -------------------------------------------------------------------------- */
int
SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)

9
visualc/vngspice.vcproj

@ -24,14 +24,13 @@
>
<Tool
Name="VCPreBuildEventTool"
Description=""
CommandLine=""
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
Description="Custom defined Build: Recompile conf.c with actual date"
CommandLine="del $(IntDir)\conf.obj"
CommandLine="del $(IntDir)\conf.obj&#x0D;&#x0A;"
Outputs="$(IntDir)\conf.obj"
/>
<Tool
@ -119,7 +118,7 @@
<Tool
Name="VCCustomBuildTool"
Description="Custom defined Build: Recompile conf.c with actual date"
CommandLine="del $(IntDir)\conf.obj"
CommandLine="del $(IntDir)\conf.obj&#x0D;&#x0A;"
Outputs="$(IntDir)\conf.obj"
/>
<Tool
@ -829,6 +828,10 @@
RelativePath="..\src\frontend\commands.h"
>
</File>
<File
RelativePath="..\src\include\compatmode.h"
>
</File>
<File
RelativePath="..\src\frontend\parser\complete.h"
>

Loading…
Cancel
Save