From b09c46d2a501fbe5a937204b2ef0986d33fbe556 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Sat, 5 Nov 2022 21:07:46 +0000 Subject: [PATCH] Allow string-valued parameters to XSPICE device models with no default. The code model then sees the value NULL. Needed for the "family" parameter on logic models, used by automatic bridge insertion. --- src/xspice/mif/mif_inp2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xspice/mif/mif_inp2.c b/src/xspice/mif/mif_inp2.c index bb603f78a..41f606b9a 100644 --- a/src/xspice/mif/mif_inp2.c +++ b/src/xspice/mif/mif_inp2.c @@ -568,8 +568,15 @@ MIF_INP2A ( param_info = &(DEVices[type]->DEVpublic.param[i]); if(mdfast->param[i]->is_null) { + char* emessage; + if(! param_info->has_default) { - LITERR("Parameter on model has no default"); + if (param_info->type == MIF_STRING) + continue; // Allow NULL + emessage = tprintf("Parameter %s on model %s has no default", + param_info->name, mdfast->gen.GENmodName); + LITERR(emessage); + tfree(emessage); gc_end(); return; } else if((param_info->is_array) && (! param_info->has_conn_ref)) {