From 3e37603abb58f1f3c9ed0e936abeebd9c80b4ff3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 22 Jul 2025 15:42:10 +0200 Subject: [PATCH] When adding 'set soacheck' to spinit or .spiceinit, a line '.param SWSOA=1' is added near the top of the netlist, if not set, '.param SWSOA=0' is added. 'set soacheck' must be given in spinit or .spiceinit. Setting it in a .control section is too late, as parameters are already evaluated. Using the command 'option' would be too late as well. --- src/frontend/inpcom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index e31118e76..d7c8a99a0 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1880,6 +1880,11 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name comfile = TRUE; if (call_depth == 0 && !comfile) { + if (cp_getvar("soacheck", CP_BOOL, NULL, 0)) + insert_new_line(cc, copy(".param SWSOA=1"), 1, 0, "internal"); + else + insert_new_line(cc, copy(".param SWSOA=0"), 1, 0, "internal"); + if (!cp_getvar("no_auto_gnd", CP_BOOL, NULL, 0)) insert_new_line(cc, copy(".global gnd"), 1, 0, "internal"); else