added warnings (Options -> Show info window) if components are missing a name=... attribute / if symbols are missing a type=... attribute; eliminated usage of tcl "file normalize..." statements to avoid symlink dereferencing (if using symlinked libraries), aligned version/file_version tags in support awk scripts
This commit is contained in:
parent
71f23a5242
commit
a10cb2c429
|
|
@ -1074,7 +1074,6 @@ void descend_schematic(int instnumber)
|
||||||
int inst_mult, inst_number;
|
int inst_mult, inst_number;
|
||||||
int save_ok = 0;
|
int save_ok = 0;
|
||||||
|
|
||||||
|
|
||||||
rebuild_selected_array();
|
rebuild_selected_array();
|
||||||
if(lastselected !=1 || selectedgroup[0].type!=ELEMENT)
|
if(lastselected !=1 || selectedgroup[0].type!=ELEMENT)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,7 @@ function print_header()
|
||||||
"device @name @device\n" \
|
"device @name @device\n" \
|
||||||
"@comptag\"\n"
|
"@comptag\"\n"
|
||||||
}
|
}
|
||||||
print "v {xschem version=2.9.7 file_version=1.1}"
|
print "v {xschem version=2.9.8 file_version=1.2}"
|
||||||
template_attrs = "template=\"" template_attrs "\"\n"
|
template_attrs = "template=\"" template_attrs "\"\n"
|
||||||
|
|
||||||
if(FILENAME ~/\.sym$/) {
|
if(FILENAME ~/\.sym$/) {
|
||||||
|
|
@ -397,16 +397,17 @@ function print_header()
|
||||||
} else {
|
} else {
|
||||||
global_attrs = "type=symbol\n" global_attrs
|
global_attrs = "type=symbol\n" global_attrs
|
||||||
}
|
}
|
||||||
print "G {" global_attrs template_attrs tedax_attrs spice_attrs
|
print "K {" global_attrs template_attrs tedax_attrs spice_attrs
|
||||||
if(extra) {
|
if(extra) {
|
||||||
print extra
|
print extra
|
||||||
print extra_pinnumber
|
print extra_pinnumber
|
||||||
}
|
}
|
||||||
print "}"
|
print "}"
|
||||||
} else {
|
} else {
|
||||||
print "G {}"
|
print "K {}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "G {}"
|
||||||
print "V {}"
|
print "V {}"
|
||||||
print "S {}"
|
print "S {}"
|
||||||
print "E {}"
|
print "E {}"
|
||||||
|
|
|
||||||
|
|
@ -1091,8 +1091,9 @@ void print_hilight_net(int show)
|
||||||
|
|
||||||
/* 20170323 this delete_netlist_structs is necessary, without it segfaults when going back (ctrl-e) */
|
/* 20170323 this delete_netlist_structs is necessary, without it segfaults when going back (ctrl-e) */
|
||||||
/* from a schematic after placing pins (ctrl-j) and changing some pin direction (ipin -->iopin) */
|
/* from a schematic after placing pins (ctrl-j) and changing some pin direction (ipin -->iopin) */
|
||||||
prepared_hilight_structs=0; /* 20171212 */
|
prepared_hilight_structs=0;
|
||||||
prepared_netlist_structs=0; /* 20171212 */
|
prepared_netlist_structs=0;
|
||||||
|
|
||||||
/* delete_netlist_structs(); */
|
/* delete_netlist_structs(); */
|
||||||
my_free(781, &filetmp1);
|
my_free(781, &filetmp1);
|
||||||
my_free(782, &filetmp2);
|
my_free(782, &filetmp2);
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ function beginfile(f)
|
||||||
text_voffset=20
|
text_voffset=20
|
||||||
lab_voffset=4
|
lab_voffset=4
|
||||||
ip=op=n_pin=0
|
ip=op=n_pin=0
|
||||||
print "v {xschem version=2.9.7 file_version=1.1}" > sym
|
print "v {xschem version=2.9.8 file_version=1.2}" > sym
|
||||||
if(template=="") {
|
if(template=="") {
|
||||||
printf "%s", "K {type=subcircuit\nformat=\"@name @pinlist @symname\"\n" >sym
|
printf "%s", "K {type=subcircuit\nformat=\"@name @pinlist @symname\"\n" >sym
|
||||||
printf "%s\n", "template=\"name=x1\"" >sym
|
printf "%s\n", "template=\"name=x1\"" >sym
|
||||||
|
|
|
||||||
|
|
@ -627,10 +627,15 @@ void prepare_netlist_structs(int for_netlist)
|
||||||
char *class=NULL;
|
char *class=NULL;
|
||||||
char *global_node=NULL;
|
char *global_node=NULL;
|
||||||
int inst_mult, pin_mult;
|
int inst_mult, pin_mult;
|
||||||
|
int print_erc;
|
||||||
|
static int startlevel = 0;
|
||||||
|
|
||||||
if (for_netlist>0 && prepared_netlist_structs) return; /* 20160413 */
|
if (for_netlist>0 && prepared_netlist_structs) return; /* 20160413 */
|
||||||
else if (!for_netlist && prepared_hilight_structs) return; /* 20171210 */
|
else if (!for_netlist && prepared_hilight_structs) return; /* 20171210 */
|
||||||
else delete_netlist_structs();
|
else delete_netlist_structs();
|
||||||
|
if(netlist_count == 0 ) startlevel = currentsch;
|
||||||
|
print_erc = netlist_count == 0 || startlevel < currentsch;
|
||||||
|
|
||||||
if (for_netlist>0) {
|
if (for_netlist>0) {
|
||||||
my_snprintf(nn, S(nn), "-----------%s", schematic[currentsch]);
|
my_snprintf(nn, S(nn), "-----------%s", schematic[currentsch]);
|
||||||
statusmsg(nn,2);
|
statusmsg(nn,2);
|
||||||
|
|
@ -662,6 +667,20 @@ void prepare_netlist_structs(int for_netlist)
|
||||||
if (inst_ptr[i].ptr<0) continue;
|
if (inst_ptr[i].ptr<0) continue;
|
||||||
|
|
||||||
my_strdup(248, &type,(inst_ptr[i].ptr+instdef)->type); /* 20150409 */
|
my_strdup(248, &type,(inst_ptr[i].ptr+instdef)->type); /* 20150409 */
|
||||||
|
if(print_erc && (!inst_ptr[i].instname || !inst_ptr[i].instname[0]) ) {
|
||||||
|
char str[2048];
|
||||||
|
my_snprintf(str, S(str), "instance: %d (%s): no name attribute set", i, inst_ptr[i].name);
|
||||||
|
statusmsg(str,2);
|
||||||
|
inst_ptr[i].flags |=4;
|
||||||
|
hilight_nets=1;
|
||||||
|
}
|
||||||
|
if(print_erc && (!type || !type[0]) ) {
|
||||||
|
char str[2048];
|
||||||
|
my_snprintf(str, S(str), "Symbol: %s: no type attribute set", inst_ptr[i].name);
|
||||||
|
statusmsg(str,2);
|
||||||
|
inst_ptr[i].flags |=4;
|
||||||
|
hilight_nets=1;
|
||||||
|
}
|
||||||
if(type && inst_ptr[i].node && IS_LABEL_OR_PIN(type) ) { /* instance must have a pin! */
|
if(type && inst_ptr[i].node && IS_LABEL_OR_PIN(type) ) { /* instance must have a pin! */
|
||||||
if (for_netlist>0) {
|
if (for_netlist>0) {
|
||||||
/* 20150918 skip labels / pins if ignore property specified on instance */
|
/* 20150918 skip labels / pins if ignore property specified on instance */
|
||||||
|
|
@ -983,8 +1002,10 @@ void prepare_netlist_structs(int for_netlist)
|
||||||
} /* end for(i...) */
|
} /* end for(i...) */
|
||||||
/*---------------------- */
|
/*---------------------- */
|
||||||
rebuild_selected_array();
|
rebuild_selected_array();
|
||||||
if (for_netlist>0) prepared_netlist_structs=1;
|
if (for_netlist>0) {
|
||||||
else prepared_hilight_structs=1;
|
prepared_netlist_structs=1;
|
||||||
|
prepared_hilight_structs=1;
|
||||||
|
} else prepared_hilight_structs=1;
|
||||||
|
|
||||||
my_free(835, &dir);
|
my_free(835, &dir);
|
||||||
my_free(836, &type);
|
my_free(836, &type);
|
||||||
|
|
|
||||||
|
|
@ -197,10 +197,8 @@ void global_spice_netlist(int global) /* netlister driver */
|
||||||
prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */
|
prepare_netlist_structs(1); /* so 'lab=...' attributes for unnamed nets are set */
|
||||||
/* symbol vs schematic pin check, we do it here since now we have ALL symbols loaded */
|
/* symbol vs schematic pin check, we do it here since now we have ALL symbols loaded */
|
||||||
sym_vs_sch_pins();
|
sym_vs_sch_pins();
|
||||||
|
|
||||||
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
/* restore hilight flags from errors found analyzing top level before descending hierarchy */
|
||||||
for(i=0;i<lastinst; i++) inst_ptr[i].flags |= stored_flags[i];
|
for(i=0;i<lastinst; i++) inst_ptr[i].flags |= stored_flags[i];
|
||||||
|
|
||||||
draw_hilight_net(1);
|
draw_hilight_net(1);
|
||||||
}
|
}
|
||||||
my_free(945, &stored_flags);
|
my_free(945, &stored_flags);
|
||||||
|
|
@ -271,6 +269,7 @@ void global_spice_netlist(int global) /* netlister driver */
|
||||||
}
|
}
|
||||||
my_free(946, &type);
|
my_free(946, &type);
|
||||||
my_free(947, &place);
|
my_free(947, &place);
|
||||||
|
netlist_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *model_name_result = NULL;
|
static char *model_name_result = NULL;
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ void global_tedax_netlist(int global) /* netlister driver */
|
||||||
tcleval(tcl_cmd_netlist);
|
tcleval(tcl_cmd_netlist);
|
||||||
}
|
}
|
||||||
if(!debug_var) xunlink(netl_filename);
|
if(!debug_var) xunlink(netl_filename);
|
||||||
|
netlist_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ void global_verilog_netlist(int global) /* netlister driver */
|
||||||
my_free(1076, &port_value);
|
my_free(1076, &port_value);
|
||||||
my_free(1077, &tmp_string);
|
my_free(1077, &tmp_string);
|
||||||
my_free(1078, &type);
|
my_free(1078, &type);
|
||||||
|
netlist_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -386,6 +386,7 @@ void global_vhdl_netlist(int global) /* netlister driver */
|
||||||
my_free(1089, &sig_type);
|
my_free(1089, &sig_type);
|
||||||
my_free(1090, &type);
|
my_free(1090, &type);
|
||||||
my_free(1091, &port_value);
|
my_free(1091, &port_value);
|
||||||
|
netlist_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
12
src/xinit.c
12
src/xinit.c
|
|
@ -992,10 +992,10 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (running_in_src_dir ==1) {
|
if (running_in_src_dir ==1) {
|
||||||
my_snprintf(tmp, S(tmp), "%s/../src", pwd_dir);
|
my_snprintf(tmp, S(tmp), "[file dirname %s]/src", pwd_dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my_snprintf(tmp, S(tmp), "%s/../share", install_dir);
|
my_snprintf(tmp, S(tmp), "[file dirname %s]/share", install_dir);
|
||||||
}
|
}
|
||||||
tclsetvar("XSCHEM_SHAREDIR", tmp);
|
tclsetvar("XSCHEM_SHAREDIR", tmp);
|
||||||
}
|
}
|
||||||
|
|
@ -1456,14 +1456,10 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
||||||
enable_layers();
|
enable_layers();
|
||||||
|
|
||||||
if(filename) {
|
if(filename) {
|
||||||
char s[PATH_MAX+100];
|
|
||||||
dbg(1, "Tcl_AppInit(): filename %s given, removing symbols\n", filename);
|
dbg(1, "Tcl_AppInit(): filename %s given, removing symbols\n", filename);
|
||||||
remove_symbols();
|
remove_symbols();
|
||||||
my_snprintf(s, S(s), "file normalize \"%s\"", filename);
|
load_schematic(1, filename, 1);
|
||||||
tcleval(s);
|
Tcl_VarEval(interp, "update_recent_file {", filename, "}", NULL);
|
||||||
my_strncpy(s, abs_sym_path(tclresult(), ""), S(s));
|
|
||||||
load_schematic(1, s, 1); /* 20180925.1 */
|
|
||||||
Tcl_VarEval(interp, "update_recent_file {", s, "}", NULL);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
char * tmp; /* 20121110 */
|
char * tmp; /* 20121110 */
|
||||||
|
|
|
||||||
|
|
@ -2590,7 +2590,6 @@ proc rel_sym_path {symbol} {
|
||||||
global pathlist current_dirname
|
global pathlist current_dirname
|
||||||
|
|
||||||
set name {}
|
set name {}
|
||||||
if {[regexp {^/} $symbol] || [regexp {^[A-Za-z]:} $symbol]} {set symbol [file normalize $symbol]}
|
|
||||||
foreach path_elem $pathlist {
|
foreach path_elem $pathlist {
|
||||||
if { ![string compare $path_elem .] && [info exist current_dirname]} {
|
if { ![string compare $path_elem .] && [info exist current_dirname]} {
|
||||||
set path_elem $current_dirname
|
set path_elem $current_dirname
|
||||||
|
|
@ -2622,14 +2621,20 @@ proc abs_sym_path {fname {ext {} } } {
|
||||||
if { $fname eq "/"} {
|
if { $fname eq "/"} {
|
||||||
return $fname;
|
return $fname;
|
||||||
}
|
}
|
||||||
|
# if fname is just "." return $current_dirname
|
||||||
|
if {$fname eq "."} {
|
||||||
|
return $current_dirname
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# add extension for 1.0 file format compatibility
|
# add extension for 1.0 file format compatibility
|
||||||
if { $ext ne {} } {
|
if { $ext ne {} } {
|
||||||
set fname [file rootname $fname]$ext
|
set fname [file rootname $fname]$ext
|
||||||
}
|
}
|
||||||
# transform ./file_or_path to file_or_path, resolve (normalize) ../file_or_path
|
# transform ./file_or_path to file_or_path, resolve ../file_or_path
|
||||||
if { [regexp {^\.\./} $fname ] } {
|
if { [regexp {^\.\./} $fname ] } {
|
||||||
set fname [file normalize $fname]
|
if { [regexp {^/} $current_dirname] } {
|
||||||
|
set fname "[file dirname $current_dirname][regsub {^\.\.} $fname {}]"
|
||||||
|
}
|
||||||
} elseif {[regexp {^\./} $fname ] } {
|
} elseif {[regexp {^\./} $fname ] } {
|
||||||
regsub {^\./} $fname {} fname
|
regsub {^\./} $fname {} fname
|
||||||
}
|
}
|
||||||
|
|
@ -3032,7 +3037,7 @@ if { [info exists XSCHEM_LIBRARY_PATH] } {
|
||||||
if { ![string compare $i .] } {
|
if { ![string compare $i .] } {
|
||||||
lappend pathlist $i
|
lappend pathlist $i
|
||||||
} elseif { [ file exists $i] } {
|
} elseif { [ file exists $i] } {
|
||||||
lappend pathlist [file normalize ${i}]
|
lappend pathlist ${i}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,9 @@
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
## set custom colors for xschem libraries matching certain patterns
|
## set custom colors for xschem libraries matching certain patterns
|
||||||
## each line contains a pattern followed by a color
|
## each line contains a dircolor(pattern) followed by a color
|
||||||
## color can be an ordinary name (grey, brown, blue) or a hex code {#77aaff}
|
## color can be an ordinary name (grey, brown, blue) or a hex code {#77aaff}
|
||||||
## hex code must be enclosed in braces
|
## hex code must be enclosed in braces
|
||||||
## don't forget backslash at end of line
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
# set dircolor(/share/xschem/) red
|
# set dircolor(/share/xschem/) red
|
||||||
|
|
@ -67,11 +66,7 @@
|
||||||
## Window to open on startup XSCHEM_START_WINDOW
|
## Window to open on startup XSCHEM_START_WINDOW
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
# Start without a design:
|
# Start without a design if no filename given on command line:
|
||||||
#
|
|
||||||
# set XSCHEM_START_WINDOW {}
|
|
||||||
|
|
||||||
# Start with a design
|
|
||||||
# To avoid absolute paths, use a path that is relative to one of the
|
# To avoid absolute paths, use a path that is relative to one of the
|
||||||
# XSCHEM_LIBRARY_PATH directories.
|
# XSCHEM_LIBRARY_PATH directories.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue