allow wave alias naming, fix off-by-one errors in plot_raw_custom_data() calls
This commit is contained in:
parent
b95d78734f
commit
4ebf3ea601
|
|
@ -649,14 +649,26 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
||||||
sweep_idx = get_raw_index(stok);
|
sweep_idx = get_raw_index(stok);
|
||||||
if( sweep_idx == -1) sweep_idx = 0;
|
if( sweep_idx == -1) sweep_idx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bus_msb = strstr(ntok, ",");
|
bus_msb = strstr(ntok, ",");
|
||||||
j = -1;
|
j = -1;
|
||||||
if(!bus_msb && strstr(ntok, " ")) {
|
if(!bus_msb && xctx->graph_values) {
|
||||||
j = xctx->graph_nvars;
|
char *express = NULL;
|
||||||
plot_raw_custom_data(sweep_idx, 0, xctx->graph_allpoints, ntok);
|
int ofs = 0;
|
||||||
} else {
|
if(strstr(ntok, ";")) {
|
||||||
j = get_raw_index(ntok);
|
my_strdup2(1505, &express, find_nth(ntok, ";", 2));
|
||||||
|
} else {
|
||||||
|
my_strdup2(1506, &express, ntok);
|
||||||
|
}
|
||||||
|
if(strstr(express, " ")) {
|
||||||
|
j = xctx->graph_nvars;
|
||||||
|
for(dset = 0 ; dset < xctx->graph_datasets; dset++) {
|
||||||
|
plot_raw_custom_data(sweep_idx, ofs, ofs + xctx->graph_npoints[dset] - 1, express);
|
||||||
|
ofs += xctx->graph_npoints[dset];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
j = get_raw_index(express);
|
||||||
|
}
|
||||||
|
my_free(1507, &express);
|
||||||
}
|
}
|
||||||
if(j >= 0) {
|
if(j >= 0) {
|
||||||
int ofs = 0;
|
int ofs = 0;
|
||||||
|
|
|
||||||
48
src/draw.c
48
src/draw.c
|
|
@ -2114,14 +2114,27 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee
|
||||||
if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", find_nth(ntok, ";,", 1), gr->unity_suffix);
|
if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", find_nth(ntok, ";,", 1), gr->unity_suffix);
|
||||||
else my_snprintf(tmpstr, S(tmpstr), "%s",find_nth(ntok, ";,", 1));
|
else my_snprintf(tmpstr, S(tmpstr), "%s",find_nth(ntok, ";,", 1));
|
||||||
} else {
|
} else {
|
||||||
if(xctx->graph_sim_type == 3) {
|
char *ntok_ptr = NULL;
|
||||||
if(strstr(ntok, "ph(") == ntok || strstr(ntok, "_ph"))
|
char *alias_ptr = NULL;
|
||||||
my_snprintf(tmpstr, S(tmpstr), "%s[Phase]", ntok);
|
if(strstr(ntok, ";")) {
|
||||||
else
|
my_strdup2(646, &alias_ptr, find_nth(ntok, ";", 1));
|
||||||
my_snprintf(tmpstr, S(tmpstr), "%s[dB]", ntok);
|
my_strdup2(665, &ntok_ptr, find_nth(ntok, ";", 2));
|
||||||
}
|
}
|
||||||
else if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", ntok, gr->unity_suffix);
|
else {
|
||||||
else my_snprintf(tmpstr, S(tmpstr), "%s", ntok);
|
my_strdup2(925, &alias_ptr, ntok);
|
||||||
|
my_strdup2(1155, &ntok_ptr, ntok);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(xctx->graph_sim_type == 3) {
|
||||||
|
if(strstr(ntok, "ph(") == ntok_ptr || strstr(ntok_ptr, "_ph"))
|
||||||
|
my_snprintf(tmpstr, S(tmpstr), "%s[Phase]", alias_ptr);
|
||||||
|
else
|
||||||
|
my_snprintf(tmpstr, S(tmpstr), "%s[dB]", alias_ptr);
|
||||||
|
}
|
||||||
|
else if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", alias_ptr, gr->unity_suffix);
|
||||||
|
else my_snprintf(tmpstr, S(tmpstr), "%s", alias_ptr);
|
||||||
|
my_free(1188, &alias_ptr);
|
||||||
|
my_free(1189, &ntok_ptr);
|
||||||
}
|
}
|
||||||
if(gr->digital) {
|
if(gr->digital) {
|
||||||
double xt = gr->x1 - 10 * gr->txtsizelab;
|
double xt = gr->x1 - 10 * gr->txtsizelab;
|
||||||
|
|
@ -2383,6 +2396,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
|
||||||
int measure_p = -1;
|
int measure_p = -1;
|
||||||
double measure_x;
|
double measure_x;
|
||||||
double measure_prev_x;
|
double measure_prev_x;
|
||||||
|
char *express = NULL;
|
||||||
xRect *r = &xctx->rect[GRIDLAYER][i];
|
xRect *r = &xctx->rect[GRIDLAYER][i];
|
||||||
|
|
||||||
if(RECT_OUTSIDE( gr->sx1, gr->sy1, gr->sx2, gr->sy2,
|
if(RECT_OUTSIDE( gr->sx1, gr->sy1, gr->sx2, gr->sy2,
|
||||||
|
|
@ -2423,13 +2437,20 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
draw_graph_variables(wcnt, wave_color, n_nodes, sweep_idx, flags, ntok, stok, bus_msb, gr);
|
draw_graph_variables(wcnt, wave_color, n_nodes, sweep_idx, flags, ntok, stok, bus_msb, gr);
|
||||||
/* custom data plot */
|
/* if ntok following possible 'alias;' definition contains spaces --> custom data plot */
|
||||||
idx = -1;
|
idx = -1;
|
||||||
if(xctx->graph_values && !bus_msb && strstr(ntok, " ")) {
|
if(!bus_msb && xctx->graph_values) {
|
||||||
idx = xctx->graph_nvars;
|
if(strstr(ntok, ";")) {
|
||||||
|
my_strdup2(1191, &express, find_nth(ntok, ";", 2));
|
||||||
|
} else {
|
||||||
|
my_strdup2(1192, &express, ntok);
|
||||||
|
}
|
||||||
|
if(strstr(express, " ")) {
|
||||||
|
idx = xctx->graph_nvars;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* quickly find index number of ntok variable to be plotted */
|
/* quickly find index number of ntok variable to be plotted */
|
||||||
if( idx == xctx->graph_nvars || (idx = get_raw_index(bus_msb ? bus_msb : ntok)) != -1 ) {
|
if( idx == xctx->graph_nvars || (idx = get_raw_index(bus_msb ? bus_msb : express)) != -1 ) {
|
||||||
int p, dset, ofs;
|
int p, dset, ofs;
|
||||||
int poly_npoints;
|
int poly_npoints;
|
||||||
int first, last;
|
int first, last;
|
||||||
|
|
@ -2478,7 +2499,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
|
||||||
sweep_idx, wcnt, n_nodes, gr);
|
sweep_idx, wcnt, n_nodes, gr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(idx == xctx->graph_nvars) plot_raw_custom_data(sweep_idx, first, last, ntok);
|
if(idx == xctx->graph_nvars) plot_raw_custom_data(sweep_idx, first, last, express);
|
||||||
draw_graph_points(idx, first, last, point, wave_color, wcnt, n_nodes, gr);
|
draw_graph_points(idx, first, last, point, wave_color, wcnt, n_nodes, gr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2519,7 +2540,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
|
||||||
sweep_idx, wcnt, n_nodes, gr);
|
sweep_idx, wcnt, n_nodes, gr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(idx == xctx->graph_nvars) plot_raw_custom_data(sweep_idx, first, last, ntok);
|
if(idx == xctx->graph_nvars) plot_raw_custom_data(sweep_idx, first, last, express);
|
||||||
draw_graph_points(idx, first, last, point, wave_color, wcnt, n_nodes, gr);
|
draw_graph_points(idx, first, last, point, wave_color, wcnt, n_nodes, gr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2538,6 +2559,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr)
|
||||||
wcnt++;
|
wcnt++;
|
||||||
if(bus_msb) my_free(1453, &bus_msb);
|
if(bus_msb) my_free(1453, &bus_msb);
|
||||||
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
|
} /* while( (ntok = my_strtok_r(nptr, "\n\t ", "", &saven)) ) */
|
||||||
|
if(express) my_free(1487, &express);
|
||||||
my_free(1391, &node);
|
my_free(1391, &node);
|
||||||
my_free(1392, &color);
|
my_free(1392, &color);
|
||||||
my_free(1408, &sweep);
|
my_free(1408, &sweep);
|
||||||
|
|
|
||||||
120
src/save.c
120
src/save.c
|
|
@ -491,6 +491,7 @@ int get_raw_index(const char *node)
|
||||||
char vnode[300];
|
char vnode[300];
|
||||||
char lnode[300];
|
char lnode[300];
|
||||||
Int_hashentry *entry;
|
Int_hashentry *entry;
|
||||||
|
dbg(1, "get_raw_index(): node=%s, node=%s\n", node, node);
|
||||||
if(xctx->graph_values) {
|
if(xctx->graph_values) {
|
||||||
entry = int_hash_lookup(xctx->raw_table, node, 0, XLOOKUP);
|
entry = int_hash_lookup(xctx->raw_table, node, 0, XLOOKUP);
|
||||||
if(!entry) {
|
if(!entry) {
|
||||||
|
|
@ -523,6 +524,8 @@ int get_raw_index(const char *node)
|
||||||
#define INTEG -14
|
#define INTEG -14
|
||||||
#define AVG -15
|
#define AVG -15
|
||||||
#define DERIV -16
|
#define DERIV -16
|
||||||
|
#define EXCH -17
|
||||||
|
#define DUP -18
|
||||||
#define NUMBER -60
|
#define NUMBER -60
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -546,8 +549,9 @@ void plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
||||||
|
|
||||||
my_strdup2(574, &ntok_copy, expr);
|
my_strdup2(574, &ntok_copy, expr);
|
||||||
ntok_ptr = ntok_copy;
|
ntok_ptr = ntok_copy;
|
||||||
|
dbg(1, "plot_raw_custom_data(): expr=%s\n", expr);
|
||||||
while( (n = my_strtok_r(ntok_ptr, " \t\n", "", &ntok_save)) ) {
|
while( (n = my_strtok_r(ntok_ptr, " \t\n", "", &ntok_save)) ) {
|
||||||
if(stackptr1 >= STACKMAX -1) {
|
if(stackptr1 >= STACKMAX -2) {
|
||||||
dbg(0, "stack overflow in graph expression parsing. Interrupted\n");
|
dbg(0, "stack overflow in graph expression parsing. Interrupted\n");
|
||||||
my_free(576, &ntok_copy);
|
my_free(576, &ntok_copy);
|
||||||
return;
|
return;
|
||||||
|
|
@ -569,6 +573,8 @@ void plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
||||||
else if(!strcmp(n, "integ()")) stack1[stackptr1++].i = INTEG;
|
else if(!strcmp(n, "integ()")) stack1[stackptr1++].i = INTEG;
|
||||||
else if(!strcmp(n, "avg()")) stack1[stackptr1++].i = AVG;
|
else if(!strcmp(n, "avg()")) stack1[stackptr1++].i = AVG;
|
||||||
else if(!strcmp(n, "deriv()")) stack1[stackptr1++].i = DERIV;
|
else if(!strcmp(n, "deriv()")) stack1[stackptr1++].i = DERIV;
|
||||||
|
else if(!strcmp(n, "exch()")) stack1[stackptr1++].i = EXCH;
|
||||||
|
else if(!strcmp(n, "dup()")) stack1[stackptr1++].i = DUP;
|
||||||
else if( (v = strtod(n, &endptr)), !*endptr) {
|
else if( (v = strtod(n, &endptr)), !*endptr) {
|
||||||
stack1[stackptr1].i = NUMBER;
|
stack1[stackptr1].i = NUMBER;
|
||||||
stack1[stackptr1++].d = v;
|
stack1[stackptr1++].d = v;
|
||||||
|
|
@ -592,7 +598,7 @@ void plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
||||||
if(stack1[i].i == NUMBER) {
|
if(stack1[i].i == NUMBER) {
|
||||||
stack2[stackptr2++] = stack1[i].d;
|
stack2[stackptr2++] = stack1[i].d;
|
||||||
}
|
}
|
||||||
else if(stack1[i].i >=0 && stack1[i].i < xctx->graph_allpoints) { /* spice node */
|
else if(stack1[i].i >=0 && stack1[i].i < xctx->graph_nvars) { /* spice node */
|
||||||
stack2[stackptr2++] = xctx->graph_values[stack1[i].i][p];
|
stack2[stackptr2++] = xctx->graph_values[stack1[i].i][p];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -610,16 +616,81 @@ void plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
||||||
stackptr2--;
|
stackptr2--;
|
||||||
}
|
}
|
||||||
else if(stack1[i].i == DIVIS) {
|
else if(stack1[i].i == DIVIS) {
|
||||||
stack2[stackptr2 - 2] = stack2[stackptr2 - 2] / stack2[stackptr2 - 1];
|
if(p == first) stack1[i].prev = 0;
|
||||||
|
if(stack2[stackptr2 - 1]) {
|
||||||
|
stack2[stackptr2 - 2] = stack2[stackptr2 - 2] / stack2[stackptr2 - 1];
|
||||||
|
} else {
|
||||||
|
stack2[stackptr2 - 2] = stack1[i].prev;
|
||||||
|
}
|
||||||
|
stack1[i].prev = stack2[stackptr2 - 2];
|
||||||
stackptr2--;
|
stackptr2--;
|
||||||
}
|
}
|
||||||
else if(stack1[i].i == POW) {
|
else if(stack1[i].i == POW) {
|
||||||
stack2[stackptr2 - 2] = pow(stack2[stackptr2 - 2], stack2[stackptr2 - 1]);
|
stack2[stackptr2 - 2] = pow(stack2[stackptr2 - 2], stack2[stackptr2 - 1]);
|
||||||
stackptr2--;
|
stackptr2--;
|
||||||
}
|
}
|
||||||
|
else if(stack1[i].i == EXCH) {
|
||||||
|
double tmp;
|
||||||
|
tmp = stack2[stackptr2 - 2];
|
||||||
|
stack2[stackptr2 - 2] = stack2[stackptr2 - 1];
|
||||||
|
stack2[stackptr2 - 1] = tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(stackptr2 > 0) { /* 1 argument operators */
|
if(stackptr2 > 0) { /* 1 argument operators */
|
||||||
if(stack1[i].i == SIN) {
|
if(stack1[i].i == AVG) {
|
||||||
|
double avg = 0;
|
||||||
|
if( p == first ) {
|
||||||
|
avg = stack2[stackptr2 - 1];
|
||||||
|
stack1[i].prev = stack2[stackptr2 - 1];
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1];
|
||||||
|
stack1[i].prevx = x[p];
|
||||||
|
} else {
|
||||||
|
if((x[p] != stack1[i].prevx)) {
|
||||||
|
avg = stack1[i].prev * (x[p - 1] - stack1[i].prevx) +
|
||||||
|
(x[p] - x[p - 1]) * (stack1[i].prevy + stack2[stackptr2 - 1]) * 0.5;
|
||||||
|
avg /= (x[p] - stack1[i].prevx);
|
||||||
|
} else {
|
||||||
|
avg = stack1[i].prev;
|
||||||
|
}
|
||||||
|
stack1[i].prev = avg;
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1];
|
||||||
|
}
|
||||||
|
stack2[stackptr2 - 1] = avg;
|
||||||
|
}
|
||||||
|
else if(stack1[i].i == DUP) {
|
||||||
|
stack2[stackptr2] = stack2[stackptr2 - 1];
|
||||||
|
stackptr2++;
|
||||||
|
}
|
||||||
|
else if(stack1[i].i == INTEG) {
|
||||||
|
double integ = 0;
|
||||||
|
if( p == first ) {
|
||||||
|
integ = 0;
|
||||||
|
stack1[i].prev = 0;
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1];
|
||||||
|
} else {
|
||||||
|
integ = stack1[i].prev + (x[p] - x[p - 1]) * (stack1[i].prevy + stack2[stackptr2 - 1]) * 0.5;
|
||||||
|
stack1[i].prev = integ;
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1];
|
||||||
|
}
|
||||||
|
stack2[stackptr2 - 1] = integ;
|
||||||
|
}
|
||||||
|
else if(stack1[i].i == DERIV) {
|
||||||
|
double deriv = 0;
|
||||||
|
if( p == first ) {
|
||||||
|
deriv = 0;
|
||||||
|
stack1[i].prev = 0;
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1];
|
||||||
|
} else {
|
||||||
|
if((x[p] != x[p - 1]))
|
||||||
|
deriv = (stack2[stackptr2 - 1] - stack1[i].prevy) / (x[p] - x[p - 1]);
|
||||||
|
else
|
||||||
|
deriv = stack1[i].prevy;
|
||||||
|
stack1[i].prevy = stack2[stackptr2 - 1] ;
|
||||||
|
stack1[i].prev = deriv;
|
||||||
|
}
|
||||||
|
stack2[stackptr2 - 1] = deriv;
|
||||||
|
}
|
||||||
|
else if(stack1[i].i == SIN) {
|
||||||
stack2[stackptr2 - 1] = sin(stack2[stackptr2 - 1]);
|
stack2[stackptr2 - 1] = sin(stack2[stackptr2 - 1]);
|
||||||
}
|
}
|
||||||
else if(stack1[i].i == COS) {
|
else if(stack1[i].i == COS) {
|
||||||
|
|
@ -641,47 +712,6 @@ void plot_raw_custom_data(int sweep_idx, int first, int last, const char *expr)
|
||||||
stack2[stackptr2 - 1] = stack2[stackptr2 - 1] > 0.0 ? 1 :
|
stack2[stackptr2 - 1] = stack2[stackptr2 - 1] > 0.0 ? 1 :
|
||||||
stack2[stackptr2 - 1] < 0.0 ? -1 : 0;
|
stack2[stackptr2 - 1] < 0.0 ? -1 : 0;
|
||||||
}
|
}
|
||||||
else if(stack1[i].i == INTEG) {
|
|
||||||
double integ = 0;
|
|
||||||
if( p == first ) {
|
|
||||||
integ = 0;
|
|
||||||
stack1[i].prev = 0;
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1];
|
|
||||||
} else {
|
|
||||||
integ = stack1[i].prev + (x[p] - x[p - 1]) * (stack1[i].prevy + stack2[stackptr2 - 1]) * 0.5;
|
|
||||||
stack1[i].prev = integ;
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1];
|
|
||||||
}
|
|
||||||
stack2[stackptr2 - 1] = integ;
|
|
||||||
}
|
|
||||||
else if(stack1[i].i == AVG) {
|
|
||||||
double avg = 0;
|
|
||||||
if( p == first ) {
|
|
||||||
avg = stack2[stackptr2 - 1];
|
|
||||||
stack1[i].prev = stack2[stackptr2 - 1];
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1];
|
|
||||||
stack1[i].prevx = x[p];
|
|
||||||
} else {
|
|
||||||
avg = stack1[i].prev * (x[p - 1] - stack1[i].prevx) +
|
|
||||||
(x[p] - x[p - 1]) * (stack1[i].prevy + stack2[stackptr2 - 1]) * 0.5;
|
|
||||||
avg /= (x[p] - stack1[i].prevx);
|
|
||||||
stack1[i].prev = avg;
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1];
|
|
||||||
}
|
|
||||||
stack2[stackptr2 - 1] = avg;
|
|
||||||
}
|
|
||||||
|
|
||||||
else if(stack1[i].i == DERIV) {
|
|
||||||
double deriv = 0;
|
|
||||||
if( p == first ) {
|
|
||||||
deriv = 0;
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1];
|
|
||||||
} else {
|
|
||||||
deriv = (stack2[stackptr2 - 1] - stack1[i].prevy) / (x[p] - x[p - 1]);
|
|
||||||
stack1[i].prevy = stack2[stackptr2 - 1] ;
|
|
||||||
}
|
|
||||||
stack2[stackptr2 - 1] = deriv;
|
|
||||||
}
|
|
||||||
} /* else if(stackptr2 > 0) */
|
} /* else if(stackptr2 > 0) */
|
||||||
} /* for(i = 0; i < stackptr1; i++) */
|
} /* for(i = 0; i < stackptr1; i++) */
|
||||||
y[p] = stack2[0];
|
y[p] = stack2[0];
|
||||||
|
|
|
||||||
14
src/token.c
14
src/token.c
|
|
@ -763,7 +763,7 @@ const char *subst_token(const char *s, const char *tok, const char *new_val)
|
||||||
/* quote new_val if it contains newlines and not "name" token */
|
/* quote new_val if it contains newlines and not "name" token */
|
||||||
if(new_val) {
|
if(new_val) {
|
||||||
new_val_len = strlen(new_val);
|
new_val_len = strlen(new_val);
|
||||||
if(strcmp(tok, "name") && !is_quoted(new_val) && strpbrk(new_val, "\n \t")) {
|
if(strcmp(tok, "name") && !is_quoted(new_val) && strpbrk(new_val, ";\n \t")) {
|
||||||
new_val_copy = my_malloc(1210, new_val_len+3);
|
new_val_copy = my_malloc(1210, new_val_len+3);
|
||||||
my_snprintf(new_val_copy, new_val_len+3, "\"%s\"", new_val);
|
my_snprintf(new_val_copy, new_val_len+3, "\"%s\"", new_val);
|
||||||
}
|
}
|
||||||
|
|
@ -2704,7 +2704,7 @@ char *find_nth(const char *str, const char *sep, int n)
|
||||||
static int result_size = 0; /* safe to keep even with multiple schematic windows */
|
static int result_size = 0; /* safe to keep even with multiple schematic windows */
|
||||||
int i, len;
|
int i, len;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int count;
|
int count = -1;
|
||||||
|
|
||||||
if(!str) {
|
if(!str) {
|
||||||
my_free(1062, &result);
|
my_free(1062, &result);
|
||||||
|
|
@ -2724,16 +2724,22 @@ char *find_nth(const char *str, const char *sep, int n)
|
||||||
if(strchr(sep, result[i])) {
|
if(strchr(sep, result[i])) {
|
||||||
result[i]=0;
|
result[i]=0;
|
||||||
if(count==n) {
|
if(count==n) {
|
||||||
|
dbg(1, "1 find_nth(): returning %s\n", ptr);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
while(result[++i] && strchr(sep, result[i])) ;
|
i++;
|
||||||
|
while(result[i] && strchr(sep, result[i])) i++;
|
||||||
ptr = result + i;
|
ptr = result + i;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(count==n) return ptr;
|
if(count==n) {
|
||||||
|
dbg(1, "2 find_nth(): returning %s\n", ptr);
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
result[0] = '\0';
|
result[0] = '\0';
|
||||||
|
dbg(1, "3 find_nth(): returning %s\n", result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1541,9 +1541,10 @@ proc graph_update_nodelist {} {
|
||||||
}
|
}
|
||||||
# remove excess colors
|
# remove excess colors
|
||||||
set col [lrange $col 0 [expr {$n - 1}]]
|
set col [lrange $col 0 [expr {$n - 1}]]
|
||||||
if { [llength $col] != [llength [tolist [.graphdialog.center.right.text1 get 1.0 {end - 1 chars}]]] } {
|
## for debug
|
||||||
puts "PROBLEMS: colors and nodes of different length"
|
# if { [llength $col] != [llength [tolist [.graphdialog.center.right.text1 get 1.0 {end - 1 chars}]]] } {
|
||||||
}
|
# puts "PROBLEMS: colors and nodes of different length"
|
||||||
|
# }
|
||||||
} else {
|
} else {
|
||||||
set col {}
|
set col {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -18,8 +18,8 @@ B 2 1200 -500 1880 -310 {flags=graph
|
||||||
y1 = -0.0059
|
y1 = -0.0059
|
||||||
y2 = 11
|
y2 = 11
|
||||||
divy = 6
|
divy = 6
|
||||||
x1=0.0495785
|
x1=0.0367669
|
||||||
x2=0.0508396
|
x2=0.0373883
|
||||||
divx=10
|
divx=10
|
||||||
node="i(v.x1.vu)
|
node="i(v.x1.vu)
|
||||||
i(v.x0.vu)
|
i(v.x0.vu)
|
||||||
|
|
@ -31,8 +31,8 @@ B 2 1200 -830 1880 -520 {flags=graph
|
||||||
y1 = -49
|
y1 = -49
|
||||||
y2 = 59
|
y2 = 59
|
||||||
divy = 12
|
divy = 12
|
||||||
x1=0.0495785
|
x1=0.0367669
|
||||||
x2=0.0508396
|
x2=0.0373883
|
||||||
divx=10
|
divx=10
|
||||||
node="outp
|
node="outp
|
||||||
outm
|
outm
|
||||||
|
|
@ -51,28 +51,28 @@ B 2 1200 -1020 1880 -830 {flags=graph
|
||||||
y1 = 2.4e-11
|
y1 = 2.4e-11
|
||||||
y2 = 840
|
y2 = 840
|
||||||
divy = 6
|
divy = 6
|
||||||
x1=0.0495785
|
x1=0.0367669
|
||||||
x2=0.0508396
|
x2=0.0373883
|
||||||
divx=10
|
divx=10
|
||||||
|
|
||||||
|
|
||||||
unitx=m
|
unitx=m
|
||||||
color="4 7"
|
color="4 7"
|
||||||
node="\\"i(vcurrvnn) vnn * i(vcurrvpp) vpp * +\\"
|
node="\\"supply power;i(vcurrvnn) vnn * i(vcurrvpp) vpp * +\\"
|
||||||
\\"i(vcurrvnn) vnn * i(vcurrvpp) vpp * + avg()\\""}
|
\\"average supply power;i(vcurrvnn) vnn * i(vcurrvpp) vpp * + avg()\\""}
|
||||||
B 2 1200 -260 1880 -70 {flags=graph
|
B 2 1200 -310 1880 -120 {flags=graph
|
||||||
y1 = 0.0077
|
y1 = 0.0077
|
||||||
y2 = 850
|
y2 = 850
|
||||||
divy = 6
|
divy = 6
|
||||||
x1=0.0495785
|
x1=0.0367669
|
||||||
x2=0.0508396
|
x2=0.0373883
|
||||||
divx=10
|
divx=10
|
||||||
|
|
||||||
|
|
||||||
unitx=m
|
unitx=m
|
||||||
color="4 7"
|
color="4 7"
|
||||||
node="\\"outm outp - i(v.x1.v8) *\\"
|
node="\\"Load power;outm outp - i(v.x1.v8) *\\"
|
||||||
\\"outm outp - i(v.x1.v8) * avg()\\""}
|
\\"Average Load power;outm outp - i(v.x1.v8) * avg()\\""}
|
||||||
T {actual value
|
T {actual value
|
||||||
50u} 400 -820 0 0 0.4 0.4 {}
|
50u} 400 -820 0 0 0.4 0.4 {}
|
||||||
T {actual value
|
T {actual value
|
||||||
|
|
@ -99,10 +99,6 @@ annotator dinamically show the correct
|
||||||
data.} 780 -830 0 0 0.2 0.2 {layer=4}
|
data.} 780 -830 0 0 0.2 0.2 {layer=4}
|
||||||
T {Select one or more graphs (and no other objects)
|
T {Select one or more graphs (and no other objects)
|
||||||
and use arrow keys to zoom / pan waveforms} 1110 -1120 0 0 0.3 0.3 {}
|
and use arrow keys to zoom / pan waveforms} 1110 -1120 0 0 0.3 0.3 {}
|
||||||
T {Supply Power} 1270 -1050 0 0 0.4 0.4 {layer=4}
|
|
||||||
T {Average Supply Power} 1570 -1050 0 0 0.4 0.4 {layer=7}
|
|
||||||
T {Power into load} 1260 -290 0 0 0.4 0.4 {layer=4}
|
|
||||||
T {Average Power into load} 1540 -290 0 0 0.4 0.4 {layer=7}
|
|
||||||
N 70 -1220 70 -1200 {lab=#net1}
|
N 70 -1220 70 -1200 {lab=#net1}
|
||||||
N 70 -1080 70 -1060 {lab=#net2}
|
N 70 -1080 70 -1060 {lab=#net2}
|
||||||
N 300 -1140 310 -1140 {lab=VSS}
|
N 300 -1140 310 -1140 {lab=VSS}
|
||||||
|
|
|
||||||
|
|
@ -38,18 +38,7 @@ L 8 790 -530 790 -510 {}
|
||||||
L 8 770 -610 790 -610 {}
|
L 8 770 -610 790 -610 {}
|
||||||
L 8 790 -610 807.5 -620 {}
|
L 8 790 -610 807.5 -620 {}
|
||||||
L 8 810 -610 830 -610 {}
|
L 8 810 -610 830 -610 {}
|
||||||
B 2 1270 -780 1690 -630 {flags=graph
|
B 2 1270 -740 1690 -570 {flags=graph
|
||||||
y1 = -0.038
|
|
||||||
y2 = 20
|
|
||||||
divy = 5
|
|
||||||
subdivy=1
|
|
||||||
x1=-9.66825e-10
|
|
||||||
x2=0.0006
|
|
||||||
divx=9
|
|
||||||
node="v(led)
|
|
||||||
v(sw)"
|
|
||||||
color="11 18" unitx=m subdivx=4}
|
|
||||||
B 2 1270 -630 1690 -500 {flags=graph
|
|
||||||
y1 = 4.9e-06
|
y1 = 4.9e-06
|
||||||
y2 = 20
|
y2 = 20
|
||||||
divy = 6
|
divy = 6
|
||||||
|
|
@ -60,7 +49,7 @@ divx=8
|
||||||
node="panel
|
node="panel
|
||||||
led" unitx=m
|
led" unitx=m
|
||||||
color="7 4"}
|
color="7 4"}
|
||||||
B 2 1270 -500 1690 -370 {flags=graph
|
B 2 1270 -570 1690 -400 {flags=graph
|
||||||
y1 = 4e-13
|
y1 = 4e-13
|
||||||
y2 = 3.8
|
y2 = 3.8
|
||||||
divy = 4
|
divy = 4
|
||||||
|
|
@ -69,10 +58,10 @@ x1=-9.66825e-10
|
||||||
x2=0.0006
|
x2=0.0006
|
||||||
divx=8
|
divx=8
|
||||||
unitx=m
|
unitx=m
|
||||||
color="7 8"
|
color="7 4"
|
||||||
node="i(vled)
|
node="i(vpanel)
|
||||||
i(vpanel)"}
|
i(vled)"}
|
||||||
B 2 1270 -930 1690 -780 {flags=graph
|
B 2 1270 -930 1690 -740 {flags=graph
|
||||||
y1 = -6.4e-08
|
y1 = -6.4e-08
|
||||||
y2 = 40
|
y2 = 40
|
||||||
divy = 5
|
divy = 5
|
||||||
|
|
@ -83,8 +72,8 @@ divx=9
|
||||||
|
|
||||||
unitx=m subdivx=4
|
unitx=m subdivx=4
|
||||||
color="7 4"
|
color="7 4"
|
||||||
node="\\"i(vled) v(led) *\\"
|
node="\\"Panel power; i(vpanel) v(panel) *\\"
|
||||||
\\"i(vpanel) v(panel) *\\""}
|
\\"Led power; i(vled) v(led) *\\""}
|
||||||
B 18 45 -850 300 -665 {}
|
B 18 45 -850 300 -665 {}
|
||||||
A 5 300 -850 5.590169943749475 243.434948822922 360 {fill=true}
|
A 5 300 -850 5.590169943749475 243.434948822922 360 {fill=true}
|
||||||
P 7 6 375 -665 320 -821.25 315 -835 302.5 -850 290 -855 45 -865 {}
|
P 7 6 375 -665 320 -821.25 315 -835 302.5 -850 290 -855 45 -865 {}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ y1 = -0.048929
|
||||||
y2 = 0.999755
|
y2 = 0.999755
|
||||||
divy = 3
|
divy = 3
|
||||||
subdivy=1
|
subdivy=1
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07 divx=10
|
x2=2.46765e-07 divx=10
|
||||||
node="ldbl[0]
|
node="ldbl[0]
|
||||||
ldbl[16]
|
ldbl[16]
|
||||||
ldbl[32]
|
ldbl[32]
|
||||||
|
|
@ -43,7 +43,7 @@ ldbl[33]
|
||||||
ldbl[2]
|
ldbl[2]
|
||||||
ldbl[18]
|
ldbl[18]
|
||||||
ldbl[34]"
|
ldbl[34]"
|
||||||
color="8 9 10 11 12 13 14 15 11" unitx=n
|
color="10 9 10 11 12 13 14 15 11" unitx=n
|
||||||
}
|
}
|
||||||
B 2 1840 -1160 2890 -1000 {flags=graph
|
B 2 1840 -1160 2890 -1000 {flags=graph
|
||||||
digital=0
|
digital=0
|
||||||
|
|
@ -51,8 +51,8 @@ y1 = 0
|
||||||
y2 = 1.60
|
y2 = 1.60
|
||||||
subdivy=1
|
subdivy=1
|
||||||
divy = 4
|
divy = 4
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07
|
x2=2.46765e-07
|
||||||
divx=10
|
divx=10
|
||||||
subdivx=4
|
subdivx=4
|
||||||
node="ldcp
|
node="ldcp
|
||||||
|
|
@ -70,8 +70,8 @@ y2 = 1.6
|
||||||
divy = 3
|
divy = 3
|
||||||
subdivy=0
|
subdivy=0
|
||||||
subdivx = 1
|
subdivx = 1
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07 divx=10
|
x2=2.46765e-07 divx=10
|
||||||
node="ldwl[0]
|
node="ldwl[0]
|
||||||
ldwl[1]
|
ldwl[1]
|
||||||
ldwl[2]
|
ldwl[2]
|
||||||
|
|
@ -93,8 +93,8 @@ y2 = 1.6
|
||||||
ypos1=0.0990096
|
ypos1=0.0990096
|
||||||
ypos2=2.81842
|
ypos2=2.81842
|
||||||
divy = 1
|
divy = 1
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07
|
x2=2.46765e-07
|
||||||
divx=12
|
divx=12
|
||||||
subdivx=4
|
subdivx=4
|
||||||
node="---In/Out---
|
node="---In/Out---
|
||||||
|
|
@ -103,17 +103,17 @@ ldq[15]
|
||||||
ldq[14]
|
ldq[14]
|
||||||
ldq[13]
|
ldq[13]
|
||||||
ldq[12]
|
ldq[12]
|
||||||
LDA,lda[12],lda[11],lda[10],lda[9],lda[8],lda[7],lda[6],lda[5],lda[4],lda[3],lda[2],lda[1],lda[0]
|
LDA;lda[12],lda[11],lda[10],lda[9],lda[8],lda[7],lda[6],lda[5],lda[4],lda[3],lda[2],lda[1],lda[0]
|
||||||
LDQ,ldq[15],ldq[14],ldq[13],ldq[12],ldq[11],ldq[10],ldq[9],ldq[8],ldq[7],ldq[6],ldq[5],ldq[4],ldq[3],ldq[2],ldq[1],ldq[0]
|
LDQ;ldq[15],ldq[14],ldq[13],ldq[12],ldq[11],ldq[10],ldq[9],ldq[8],ldq[7],ldq[6],ldq[5],ldq[4],ldq[3],ldq[2],ldq[1],ldq[0]
|
||||||
---Timing---
|
---Timing---
|
||||||
lden
|
lden
|
||||||
ldprech
|
ldprech
|
||||||
---Decoders---
|
---Decoders---
|
||||||
LDL3X,ldl3x[7],ldl3x[6],ldl3x[5],ldl3x[4],ldl3x[3],ldl3x[2],ldl3x[1],ldl3x[0]
|
LDL3X;ldl3x[7],ldl3x[6],ldl3x[5],ldl3x[4],ldl3x[3],ldl3x[2],ldl3x[1],ldl3x[0]
|
||||||
LDL2X,ldl2x[3],ldl2x[2],ldl2x[1],ldl2x[0]
|
LDL2X;ldl2x[3],ldl2x[2],ldl2x[1],ldl2x[0]
|
||||||
LDL1X,ldl1x[15],ldl1x[14],ldl1x[13],ldl1x[12],ldl1x[11],ldl1x[10],ldl1x[9],ldl1x[8],ldl1x[7],ldl1x[6],ldl1x[5],ldl1x[4],ldl1x[3],ldl1x[2],ldl1x[1],ldl1x[0]
|
LDL1X;ldl1x[15],ldl1x[14],ldl1x[13],ldl1x[12],ldl1x[11],ldl1x[10],ldl1x[9],ldl1x[8],ldl1x[7],ldl1x[6],ldl1x[5],ldl1x[4],ldl1x[3],ldl1x[2],ldl1x[1],ldl1x[0]
|
||||||
LDY1,ldy1[3],ldy1[2],ldy1[1],ldy1[0]
|
LDY1;ldy1[3],ldy1[2],ldy1[1],ldy1[0]
|
||||||
WL[15:0],ldwl[15],ldwl[14],ldwl[13],ldwl[12],ldwl[11],ldwl[10],ldwl[9],ldwl[8],ldwl[7],ldwl[6],ldwl[5],ldwl[4],ldwl[3],ldwl[2],ldwl[1],ldwl[0]"
|
WL[15:0];ldwl[15],ldwl[14],ldwl[13],ldwl[12],ldwl[11],ldwl[10],ldwl[9],ldwl[8],ldwl[7],ldwl[6],ldwl[5],ldwl[4],ldwl[3],ldwl[2],ldwl[1],ldwl[0]"
|
||||||
color="18 4 15 4 15 4 15 4 18 15 4 18 4 15 4 15 6"
|
color="18 4 15 4 15 4 15 4 18 15 4 18 4 15 4 15 6"
|
||||||
unitx=n
|
unitx=n
|
||||||
ypos1=-2.20115 ypos2=2.79884
|
ypos1=-2.20115 ypos2=2.79884
|
||||||
|
|
@ -122,8 +122,8 @@ B 2 1840 -1300 2890 -1160 {flags=graph
|
||||||
y1 = 0
|
y1 = 0
|
||||||
y2 = 1.60
|
y2 = 1.60
|
||||||
divy = 4
|
divy = 4
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07
|
x2=2.46765e-07
|
||||||
divx=8
|
divx=8
|
||||||
unitx=n
|
unitx=n
|
||||||
node="xsa[0].ldqib
|
node="xsa[0].ldqib
|
||||||
|
|
@ -133,17 +133,17 @@ xctrl.ldq_b"
|
||||||
color="4 12 7 10"
|
color="4 12 7 10"
|
||||||
}
|
}
|
||||||
B 2 1840 -240 2890 0 {flags=graph
|
B 2 1840 -240 2890 0 {flags=graph
|
||||||
y1 = -0.0286575
|
y1 = -0.049
|
||||||
y2 = 0.00267868
|
y2 = 0.00057
|
||||||
divy = 5
|
divy = 5
|
||||||
x1=1.35174e-07
|
x1=1.05327e-07
|
||||||
x2=2.76612e-07
|
x2=2.46765e-07
|
||||||
unity=m
|
unity=m
|
||||||
divx=10
|
divx=10
|
||||||
subdivx=1
|
subdivx=1
|
||||||
node="i(vvcc)
|
node="\\"Supply current;i(vvcc)\\"
|
||||||
\\"i(vvcc) avg()\\""
|
\\"Average supply current;i(vvcc) avg()\\""
|
||||||
color="3 7"
|
color="8 7"
|
||||||
unitx=n
|
unitx=n
|
||||||
subdivy=4
|
subdivy=4
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue