allow to use @pinlist in format string even for symbols with duplicated ports. Duplicated entries will be skipped. Add component_browser_on_top tcl variable in xschemrc (default setting: enabled (1) to enable or disable component browser window always on top

This commit is contained in:
Stefan Frederik 2022-10-05 16:47:34 +02:00
parent 0c590e4f0a
commit c5e91f209e
4 changed files with 65 additions and 48 deletions

View File

@ -643,7 +643,7 @@ static void name_pass_through_nets()
pt_symbol = my_calloc(973, xctx->symbols, sizeof(int));
for(i = 0; i < xctx->symbols; i++) {
str_hash_init(&table, 17);
str_hash_init(&table, 37);
for(j = 0; j < xctx->sym[i].rects[PINLAYER]; j++) {
const char *pin_name = get_tok_value(xctx->sym[i].rect[PINLAYER][j].prop_ptr, "name", 0);
entry = str_hash_lookup(&table, pin_name, "1", XINSERT_NOREPLACE);
@ -665,7 +665,7 @@ static void name_pass_through_nets()
dbg(1, "instance %d: %s\n", i, inst[i].instname);
if(inst[i].ptr<0) continue;
if(!pt_symbol[ inst[i].ptr ]) continue;
str_hash_init(&table, 17);
str_hash_init(&table, 37);
my_strdup(1565, &type, (inst[i].ptr + xctx->sym)->type);
if (type && !IS_LABEL_OR_PIN(type) ) {
if ((rects = (inst[i].ptr+ xctx->sym)->rects[PINLAYER]) > 0) {

View File

@ -1636,14 +1636,19 @@ void print_spice_subckt_nodes(FILE *fd, int symbol)
break ;
}
else if(strcmp(token, "@pinlist")==0) {
Int_hashtable table = {NULL, 0};
int_hash_init(&table, 37);
for(i=0;i<no_of_pins;i++)
{
if(strcmp(get_tok_value(xctx->sym[symbol].rect[PINLAYER][i].prop_ptr,"spice_ignore",0), "true")) {
str_ptr=
expandlabel(get_tok_value(xctx->sym[symbol].rect[PINLAYER][i].prop_ptr,"name",0), &multip);
fprintf(fd, "%s ", str_ptr);
const char *name = get_tok_value(xctx->sym[symbol].rect[PINLAYER][i].prop_ptr,"name",0);
if(!int_hash_lookup(&table, name, 1, XINSERT_NOREPLACE)) {
str_ptr= expandlabel(name, &multip);
fprintf(fd, "%s ", str_ptr);
}
}
}
int_hash_free(&table);
}
else if(token[0]=='@' && token[1]=='@') { /* recognize single pins 15112003 */
char *prop=NULL;
@ -1875,18 +1880,25 @@ int print_spice_element(FILE *fd, int inst)
else if(strcmp(token,"@pinlist")==0) /* of course pinlist must not be present in attributes */
/* print multiplicity */
{ /* and node number: m1 n1 m2 n2 .... */
Int_hashtable table = {NULL, 0};
int_hash_init(&table, 37);
for(i=0;i<no_of_pins;i++)
{
char *prop = (xctx->inst[inst].ptr + xctx->sym)->rect[PINLAYER][i].prop_ptr;
if(strcmp(get_tok_value(prop, "spice_ignore", 0), "true")) {
str_ptr = net_name(inst,i, &multip, 0, 1);
int spice_ignore = !strcmp(get_tok_value(prop, "spice_ignore", 0), "true");
const char *name = get_tok_value(prop, "name", 0);
if(!spice_ignore) {
if(!int_hash_lookup(&table, name, 1, XINSERT_NOREPLACE)) {
str_ptr = net_name(inst, i, &multip, 0, 1);
tmp = strlen(str_ptr) +100 ; /* always make room for some extra chars
* so 1-char writes to result do not need reallocs */
STR_ALLOC(&result, tmp + result_pos, &size);
result_pos += my_snprintf(result + result_pos, tmp, "?%d %s ", multip, str_ptr);
tmp = strlen(str_ptr) +100 ; /* always make room for some extra chars
* so 1-char writes to result do not need reallocs */
STR_ALLOC(&result, tmp + result_pos, &size);
result_pos += my_snprintf(result + result_pos, tmp, "?%d %s ", multip, str_ptr);
}
}
}
int_hash_free(&table);
}
else if(token[0]=='@' && token[1]=='@') { /* recognize single pins 15112003 */
for(i=0;i<no_of_pins;i++) {

View File

@ -4924,9 +4924,9 @@ proc set_tab_names {{mod {}}} {
}
proc raise_dialog {parent window_path } {
global myload_loadfile
global myload_loadfile component_browser_on_top
foreach i ".dialog .graphdialog .load" {
if {[info exists myload_loadfile ] && $myload_loadfile == 2 && $i eq {.load} } {
if {!$component_browser_on_top && [info exists myload_loadfile ] && $myload_loadfile == 2 && $i eq {.load} } {
continue
}
if {[winfo exists $i] && [winfo ismapped $i] && [winfo ismapped $parent] &&
@ -6010,6 +6010,7 @@ if { ![info exists dircolor] } {
}
set_ne myload_globfilter {*}
set_ne component_browser_on_top 1
## list of tcl procedures to load at end of xschem.tcl
set_ne tcl_files {}
set_ne netlist_dir "$USER_CONF_DIR/simulations"

View File

@ -15,28 +15,27 @@
#### XSCHEM SYSTEM-WIDE DESIGN LIBRARY PATHS: XSCHEM_LIBRARY_PATH
###########################################################################
#### 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
#### /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 and maintained if existing:
#
# ~/.xschem/xschem_library
# ../xschem_library/devices
# ../xschem_library/examples
# ../xschem_library/ngspice
# ../xschem_library/logic
# ../xschem_library/xschem_simulator
# ../xschem_library/binto7seg
# ../xschem_library/pcb
# ../xschem_library/rom8k
#### ~/.xschem/xschem_library
#### ../xschem_library/devices
#### ../xschem_library/examples
#### ../xschem_library/ngspice
#### ../xschem_library/logic
#### ../xschem_library/xschem_simulator
#### ../xschem_library/binto7seg
#### ../xschem_library/pcb
#### ../xschem_library/rom8k
#### For testing after installation: uncomment following lines
# set xschem_doc_dir [file dirname ${XSCHEM_SHAREDIR}]/doc/xschem
@ -185,6 +184,11 @@
#### editing a new component if clicking on a new component.
#### default: enabled (1)
# set autofocus_mainwindow 0
#### set component browser always above drawing canvas.
#### default: enabled (1)
# set component_browser_on_top 0
###########################################################################
#### EXPORT FORMAT TRANSLATORS, PNG AND PDF
###########################################################################
@ -342,40 +346,40 @@
###########################################################################
#### TABBED WINDOWS
###########################################################################
# default: not enabled. Interface can be changed runtime if only one window
# or tab is open.
#### default: not enabled. Interface can be changed runtime if only one window
#### or tab is open.
# set tabbed_interface 1
###########################################################################
#### CASE INSENSITIVE SYMBOL LOOKUP
###########################################################################
## this option might be useful on filesystems that are case insensitive and
## on designs ported from windows where case of file names does not matter.
## if this option is set symbol lookup will be case insensitive,
## so a symbol reference 'AMPLI.SYM' will match with 'ampli.sym' or
## Amply.sym on disk. File system must be case insensitive for this to work,
## like FAT32 or NTFS.
## Do not set this option if you don't know what you are doing.
## Default: not enabled (0)
#### this option might be useful on filesystems that are case insensitive and
#### on designs ported from windows where case of file names does not matter.
#### if this option is set symbol lookup will be case insensitive,
#### so a symbol reference 'AMPLI.SYM' will match with 'ampli.sym' or
#### Amply.sym on disk. File system must be case insensitive for this to work,
#### like FAT32 or NTFS.
#### Do not set this option if you don't know what you are doing.
#### Default: not enabled (0)
# set case_insensitive 1
###########################################################################
#### SHOW HIDDEN TEXTS
###########################################################################
## This option shows text objects even if they have attribute 'hide=true' set
## default: 0 (not set)
#### This option shows text objects even if they have attribute 'hide=true' set
#### default: 0 (not set)
# set show_hidden_texts 1
###########################################################################
#### HIDE GRAPHS IF NO SPICE DATA LOADED
###########################################################################
## if enabled graphs will be hidden if no data is loaded.
## default: not enabled (0)
#### if enabled graphs will be hidden if no data is loaded.
#### default: not enabled (0)
# set hide_empty_graphs 0
###########################################################################
#### LIVE BACKANNOTATION OF DATA AT CURSOR 2 (B) POSITION
###########################################################################
## if enabled will backannotate values in schematic at cursor 'b' position
## in graph. Default: not enabled (0)
#### if enabled will backannotate values in schematic at cursor 'b' position
#### in graph. Default: not enabled (0)
# set live_cursor2_backannotate 1