xschem annotate_op command: if no OP analysis is found in raw file try to load a DC sweep and use first point for schematic annotation. This is done because Xyce stores OP data as a 1-point DC sweep
This commit is contained in:
parent
f9b341ef98
commit
9c48617e4e
|
|
@ -834,6 +834,10 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
||||||
}
|
}
|
||||||
my_free(_ALLOC_ID_, &line);
|
my_free(_ALLOC_ID_, &line);
|
||||||
} /* while((line = my_fgets(fd, NULL)) */
|
} /* while((line = my_fgets(fd, NULL)) */
|
||||||
|
|
||||||
|
|
||||||
|
/* no analysis was found: delete */
|
||||||
|
if(exit_status != 1) extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||||
read_dataset_done:
|
read_dataset_done:
|
||||||
if(line) my_free(_ALLOC_ID_, &line);
|
if(line) my_free(_ALLOC_ID_, &line);
|
||||||
if(lowerline) my_free(_ALLOC_ID_, &lowerline);
|
if(lowerline) my_free(_ALLOC_ID_, &lowerline);
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
||||||
else if(!strcmp(argv[1], "annotate_op"))
|
else if(!strcmp(argv[1], "annotate_op"))
|
||||||
{
|
{
|
||||||
int level = -1;
|
int level = -1;
|
||||||
|
int res = 0;
|
||||||
char f[PATH_MAX + 100];
|
char f[PATH_MAX + 100];
|
||||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||||
if(argc > 3) {
|
if(argc > 3) {
|
||||||
|
|
@ -340,13 +341,19 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
||||||
/* clear all raw files */
|
/* clear all raw files */
|
||||||
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
extra_rawfile(3, NULL, NULL, -1.0, -1.0);
|
||||||
/* free_rawfile(&xctx->raw, 1); */
|
/* free_rawfile(&xctx->raw, 1); */
|
||||||
raw_read(f, &xctx->raw, "op", -1.0, -1.0);
|
res = raw_read(f, &xctx->raw, "op", -1.0, -1.0);
|
||||||
if(level >= 0) {
|
if(res != 1) {
|
||||||
xctx->raw->level = level;
|
/* Xyce uses a 1-point dc transfer characteristic for operating point data */
|
||||||
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]);
|
res = raw_read(f, &xctx->raw, "dc", -1.0, -1.0);
|
||||||
|
}
|
||||||
|
if(res == 1) {
|
||||||
|
if(level >= 0) {
|
||||||
|
xctx->raw->level = level;
|
||||||
|
my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]);
|
||||||
|
}
|
||||||
|
update_op();
|
||||||
|
draw();
|
||||||
}
|
}
|
||||||
update_op();
|
|
||||||
draw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* arc
|
/* arc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue