From 6cac6f2291764b244ca2a4f3c3ad40084563e286 Mon Sep 17 00:00:00 2001 From: Stefan Frederik Date: Mon, 4 Jan 2021 15:19:08 +0100 Subject: [PATCH] cleanups in sample xschemrc comments --- doc/xschem_man/xschem_man.html | 2 +- src/xinit.c | 8 +- src/xschem.tcl | 19 +-- src/xschemrc | 221 +++++++++++++++++++-------------- 4 files changed, 146 insertions(+), 104 deletions(-) diff --git a/doc/xschem_man/xschem_man.html b/doc/xschem_man/xschem_man.html index 0fc444d2..3dd5931e 100644 --- a/doc/xschem_man/xschem_man.html +++ b/doc/xschem_man/xschem_man.html @@ -52,7 +52,7 @@
  • Use bus / vector notation for signal bundles / arrays of instances
  • Backannotation of Ngspice simulation data into xschem
  • Use symgen.awk to create symbols from 'djboxsym' compatible text files
  • -
  • [Video] Install Xschem, Xschem_sky130, skywater-pdk and ngspice: step by step instructions
  • +
  • [Video] Install Xschem, Xschem_sky130, skywater-pdk and ngspice: step by step instructions
  • [Video] Editing commands and simulation
  • [Video] Editing component attributes
  • [Video] Copying objects across xschem windows
  • diff --git a/src/xinit.c b/src/xinit.c index d43d272a..4e82546f 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -1098,7 +1098,7 @@ int Tcl_AppInit(Tcl_Interp *inter) } Tcl_CreateExitHandler(tclexit, 0); #ifdef __unix__ - my_snprintf(tmp, S(tmp),"regsub -all {~/} {.:%s} {%s/}", XSCHEM_LIBRARY_PATH, home_dir); + my_snprintf(tmp, S(tmp),"regsub -all {~/} {%s} {%s/}", XSCHEM_LIBRARY_PATH, home_dir); tcleval(tmp); tclsetvar("XSCHEM_LIBRARY_PATH", tclresult()); @@ -1107,12 +1107,12 @@ int Tcl_AppInit(Tcl_Interp *inter) if( !stat("./xschem.tcl", &buf) && !stat("./systemlib", &buf) && !stat("./xschem", &buf)) { running_in_src_dir = 1; tclsetvar("XSCHEM_SHAREDIR",pwd_dir); /* for testing xschem builds in src dir*/ -/* + /* my_snprintf(tmp, S(tmp), "subst .:[file normalize \"%s/../xschem_library/devices\"]", pwd_dir); tcleval(tmp); tclsetvar("XSCHEM_LIBRARY_PATH", tclresult()); -*/ - my_snprintf(tmp, S(tmp), "subst .:[file dirname \"%s\"]/xschem_library/devices", pwd_dir); + */ + my_snprintf(tmp, S(tmp), "subst [file dirname \"%s\"]/xschem_library/devices", pwd_dir); tcleval(tmp); tclsetvar("XSCHEM_LIBRARY_PATH", tclresult()); } else if( !stat(XSCHEM_SHAREDIR, &buf) ) { diff --git a/src/xschem.tcl b/src/xschem.tcl index 2ba81c5c..b227b48d 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -183,10 +183,11 @@ proc netlist {source_file show netlist_file} { # 20161121 proc convert_to_pdf {filename dest} { + global to_pdf # puts "convert_to_pdf: $filename --> $dest" if { [regexp -nocase {\.pdf$} $dest] } { set pdffile [file rootname $filename].pdf] - if { ![catch "exec ps2pdf $filename $pdffile" msg] } { + if { ![catch "exec $to_pdf $filename $pdffile" msg] } { file rename -force $pdffile $dest # ps2pdf succeeded, so remove original .ps file if { ![xschem get debug_var] } { @@ -3451,19 +3452,19 @@ set_ne globfilter {*} set_ne tcl_files {} set_ne netlist_dir "$USER_CONF_DIR/simulations" set_ne bus_replacement_char {} ;# use {<>} to replace [] with <> in bussed signals -set_ne hspice_netlist 0 +set_ne hspice_netlist 1 set_ne top_subckt 0 set_ne spiceprefix 1 set_ne verilog_2001 1 set_ne split_files 0 set_ne flat_netlist 0 -set_ne netlist_type vhdl +set_ne netlist_type spice set_ne netlist_show 0 -set_ne color_ps 0 +set_ne color_ps 1 set_ne transparent_svg 0 set_ne only_probes 0 ; # 20110112 set_ne fullscreen 0 -set_ne unzoom_nodrift 1 +set_ne unzoom_nodrift 0 set_ne change_lw 1 set_ne line_width 0 set_ne draw_window 0 @@ -3477,13 +3478,13 @@ set_ne snap 10 set_ne grid 20 set_ne persistent_command 0 set_ne autotrim_wires 0 -set_ne disable_unique_names 1 +set_ne disable_unique_names 0 set_ne sym_txt 1 set_ne show_infowindow 0 set_ne symbol_width 150 set_ne editor {gvim -f} set_ne rainbow_colors 0 -set_ne initial_geometry {700x448+10+10} +set_ne initial_geometry {900x600} set_ne edit_symbol_prop_new_sel {} #20161102 set_ne launcher_var {} @@ -3492,8 +3493,10 @@ set_ne launcher_program {} #20160413 set_ne auto_hilight 0 set_ne en_hilight_conn_inst 0 -## 20161121 xpm to png conversion +## xpm to png conversion set_ne to_png {gm convert} +## ps to pdf conversion +set_ne to_pdf {ps2pdf} ## 20160325 remember edit_prop widget size set_ne edit_prop_size 80x12 diff --git a/src/xschemrc b/src/xschemrc index bd58a993..7cf82d68 100644 --- a/src/xschemrc +++ b/src/xschemrc @@ -1,157 +1,173 @@ -# xschemrc system configuration file -# values may be overridden by user's ~/.xschem/xschemrc configuration file -# or by project-local ./xschemrc - -## clear tcl prompts -# set tcl_prompt1 {} -# set tcl_prompt2 {} +## xschemrc system configuration file +## values may be overridden by user's ~/.xschem/xschemrc configuration file +## or by project-local ./xschemrc ########################################################################### -## xschem installation directory XSCHEM_SHAREDIR +## XSCHEM INSTALLATION DIRECTORY: XSCHEM_SHAREDIR ########################################################################### - -# normally there is no reason to set this variable if using standard -# installation. Location of files is set at compile time but may be overridden -# with following line: -# +## Normally there is no reason to set this variable if using standard +## installation. Location of files is set at compile time but may be overridden +## with following line: # set XSCHEM_SHAREDIR $env(HOME)/share/xschem ########################################################################### -## xschem system-wide design library paths XSCHEM_LIBRARY_PATH +## XSCHEM SYSTEM-WIDE DESIGN LIBRARY PATHS: XSCHEM_LIBRARY_PATH ########################################################################### - -# If unset xschem starts with XSCHEM_LIBRARY_PATH set to the default, typically: +## If unset xschem starts with XSCHEM_LIBRARY_PATH set to the default, typically: # . # /home/schippes/.xschem/xschem_library # /home/schippes/share/xschem/xschem_library/devices # /home/schippes/share/doc/xschem/examples # /home/schippes/share/doc/xschem/ngspice # /home/schippes/share/doc/xschem/logic +# /home/schippes/share/doc/xschem/xschem_simulator # /home/schippes/share/doc/xschem/binto7seg # /home/schippes/share/doc/xschem/pcb # /home/schippes/share/doc/xschem/rom8k -# For testing in build src directory -# if unset following paths are set: +## For testing in build src directory +## if unset following paths are set: # . # ../xschem_library/devices -# For testing after installation: -# -# set XSCHEM_LIBRARY_PATH {} +## For testing after installation: uncomment following lines # set xschem_doc_dir [file dirname ${XSCHEM_SHAREDIR}]/doc/xschem +# set XSCHEM_LIBRARY_PATH {} # append XSCHEM_LIBRARY_PATH :~/.xschem/xschem_library # append XSCHEM_LIBRARY_PATH :${XSCHEM_SHAREDIR}/xschem_library/devices -# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/logic # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/examples -# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/binto7seg -# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/xTAG -# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/rulz-r8c33 # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/ngspice # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/xschem_simulator # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/rom8k +# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/logic # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/pcb +# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/binto7seg # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/symgen +# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/xTAG +# append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/rulz-r8c33 # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/gschem_import # append XSCHEM_LIBRARY_PATH ${xschem_doc_dir}/gschem_import/sym -# For Windows, use ; instead of :, and enclosed pathname with "" +## For Windows, use ; instead of :, and enclosed pathname with "" #append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library" #append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/devices" #append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/examples" #append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/ngspice" -#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/logic" -#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/binto7seg" -#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/pcb" +#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/xschem_simulator" #append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/rom8k" +#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/logic" +#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/pcb" +#append XSCHEM_LIBRARY_PATH ";${XSCHEM_SHAREDIR}/../xschem_library/binto7seg" ########################################################################### -## set custom colors for xschem libraries matching certain patterns +## SET CUSTOM COLORS FOR XSCHEM LIBRARIES MATCHING CERTAIN PATTERNS +########################################################################### ## each line contains a dircolor(pattern) followed by a color ## color can be an ordinary name (grey, brown, blue) or a hex code {#77aaff} ## hex code must be enclosed in braces -########################################################################### - -set dircolor(devices$) red -set dircolor(examples$) {darkgreen} +## these are the defaults: +# set dircolor(/share/xschem/) red +# set dircolor(/share/doc/xschem/) {#338844} ########################################################################### -## Window to open on startup XSCHEM_START_WINDOW +## WINDOW TO OPEN ON STARTUP: XSCHEM_START_WINDOW ########################################################################### - -# Start without a design if no filename given on command line: -# To avoid absolute paths, use a path that is relative to one of the -# XSCHEM_LIBRARY_PATH directories. -# +## Start without a design if no filename given on command line: +## To avoid absolute paths, use a path that is relative to one of the +## XSCHEM_LIBRARY_PATH directories. Default: empty # set XSCHEM_START_WINDOW {0_examples_top.sch} - ########################################################################### -## Directory where simulations, netlist and simulator outputs are placed +## DIRECTORY WHERE SIMULATIONS, NETLIST AND SIMULATOR OUTPUTS ARE PLACED ########################################################################### -# If unset $USER_CONF_DIR/simulations is assumed (normally ~/.xschem/simulations) -# +## If unset $USER_CONF_DIR/simulations is assumed (normally ~/.xschem/simulations) # set netlist_dir $env(HOME)/.xschem/simulations - ########################################################################### -## change default [] with some other characters for bussed signals -## in spice netlists (example: DATA[7] --> DATA<7>) +## CHANGE DEFAULT [] WITH SOME OTHER CHARACTERS FOR BUSSED SIGNALS +## IN SPICE NETLISTS (EXAMPLE: DATA[7] --> DATA<7>) ########################################################################### - +## default: empty (use xschem default, [ ]) # set bus_replacement_char {<>} - -## for XSPICE +## for XSPICE: replace square brackets as the are used for XSPICE vector nodes. # set bus_replacement_char {__} - ########################################################################### -## some default behavior +## SOME DEFAULT BEHAVIOR ########################################################################### +## Allowed values: spice, verilog, vhdl, tedax, default: spice +# set netlist_type spice -set netlist_type spice ;# allowed : spice, verilog, vhdl, tedax -set hspice_netlist 1 -set verilog_2001 1 +## Some netlisting options (these are the defaults) +# set hspice_netlist 1 +# set verilog_2001 1 -## for following to be effective also set change_lw to 0 -# set line_width 2 -set change_lw 1 +## to use a fixed line with set change_lw to 0 and set some value to line_width +## these are the defaults +# set line_width 0 +# set change_lw 1 -set color_ps 1 -set initial_geometry {900x600} +## allow color postscript and svg exports. Default: 1, enable color +# set color_ps 1 + +## initial size of xschem window you can specify also position with (wxh+x+y) +## this is the default: +# set initial_geometry {900x600} + +## if set to 0, when zooming out allow the viewport do drift toward the mouse position, +## allowing to move away by zooming / unzooming with mouse wheel +## default setting: 0 # set unzoom_nodrift 0 ## if set to 1 allow to place multiple components with same name. ## Warning: this is normally not allowed in any simulation netlist. -set disable_unique_names 0 +## default: 0, do not allow place multiple elements with same name (refdes) +# set disable_unique_names 0 ## if set to 1 continue drawing lines / wires after click +## default: 0 # set persistent_command 1 ## if set to 1 automatically join/trim wires while editing +## this may slow down on rally big designs. Can be disabled via menu +## default: 0 # set autotrim_wires 0 -## set widget scaling (mainly for font display) +## set widget scaling (mainly for font display), this is useful on 4K displays +## default: unset (tk uses its default) > 1.0 ==> bigger # set tk_scaling 1.7 -## disable some symbol layers +## disable some symbol layers. Default: none, all layers are visible. # set enable_layer(5) 0 ;# example to disable pin red boxes ## enable to scale grid point size as done with lines at close zoom # set big_grid_points 0 ########################################################################### -## custom grid / snap value settings +## EXPORT FORMAT TRANSLATORS, PNG AND PDF ########################################################################### +## command to translate xpm to png; (assumes command takes source +## and dest file as arguments, example: gm convert plot.xpm plot.png) +## default: {gm convert} +# set to_png {gm convert} -# set grid 100 -# set snap 50 +## command to translate ps to pdf; (assumes command takes source +## and dest file as arguments, example: ps2pdf plot.ps plot.pdf) +## default: ps2pdf +# set to_pdf ps2pdf ########################################################################### -## Custom colors may be defined here +## CUSTOM GRID / SNAP VALUE SETTINGS ########################################################################### +## Warning: changing these values will likely break compatibility +## with existing symbol libraries. Defaults: grid 20, snap 10. +# set grid 20 +# set snap 10 +########################################################################### +## CUSTOM COLORS MAY BE DEFINED HERE +########################################################################### # set cadlayers 22 # set light_colors { # "#ffffff" "#0044ee" "#aaaaaa" "#222222" "#229900" @@ -170,14 +186,13 @@ set disable_unique_names 0 ########################################################################### ## CAIRO STUFF ########################################################################### - #### Scale all fonts by this number # set cairo_font_scale 1.0 #### default for following two is 0.85 (xscale) and 0.88 (yscale) to #### match cairo font spacing # set nocairo_font_xscale 1.0 -# set nocairo_font_yscale 1.0 +## set nocairo_font_yscale 1.0 #### Scale line spacing by this number # set cairo_font_line_spacing 1.0 @@ -195,7 +210,6 @@ set disable_unique_names 0 ########################################################################### ## KEYBINDINGS ########################################################################### - #### General format for specifying a replacement for a keybind #### Replace Ctrl-d with Escape (so you wont kill the program) # set replace_key(Control-d) Escape @@ -204,47 +218,72 @@ set disable_unique_names 0 # set replace_key(Shift-W) w # set replace_key(w) Shift-W -set terminal {xterm -geometry 100x35 -fn 9x15 -bg black -fg white -cr white -ms white } +########################################################################### +## TERMINAL +########################################################################### +## default for linux: xterm +# set terminal {xterm -geometry 100x35 -fn 9x15 -bg black -fg white -cr white -ms white } ## lxterminal is not OK since it will not inherit env vars: ## In order to reduce memory usage and increase the performance, all instances ## of the terminal are sharing a single process. LXTerminal is part of LXDE +########################################################################### +## EDITOR +########################################################################### ## editor must not detach from launching shell (-f mandatory for gvim) +## default for linux: gvim -f +# set editor {gvim -f -geometry 90x28} # set editor { xterm -geometry 100x40 -e nano } # set editor { xterm -geometry 100x40 -e pico } -# For Windows + +## For Windows # set editor {notepad.exe} -set editor {gvim -f -geometry 90x28} -#### show info window (ERC rules errors warnings etc) -# set show_infowindow 1 +########################################################################### +## SHOW ERC INFO WINDOW (erc errors, warnings etc) +########################################################################### +## default: 0 (can be enabled by menu) +# set show_infowindow 0 -#### command to translate xpm to png (assumes command takes source -#### and dest file as arguments, example: gm convert plot.xpm plot.png) -set to_png {gm convert} - -#### computer farm redirector -#### RTDA NC +########################################################################### +## CONFIGURE COMPUTER FARM JOB REDIRECTORS FOR SIMULATIONS +########################################################################### +## RTDA NC # set computerfarm {nc run -Il} -#### LSF BSUB +## LSF BSUB # set computerfarm {bsub -Is} -#### set gaw address for socket connection: {host port} -set gaw_tcp_address {localhost 2020} +########################################################################### +## TCP CONNECTION WITH GAW +########################################################################### +## set gaw address for socket connection: {host port} +## default: set to localhost, port 2020 +# set gaw_tcp_address {localhost 2020} -#### set xschem listening port +########################################################################### +## XSCHEM LISTEN TO TCP PORT +########################################################################### +## set xschem listening port; default: not enabled # set xschem_listen_port 2021 -#### utile (stefan's spice stimuli editor) -set utile_gui_path ${XSCHEM_SHAREDIR}/utile/utile3 -set utile_cmd_path ${XSCHEM_SHAREDIR}/utile/utile +########################################################################### +## UTILE SPICE STIMULI DESCRIPTION LANGUAGE AND TRANSLATOR +########################################################################### +## default paths are set as shown here: +# set utile_gui_path ${XSCHEM_SHAREDIR}/utile/utile3 +# set utile_cmd_path ${XSCHEM_SHAREDIR}/utile/utile -#### list of tcl files to preload. +########################################################################### +## TCL FILES TO LOAD AT STARTUP +########################################################################### +## list of tcl files to preload. # lappend tcl_files ${XSCHEM_SHAREDIR}/change_index.tcl -# lappend tcl_files ${XSCHEM_SHAREDIR}/hspice_backannotate.tcl # lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl -#### toolbar +########################################################################### +## XSCHEM TOOLBAR +########################################################################### +## default: not enabled. # set toolbar_visible 1 # set toolbar_horiz 1