From d763b39ec36053fe58e75431c0385bf80cf5ea1b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 24 Nov 2022 14:43:16 +0100 Subject: [PATCH] Add a new compatibility mode xs (for XSPICE) --- src/frontend/inpcom.c | 9 +++++++-- src/include/ngspice/compatmode.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 7b6ad0f89..64acd47b3 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -773,7 +773,7 @@ char *find_back_assignment(const char *p, const char *start) /* Set a compatibility flag. Currently available are flags for: -- LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre +- LTSPICE, HSPICE, Spice3, PSPICE, KiCad, Spectre, XSPICE */ struct compat newcompat; static void set_compat_mode(void) @@ -781,6 +781,7 @@ static void set_compat_mode(void) char behaviour[80]; newcompat.hs = FALSE; newcompat.ps = FALSE; + newcompat.xs = FALSE; newcompat.lt = FALSE; newcompat.ki = FALSE; newcompat.a = FALSE; @@ -793,6 +794,8 @@ static void set_compat_mode(void) newcompat.isset = newcompat.hs = TRUE; /*HSPICE*/ if (strstr(behaviour, "ps")) newcompat.isset = newcompat.ps = TRUE; /*PSPICE*/ + if (strstr(behaviour, "xs")) + newcompat.isset = newcompat.xs = TRUE; /*XSPICE*/ if (strstr(behaviour, "lt")) newcompat.isset = newcompat.lt = TRUE; /*LTSPICE*/ if (strstr(behaviour, "ki")) @@ -820,7 +823,7 @@ static void set_compat_mode(void) } /* reset everything for 'make check' */ 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; } @@ -835,6 +838,8 @@ static void print_compat_mode(void) { fprintf(stdout, " hs"); if (newcompat.ps) fprintf(stdout, " ps"); + if (newcompat.xs) + fprintf(stdout, " xs"); if (newcompat.lt) fprintf(stdout, " lt"); if (newcompat.ki) diff --git a/src/include/ngspice/compatmode.h b/src/include/ngspice/compatmode.h index 5cbc26af5..1355a74ed 100644 --- a/src/include/ngspice/compatmode.h +++ b/src/include/ngspice/compatmode.h @@ -16,6 +16,7 @@ struct compat bool spe; /* spectre */ bool eg; /* EAGLE */ bool mc; /* to be set for 'make check' */ + bool xs; /* XSPICE */ }; extern struct compat newcompat;