Compatmode 'de' to control all degradation sim procedures.

Differentiate between commands
degsim: remove circuit, reload from storage, remove deg monitors,
add instance deg parameters,
used to prepare for simulation with degraded devices,
and plainsim: remove circuit, reload from storage, remove deg monitors,
no change to instances instance
used to prepare for plain simulation without degradation.
This commit is contained in:
Holger Vogt 2026-02-16 21:37:21 +01:00
parent 749be37f5d
commit a5f5fe28fb
2 changed files with 24 additions and 10 deletions

View File

@ -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) {

View File

@ -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)