diff --git a/src/frontend/inp.c b/src/frontend/inp.c index ecc7fdb8f..4a4118fda 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -66,6 +66,8 @@ extern void tprint(struct card *deck); static bool wantdegsim = FALSE; extern int prepare_degsim(struct card* deck); +static bool wantplainsim = FALSE; +extern int prepare_plainsim(struct card* deck); //void inp_source_recent(void); //void inp_mc_free(void); @@ -1095,10 +1097,14 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) #endif /* If compatmode is de and degsim is set by command 'degsim', translate the netlist by removing the monitors and adding the - extra degradation elements. */ - if (wantdegsim && newcompat.de) { - wantdegsim = FALSE; - prepare_degsim(deck); + extra degradation elements, e.g. instance parameters. */ + if (newcompat.de) { + if (wantdegsim) { + wantdegsim = FALSE; + prepare_degsim(deck); + } + else if (wantplainsim) + prepare_plainsim(deck); } /* Parsing the circuit 5. @@ -2713,6 +2719,9 @@ void setdegsim(void) { wantdegsim = TRUE; } +void setplainsim(void) { + wantplainsim = TRUE; +} #ifdef REM_UNUSED /* Finally get rid of unused MOS models */ static void rem_unused_mos_models(struct card* deck) { diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 75a3f3b07..a4359d8fb 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1127,13 +1127,18 @@ struct card *inp_readall(FILE *fp, const char *dir_name, const char* file_name, inp_check_syntax(working); /* collect .agemodel data, skip .agemodel if newcompat.de is not set */ - readdegparams(working); if (newcompat.de) { - /* replace all [ ] by @, except for a instances */ - remsqrbra(working); - - /* Add degradation monitors to devices in X lines */ - adddegmonitors(working); + int numdegmodels = readdegparams(working); + if (numdegmodels > 0) { + /* replace all [ ] by @, except for a instances */ + remsqrbra(working); + /* Add degradation monitors to devices in X lines */ + adddegmonitors(working); + } + else { + fprintf(stderr, "Warning: No valid agemodel data found, degradation sim not possible\n"); + newcompat.de = FALSE; /* skip inp.c, 1101 prepare_degsim()*/ + } } if (newcompat.lt && newcompat.a)