sym_vs_sch_pins() do not try to get the "type" attribute of symbols references containing "@" characters (unresolved @parameters) by loading the symbol and checking the xctx->sym[symbol].type attribute, this usually happens in parametrized symbol generators

This commit is contained in:
stefan schippers 2023-05-16 14:45:52 +02:00
parent 71c04ad071
commit eef043ef2f
3 changed files with 15 additions and 3 deletions

View File

@ -1344,6 +1344,16 @@ int sym_vs_sch_pins()
break;
}
load_ascii_string(&tmp,fd);
/* generators or names with @ characters in general need translate() to process
* arguments. This can not be done in this context (the current schematic we are looking
* into is not loaded), so skip test */
if( strchr(name, '@')) {
dbg(1, "sym_vs_sch_pins(): symbol reference %s skipped (need to translate() tokens)\n",
name);
break;
}
symbol = match_symbol(name);
my_strdup(_ALLOC_ID_, &type, xctx->sym[symbol].type);
if(type && IS_PIN(type)) {

View File

@ -3176,7 +3176,8 @@ int load_sym_def(const char *name, FILE *embed_fd)
generator = is_generator(cmd);
if(generator) {
translated_cmd = get_generator_command(cmd);
dbg(1, "l_s_d(): generator: cmd=%s\n", cmd);
dbg(1, "l_s_d(): generator: cmd=|%s|\n", cmd);
dbg(1, "l_s_d(): generator: translated_cmd=|%s|\n", translated_cmd);
if(translated_cmd) {
lcc[level].fd = popen(translated_cmd, "r"); /* execute ss="/path/to/xxx par1 par2 ..." and pipe in the stdout */
} else {

View File

@ -4,6 +4,7 @@ exec tclsh "$0" "$@"
set arg1 [lindex $argv 0]
set rout [lindex $argv 1]
# puts stderr "arg1=|$arg1| $rout=|$rout|"
if { $arg1 eq {inv}} {
puts "v {xschem version=3.1.0 file_version=1.2}
K {type=subcircuit
@ -22,7 +23,7 @@ L 4 30 -0 40 -0 {}
B 5 37.5 -2.5 42.5 2.5 {name=y dir=out }
B 5 -42.5 -2.5 -37.5 2.5 {name=a dir=in }
A 4 25 -0 5 180 360 {}
T {$arg1 $rout } -47.5 24 0 0 0.3 0.3 {}
T {$arg1 $rout} -47.5 24 0 0 0.3 0.3 {}
T {@name} 25 -22 0 0 0.2 0.2 {}
T {y} 7.5 -6.5 0 1 0.2 0.2 {}
T {a} -17.5 -6.5 0 0 0.2 0.2 {}
@ -44,7 +45,7 @@ L 4 -20 -20 -20 20 {}
L 4 -20 20 20 0 {}
B 5 37.5 -2.5 42.5 2.5 {name=y dir=out }
B 5 -42.5 -2.5 -37.5 2.5 {name=a dir=in }
T {$arg1 $rout } -47.5 24 0 0 0.3 0.3 {}
T {$arg1 $rout} -47.5 24 0 0 0.3 0.3 {}
T {@name} 25 -22 0 0 0.2 0.2 {}
T {y} 7.5 -6.5 0 1 0.2 0.2 {}
T {a} -17.5 -6.5 0 0 0.2 0.2 {}