Add a new compatibility mode xs (for XSPICE)

This commit is contained in:
Holger Vogt 2022-11-24 14:43:16 +01:00
parent f2be3d681d
commit d763b39ec3
2 changed files with 8 additions and 2 deletions

View File

@ -773,7 +773,7 @@ char *find_back_assignment(const char *p, const char *start)
/* Set a compatibility flag. /* Set a compatibility flag.
Currently available are flags for: Currently available are flags for:
- LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre - LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre, XSPICE
*/ */
struct compat newcompat; struct compat newcompat;
static void set_compat_mode(void) static void set_compat_mode(void)
@ -781,6 +781,7 @@ static void set_compat_mode(void)
char behaviour[80]; char behaviour[80];
newcompat.hs = FALSE; newcompat.hs = FALSE;
newcompat.ps = FALSE; newcompat.ps = FALSE;
newcompat.xs = FALSE;
newcompat.lt = FALSE; newcompat.lt = FALSE;
newcompat.ki = FALSE; newcompat.ki = FALSE;
newcompat.a = FALSE; newcompat.a = FALSE;
@ -793,6 +794,8 @@ static void set_compat_mode(void)
newcompat.isset = newcompat.hs = TRUE; /*HSPICE*/ newcompat.isset = newcompat.hs = TRUE; /*HSPICE*/
if (strstr(behaviour, "ps")) if (strstr(behaviour, "ps"))
newcompat.isset = newcompat.ps = TRUE; /*PSPICE*/ newcompat.isset = newcompat.ps = TRUE; /*PSPICE*/
if (strstr(behaviour, "xs"))
newcompat.isset = newcompat.xs = TRUE; /*XSPICE*/
if (strstr(behaviour, "lt")) if (strstr(behaviour, "lt"))
newcompat.isset = newcompat.lt = TRUE; /*LTSPICE*/ newcompat.isset = newcompat.lt = TRUE; /*LTSPICE*/
if (strstr(behaviour, "ki")) if (strstr(behaviour, "ki"))
@ -820,7 +823,7 @@ static void set_compat_mode(void)
} }
/* reset everything for 'make check' */ /* reset everything for 'make check' */
if (newcompat.mc) if (newcompat.mc)
newcompat.eg = newcompat.hs = newcompat.spe = newcompat.ps = newcompat.eg = newcompat.hs = newcompat.spe = newcompat.ps = newcompat.xs =
newcompat.ll = newcompat.lt = newcompat.ki = newcompat.a = FALSE; newcompat.ll = newcompat.lt = newcompat.ki = newcompat.a = FALSE;
} }
@ -835,6 +838,8 @@ static void print_compat_mode(void) {
fprintf(stdout, " hs"); fprintf(stdout, " hs");
if (newcompat.ps) if (newcompat.ps)
fprintf(stdout, " ps"); fprintf(stdout, " ps");
if (newcompat.xs)
fprintf(stdout, " xs");
if (newcompat.lt) if (newcompat.lt)
fprintf(stdout, " lt"); fprintf(stdout, " lt");
if (newcompat.ki) if (newcompat.ki)

View File

@ -16,6 +16,7 @@ struct compat
bool spe; /* spectre */ bool spe; /* spectre */
bool eg; /* EAGLE */ bool eg; /* EAGLE */
bool mc; /* to be set for 'make check' */ bool mc; /* to be set for 'make check' */
bool xs; /* XSPICE */
}; };
extern struct compat newcompat; extern struct compat newcompat;