Merge branch 'pre-master-44' into bt_dev

This commit is contained in:
Brian Taylor 2024-08-21 09:00:56 -07:00
commit 08c0c01265
4 changed files with 54 additions and 40 deletions

View File

@ -36,6 +36,8 @@ extern char *spice_analysis_get_name(int index);
extern char *spice_analysis_get_description(int index);
extern int EVTsetup_plot(CKTcircuit* ckt, char* plotname);
extern IFsimulator SIMinfo;
extern char Spice_Build_Date[];
static int beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analName,
char *refName, int refType, int numNames, char **dataNames, int dataType,
@ -915,6 +917,9 @@ fileInit(runDesc *run)
sprintf(buf, "Date: %s\n", datestring());
n += strlen(buf);
fputs(buf, run->fp);
sprintf(buf, "Command: %s-%s, Build %s\n", ft_sim->simulator, ft_sim->version, Spice_Build_Date);
n += strlen(buf);
fputs(buf, run->fp);
sprintf(buf, "Plotname: %s\n", run->type);
n += strlen(buf);
fputs(buf, run->fp);
@ -933,7 +938,6 @@ fileInit(runDesc *run)
run->pointPos = (long) n;
fprintf(run->fp, "0 \n"); /* Save 8 spaces here. */
/*fprintf(run->fp, "Command: version %s\n", ft_sim->version);*/
fprintf(run->fp, "Variables:\n");
printf("No. of Data Columns : %d \n", run->numData);

View File

@ -21,6 +21,8 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "ngspice/compatmode.h"
extern IFsimulator SIMinfo;
extern char Spice_Build_Date[];
static void fixdims(struct dvec *v, char *s);
@ -112,6 +114,7 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary)
fprintf(fp, "Title: %s\n", pl->pl_title);
fprintf(fp, "Date: %s\n", pl->pl_date);
fprintf(fp, "Command: %s-%s, Build %s\n", ft_sim->simulator, ft_sim->version, Spice_Build_Date);
fprintf(fp, "Plotname: %s\n", pl->pl_name);
fprintf(fp, "Flags: %s%s\n",
realflag ? "real" : "complex", raw_padding ? "" : " unpadded");
@ -121,11 +124,11 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary)
dimstring(dims, numdims, buf);
fprintf(fp, "Dimensions: %s\n", buf);
}
for (wl = pl->pl_commands; wl; wl = wl->wl_next) {
fprintf(fp, "Command: %s\n", wl->wl_word);
if (pl->pl_commands) {
for (wl = pl->pl_commands; wl; wl = wl->wl_next) {
fprintf(fp, "Command: %s\n", wl->wl_word);
}
}
for (vv = pl->pl_env; vv; vv = vv->va_next) {
wl = cp_varwl(vv);
if (vv->va_type == CP_BOOL) {
@ -451,15 +454,19 @@ raw_read(char *name) {
} else if (ciprefix("command:", buf)) {
/* Note that we reverse these commands eventually... */
s = SKIP(buf);
NONL(s);
if (curpl) {
curpl->pl_commands = wl_cons(copy(s), curpl->pl_commands);
wl = curpl->pl_commands;
} else {
fprintf(cp_err, "Error: misplaced Command: line\n");
/* Exec command only if not ngspice simulator info */
if (!ciprefix(ft_sim->simulator, s)) {
NONL(s);
if (curpl) {
curpl->pl_commands = wl_cons(copy(s), curpl->pl_commands);
wl = curpl->pl_commands;
}
else {
fprintf(cp_err, "Error: misplaced Command: line\n");
}
/* Now execute the command if we can. */
(void)cp_evloop(s);
}
/* Now execute the command if we can. */
(void) cp_evloop(s);
} else if (ciprefix("option:", buf)) {
s = SKIP(buf);
NONL(s);

View File

@ -1114,6 +1114,9 @@ int ngSpice_Command(char* comexec)
return 1;
}
if (ft_ngdebug)
fprintf(stdout, "\nngSpiceCommand: received command '%s'\n", comexec);
if ( ! setjmp(errbufc) ) {
immediate = FALSE;

View File

@ -40,18 +40,18 @@ static unsigned char previous_output[outs + inouts];
/* The input function: it should ignore out-of-range values of index. */
#define VL_DATA(size, name, msb, lsb) \
if (index >= msb - lsb + 1) { \
index -= msb - lsb + 1; \
} else if (msb == 0 && lsb == 0) { \
topp->name = val ? 1 : 0; \
return; \
} else { \
if (val) \
topp->name |= (1 << (msb - index)); \
else \
topp->name &= (1 << (msb - index)); \
return; \
#define VL_DATA(size, name, msb, lsb) \
if (index >= msb - lsb + 1) { \
index -= msb - lsb + 1; \
} else if (msb == 0 && lsb == 0) { \
topp->name = val ? 1 : 0; \
return; \
} else { \
if (val) \
topp->name |= (1 << (msb - index)); \
else \
topp->name &= ~(1 << (msb - index)); \
return; \
}
static void accept_input(struct co_info *pinfo,
@ -70,21 +70,21 @@ static void accept_input(struct co_info *pinfo,
offset = outs;
#undef VL_DATA
#define VL_DATA(size, name, msb, lsb) \
if (index >= msb - lsb + 1) { \
index -= msb - lsb + 1; \
offset += msb - lsb + 1; \
} else if (msb == 0 && lsb == 0) { \
topp->name = val ? 1 : 0; \
previous_output[index + offset] = val; \
return; \
} else { \
if (val) \
topp->name | (1 << (msb - index)); \
else \
topp->name &= (1 << (msb - index)); \
previous_output[index + offset] = val; \
return; \
#define VL_DATA(size, name, msb, lsb) \
if (index >= msb - lsb + 1) { \
index -= msb - lsb + 1; \
offset += msb - lsb + 1; \
} else if (msb == 0 && lsb == 0) { \
topp->name = val ? 1 : 0; \
previous_output[index + offset] = val; \
return; \
} else { \
if (val) \
topp->name | (1 << (msb - index)); \
else \
topp->name &= ~(1 << (msb - index)); \
previous_output[index + offset] = val; \
return; \
}
#include "inouts.h"