Add a flag to indicate when U* devices are translated to Xspice. The flag is cleared in inp_spsource and set in u_instances. A call to were_devices_translated() has been added to the start of inp_probe, with a comment that the return value can be used for "probe alli" suppression. Code for suppression of alli is not included.
This commit is contained in:
parent
e0a22f01f6
commit
bc8d2605f9
|
|
@ -510,6 +510,10 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
|
||||||
startTime = seconds();
|
startTime = seconds();
|
||||||
/* inp_source() called with fp: load from file, */
|
/* inp_source() called with fp: load from file, */
|
||||||
/* called with *fp == NULL and intfile: we want to load circuit from circarray */
|
/* called with *fp == NULL and intfile: we want to load circuit from circarray */
|
||||||
|
|
||||||
|
/* Clear the flag indicating U* devices have been translated to Xspice */
|
||||||
|
set_udevices_translated(FALSE);
|
||||||
|
|
||||||
if (fp || intfile) {
|
if (fp || intfile) {
|
||||||
deck = inp_readall(fp, dir_name, comfile, intfile, &expr_w_temper);
|
deck = inp_readall(fp, dir_name, comfile, intfile, &expr_w_temper);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "ngspice/inpdefs.h"
|
#include "ngspice/inpdefs.h"
|
||||||
#include "ngspice/wordlist.h"
|
#include "ngspice/wordlist.h"
|
||||||
#include "ngspice/stringskip.h"
|
#include "ngspice/stringskip.h"
|
||||||
|
#include "inpcom.h"
|
||||||
|
|
||||||
void inp_probe(struct card* card);
|
void inp_probe(struct card* card);
|
||||||
void modprobenames(INPtables* tab);
|
void modprobenames(INPtables* tab);
|
||||||
|
|
@ -62,6 +63,9 @@ void inp_probe(struct card* deck)
|
||||||
if (probes == NULL)
|
if (probes == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* If were_udevices_translated() returns TRUE, then you can ignore alli */
|
||||||
|
(void) were_udevices_translated();
|
||||||
|
|
||||||
/* check for '.save' and (in a .control section) 'save'.
|
/* check for '.save' and (in a .control section) 'save'.
|
||||||
If not found, add '.save all' */
|
If not found, add '.save all' */
|
||||||
for (card = deck; card; card = card->nextcard) {
|
for (card = deck; card; card = card->nextcard) {
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,8 @@ static struct library {
|
||||||
|
|
||||||
static int num_libraries;
|
static int num_libraries;
|
||||||
|
|
||||||
|
static bool udevices_translated = FALSE;
|
||||||
|
|
||||||
struct names {
|
struct names {
|
||||||
char *names[N_SUBCKT_W_PARAMS];
|
char *names[N_SUBCKT_W_PARAMS];
|
||||||
int num_names;
|
int num_names;
|
||||||
|
|
@ -8350,6 +8352,16 @@ static void rem_double_braces(struct card* newcard)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_udevices_translated(bool val)
|
||||||
|
{
|
||||||
|
udevices_translated = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool were_udevices_translated(void)
|
||||||
|
{
|
||||||
|
return udevices_translated;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef INTEGRATE_UDEVICES
|
#ifdef INTEGRATE_UDEVICES
|
||||||
static void list_the_cards(struct card *startcard, char *prefix)
|
static void list_the_cards(struct card *startcard, char *prefix)
|
||||||
{
|
{
|
||||||
|
|
@ -8454,6 +8466,7 @@ static struct card *u_instances(struct card *startcard)
|
||||||
if (last_newcard) {
|
if (last_newcard) {
|
||||||
last_newcard->nextcard = card; // the .ends card
|
last_newcard->nextcard = card; // the .ends card
|
||||||
}
|
}
|
||||||
|
set_udevices_translated(TRUE);
|
||||||
} else {
|
} else {
|
||||||
models_ok = models_not_ok = 0;
|
models_ok = models_not_ok = 0;
|
||||||
udev_ok = udev_not_ok = 0;
|
udev_ok = udev_not_ok = 0;
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,6 @@
|
||||||
struct card *insert_new_line(struct card *card, char *line,
|
struct card *insert_new_line(struct card *card, char *line,
|
||||||
int linenum, int linenum_orig);
|
int linenum, int linenum_orig);
|
||||||
|
|
||||||
|
void set_udevices_translated(bool val);
|
||||||
|
bool were_udevices_translated(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue