diff --git a/doc/xschem_man/developer_info.html b/doc/xschem_man/developer_info.html index 4cc88d12..a133d8be 100644 --- a/doc/xschem_man/developer_info.html +++ b/doc/xschem_man/developer_info.html @@ -551,6 +551,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns" +
  • abort_operation
  • @@ -588,7 +589,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        all inside selected instances will be deleted 
  • build_colors
  •     Rebuild color palette using values of tcl vars dim_value and dim_bg 
    -
  • callback winpath event mx my key button aux state
  • +   
  • callback win_path event mx my key button aux state
  •     Invoke the callback event dispatcher with a software event 
  • case_insensitive 1|0
  •     Set case insensitive symbol lookup. Use only on case insensitive filesystems 
    @@ -713,6 +714,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
  • escape_chars source [charset]
  •     escape tcl special characters with backslash
        if charset is given escape characters in charset 
    +
  • eval_expr str
  • +   debug function: evaluate arithmetic expression in str 
  • exit [exit_code] [closewindow] [force]
  •     Exit the program, ask for confirm if current file modified.
        if exit_code is given exit with its value, otherwise use 0 exit code
    @@ -974,7 +977,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        Example: xschem instances_to_net PANEL
         --> { {Vsw} {plus} {580} {-560} } { {p2} {p} {660} {-440} }
             { {Vpanel1} {minus} {600} {-440} } 
    -
  • is_symgen symbol
  • +   
  • is_generator symbol
  •     tell if 'symbol' is a generator (symbol(param1,param2,...) 
  • line [x1 y1 x2 y2] [pos] [propstring] [draw]
  •     if 'x1 y1 x2 y2'is given place line on current
    @@ -1025,6 +1028,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        If 'f' is given output stderr messages to file 'f'
        if 'f' is not given and a file log is open, close log
        file and resume logging to stderr 
    +
  • load_symbol [symbol_file]
  • +   Load specified symbol_file  
  • log_write text
  •     write given string to log file, so tcl can write messages on the log file
  • logic_get_net net_name
  • @@ -1096,22 +1101,22 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        
  • new_process [f]
  •     Start a new xschem process for a schematic.
        If 'f' is given load specified schematic. 
    -
  • new_schematic create|destroy|destroy_all|switch winpath file [draw]
  • +   
  • new_schematic create|destroy|destroy_all|switch win_path file [draw]
  •     Open/destroy a new tab or window
          create: create new empty window or with 'file' loaded if 'file' given.
    -             The winpath must be given (even {} is ok).
    -             non empty winpath ({1}) will avoid warnings if opening the
    +             The win_path must be given (even {} is ok).
    +             non empty win_path ({1}) will avoid warnings if opening the
                  same file multiple times.
    -     destroy: destroy tab/window identified by winpath. Example:
    +     destroy: destroy tab/window identified by win_path. Example:
                   xschem new_schematic destroy .x1.drw
          destroy_all: close all tabs/additional windows
                   if the 'force'argument is given do not issue a warning if modified
                   tabs are about to be closed.
    -     switch: switch context to specified 'winpath' window or specified schematic name
    +     switch: switch context to specified 'win_path' window or specified schematic name
                   If 'draw' is given and set to 0 do not redraw after switching tab
                   (only tab i/f)
    -   Main window/tab has winpath set to .drw,
    -   Additional windows/tabs have winpath set to .x1.drw, .x2.drw and so on...
    + Main window/tab has win_path set to .drw, + Additional windows/tabs have win_path set to .x1.drw, .x2.drw and so on...
  • only_probes
  •         dim schematic to better show highlights 
  • origin x y [zoom]
  • @@ -1146,7 +1151,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
        Start a GUI placement of a text object 
  • polygon
  •     Start a GUI placement of a polygon 
    -
  • preview_window create|draw|destroy|close [winpath] [file]
  • +   
  • preview_window create|draw|destroy|close [win_path] [file]
  •     destroy: will delete preview schematic data and destroy container window
        close: same as destroy but leave the container window.
        Used in fileselector to show a schematic preview.
    @@ -1548,7 +1553,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
  • switch [window_path |schematic_name]
  •     Switch context to indicated window path or schematic name
        returns 0 if switch was successfull or 1 in case of errors
    -   (no tabs/windows present or no matching winpath / schematic name
    +   (no tabs/windows present or no matching win_path / schematic name
        found).
  • symbols [n | 'derived_symbols']
  •     if 'n' given list symbol with name or number 'n', else list all
    @@ -1723,7 +1728,6 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
     
     
     
    -
     
     
      
    diff --git a/src/draw.c b/src/draw.c
    index b7c057dc..b726ecf6 100644
    --- a/src/draw.c
    +++ b/src/draw.c
    @@ -3487,10 +3487,12 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
               } else {
                  if(gr->hilight_wave == wcnt) {
                    gr->hilight_wave = -1;
    -               my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
    +               my_strdup2(_ALLOC_ID_, &r->prop_ptr,
    +                          subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
                  } else {
                    gr->hilight_wave = wcnt;
    -               my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
    +               my_strdup2(_ALLOC_ID_, &r->prop_ptr,
    +                          subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
                  }
               }
             }
    @@ -3512,10 +3514,12 @@ int edit_wave_attributes(int what, int i, Graph_ctx *gr)
             } else {
               if(gr->hilight_wave == wcnt) {
                 gr->hilight_wave = -1;
    -            my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
    +            my_strdup2(_ALLOC_ID_, &r->prop_ptr,
    +                       subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
               } else {
                 gr->hilight_wave = wcnt;
    -            my_strdup2(_ALLOC_ID_, &r->prop_ptr, subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
    +            my_strdup2(_ALLOC_ID_, &r->prop_ptr,
    +                       subst_token(r->prop_ptr, "hilight_wave", my_itoa(gr->hilight_wave)));
               }
             }
           }
    diff --git a/src/scheduler.c b/src/scheduler.c
    index f16988b1..d0a98a66 100644
    --- a/src/scheduler.c
    +++ b/src/scheduler.c
    @@ -3024,6 +3024,24 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
           else if(argc==2 && errfp != stderr) { fclose(errfp); errfp=stderr; }
         }
     
    +    /* load_symbol [symbol_file]
    +     *   Load specified symbol_file  */
    +    else if(!strcmp(argv[1], "load_symbol") )
    +    {
    +      int res = -1;
    +      struct stat buf;
    +      if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
    +      if(argc > 2) { 
    +        int i = get_symbol(rel_sym_path(argv[2]));
    +        if(i < 0 ) {
    +          if(!stat(argv[2], &buf)) { /* file exists */
    +            res = load_sym_def(rel_sym_path(argv[2]), NULL);
    +          }
    +        }
    +      }
    +      Tcl_SetResult(interp, my_itoa(res), TCL_VOLATILE);
    +    }
    +
         /* log_write text
          *   write given string to log file, so tcl can write messages on the log file
          */
    diff --git a/src/xschem.tcl b/src/xschem.tcl
    index 217a2452..d78af432 100644
    --- a/src/xschem.tcl
    +++ b/src/xschem.tcl
    @@ -6631,8 +6631,12 @@ proc try_download_url {dirname sch_or_sym} {
     # Example: rel_sym_path /home/schippes/share/xschem/xschem_library/devices/iopin.sym
     #          devices/iopin.sym
     proc rel_sym_path {symbol} {
    -  global OS pathlist
    +  global OS pathlist env
     
    +  regsub {^~/} $symbol ${env(HOME)}/ symbol
    +  if {![regexp {^/} $symbol]} {
    +    set symbol [pwd]/$symbol
    +  }
       set curr_dirname [pwd]
       set name {}
       foreach path_elem $pathlist {