Add boolean variables as flags when XSPICE and/or OSDI are enabled

This commit is contained in:
Holger Vogt 2023-01-17 22:13:12 +01:00
parent af9f25e985
commit 1280e199a3
2 changed files with 21 additions and 0 deletions

View File

@ -824,6 +824,8 @@ int main(int argc, char **argv)
bool iflag = FALSE; /* flag for interactive mode */
bool qflag = FALSE; /* flag for command completion */
bool t = TRUE;
FILE * volatile circuit_file;
bool volatile oflag = FALSE;
bool srflag = FALSE;
@ -866,6 +868,7 @@ int main(int argc, char **argv)
}
#endif
ivars(argv[0]); /* Create internal variables */
/* Set default data sources */
@ -895,6 +898,15 @@ int main(int argc, char **argv)
cp_vset("rndseed", CP_NUM, &ii);
com_sseed(NULL);
/* set a boolean variable when XSPICE and/or OSDI is enabled,
to be used in spinit etc. */
#if defined(SIMULATOR) && defined(XSPICE)
cp_vset("xspice_enabled", CP_BOOL, &t);
#endif
#if defined(SIMULATOR) && defined(OSDI)
cp_vset("osdi_enabled", CP_BOOL, &t);
#endif
/* --- Process command line options --- */
for (;;) {
enum { soa_log = 1001, };

View File

@ -899,6 +899,15 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi
bool sm = TRUE;
cp_vset("sharedmode", CP_BOOL, &sm);
/* set a boolean variable when XSPICE and/or OSDI is enabled,
to be used in spinit etc. */
#if defined(XSPICE)
cp_vset("xspice_enabled", CP_BOOL, &sm);
#endif
#if defined(OSDI)
cp_vset("osdi_enabled", CP_BOOL, &sm);
#endif
/*parameter fetcher, used in show, alter, altermod */
if_getparam = spif_getparam_special;