diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index 714a6b08..ba130b39 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -525,6 +525,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" +
  • abort_operation
  • @@ -537,11 +538,13 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        Ask user to choose a png file and start a GUI placement of the image 
  • align
  •     Align currently selected objects to current snap setting 
    -
  • annotate_op [raw_file]
  • +   
  • annotate_op [raw_file] [level]
  •     Annotate operating point data into current schematic. 
        use <schematic name>.raw or use supplied argument as raw file to open
    -   look for operating point data and annotate voltages/currents
    -   into schematic 
    + look for operating point data and annotate voltages/currents into schematic. + The optional 'level' integer specifies the hierarchy level the raw file refers to. + This is necessary if annotate_op is called from a sub schematic at a hierarchy + level > 0 but simulation was done at top level (hierarchy 0, for example)
  • arc
  •     Start a GUI placement of an arc.
        User should click 3 unaligned points to define the arc 
    @@ -643,7 +646,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" Enable/disable layers depending on tcl array variable enable_layer()
  • escape_chars source
  •     escape tcl special characters with backslash 
    -
  • exit [closewindow]
  • +   
  • exit [closewindow] [force]
  •     Exit the program, ask for confirm if current file modified.
        if 'closewindow' is given close the window, otherwise leave with a blank schematic
        when closing the last remaining window
    @@ -1207,6 +1210,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
          
  • netlist_type set netlisting mode (spice, verilog, vhdl, tedax, symbol)
  • no_draw set no drawing flag (0 or 1)
  • no_undo set to 1 to disable undo
  • +
  • raw_level set hierarchy level loaded raw file refers to
  • rectcolor set current layer (0, 1, .... , cadlayers-1)
  • sch_to_compare set name of schematic to compare current window with
  • schsymbolprop set global symbol attribute string
  • diff --git a/src/scheduler.c b/src/scheduler.c index e47f95f1..a5bd72a9 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -255,15 +255,25 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg draw(); } - /* annotate_op [raw_file] + /* annotate_op [raw_file] [level] * Annotate operating point data into current schematic. * use .raw or use supplied argument as raw file to open - * look for operating point data and annotate voltages/currents - * into schematic */ + * look for operating point data and annotate voltages/currents into schematic. + * The optional 'level' integer specifies the hierarchy level the raw file refers to. + * This is necessary if annotate_op is called from a sub schematic at a hierarchy + * level > 0 but simulation was done at top level (hierarchy 0, for example) + */ else if(!strcmp(argv[1], "annotate_op")) { + int level = -1; char f[PATH_MAX + 100]; if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} + if(argc > 3) { + level = atoi(argv[3]); + if(level < 0 || level > xctx->currsch) { + level = -1; + } + } if(argc > 2) { my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir); tcleval(f); @@ -275,6 +285,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg extra_rawfile(3, NULL, NULL); free_rawfile(&xctx->raw, 1); raw_read(f, &xctx->raw, "op"); + if(level >= 0) { + xctx->raw->level = level; + my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[level]); + } update_op(); draw(); } @@ -4140,6 +4154,17 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} xctx->no_undo=s; } + else if(!strcmp(argv[2], "raw_level")) { /* set hierarchy level loaded raw file refers to */ + int n = atoi(argv[3]); + if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} + if(n >= 0 && n <= xctx->currsch) { + xctx->raw->level = atoi(argv[3]); + my_strdup2(_ALLOC_ID_, &xctx->raw->schname, xctx->sch[xctx->raw->level]); + Tcl_SetResult(interp, my_itoa(n), TCL_VOLATILE); + } else { + Tcl_SetResult(interp, "-1", TCL_VOLATILE); + } + } else if(!strcmp(argv[2], "rectcolor")) { /* set current layer (0, 1, .... , cadlayers-1) */ if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;} xctx->rectcolor=atoi(argv[3]); @@ -4739,6 +4764,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg Xschem_ctx **save_xctx = get_save_xctx(); save_xctx[1]->raw = save_xctx[0]->raw; } + else if(argc > 4 && atoi(argv[2]) == 4) { + raw_read(argv[3], &xctx->raw, argv[4]); + xctx->raw->level = 0; + } Tcl_ResetResult(interp); }