From d20315309f9177a5dcf8bbe766e1836c8000c5ec Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 30 Apr 2026 11:26:17 +0200 Subject: [PATCH] Do not replace GND by 0 f if GND is used inside of the subcircuit and is referenced on the .subckt line, and ps is set. This will allow using this subcircuit with non-zero reference voltage. --- src/frontend/inpcom.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index f2c9361c8..357e38561 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2354,9 +2354,10 @@ static void inp_fix_gnd_name(struct card *c) if (*gnd == '*') continue; - // if inside of a subcircuit, and compatmode is ps, don't replace gnd + /* if inside of a subcircuit, and compatmode is ps, + and node gnd is on the .subckt line, don't replace gnd */ if (newcompat.ps) { - if (ciprefix(".subckt", c->line)) + if (ciprefix(".subckt", c->line) && search_plain_identifier(c->line, "gnd")) found_subckt = TRUE; if (ciprefix(".ends", c->line)) found_subckt = FALSE;