added netlist_options as list of symbols not to load in schematics-as-symbol instances, load_file_dialog: make remember last dir work again

This commit is contained in:
Stefan Frederik 2022-10-09 23:49:28 +02:00
parent c5e7e3be29
commit 150c2663b9
4 changed files with 26 additions and 26 deletions

View File

@ -29,7 +29,6 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
* if already present just return entry address
* and update in/out fields sum up port field
* return NULL otherwise
* "whatever" "in"/"out" 0,XINSERT_NOREPLACE same as XINSERT but do not replace existing value
*
* "whatever" whatever 2,XDELETE delete entry if found return NULL
* "whatever" whatever 1,XLOOKUP only look up element, dont insert */
@ -57,7 +56,7 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w
{
if( !entry ) /* empty slot */
{
if( what==XINSERT || what==XINSERT_NOREPLACE) /* insert data */
if( what==XINSERT ) /* insert data */
{
s=sizeof( Node_hashentry );
entry=(Node_hashentry *)my_malloc(281, s);

View File

@ -3164,6 +3164,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
if( /* add here symbol types not to consider when loading schematic-as-symbol instances */
!strcmp(symtype, "logo") ||
!strcmp(symtype, "netlist_commands") ||
!strcmp(symtype, "netlist_options") ||
!strcmp(symtype, "arch_declarations") ||
!strcmp(symtype, "architecture") ||
!strcmp(symtype, "attributes") ||

View File

@ -2657,7 +2657,7 @@ void print_verilog_element(FILE *fd, int inst)
if(!extra_token) break;
val = get_tok_value(xctx->inst[inst].prop_ptr, extra_token, 0);
if(!val[0]) val = get_tok_value( (xctx->inst[inst].ptr + xctx->sym)->prop_ptr, extra_token, 0);
if(!val[0]) val = get_tok_value(template, extra_token, 0);
if(tmp) fprintf(fd,"\n");
fprintf(fd, " ?%d %s %s ", 1, extra_token, val);
tmp = 1;

View File

@ -2619,19 +2619,19 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}}
# .load.l paneconfigure .load.l.paneright -stretch always
frame .load.buttons
frame .load.buttons_bot
button .load.buttons_bot.ok -width 5 -text OK -command {
set myload_retval [.load.buttons_bot.entry get]
button .load.buttons_bot.ok -width 5 -text OK -command "
set myload_retval \[.load.buttons_bot.entry get\]
destroy .load
xschem preview_window destroy {} {}
set initdir "$myload_dir1"
}
button .load.buttons_bot.cancel -width 5 -text Cancel -command {
set $global_initdir \"\$myload_dir1\"
"
button .load.buttons_bot.cancel -width 5 -text Cancel -command "
set myload_retval {}
destroy .load
if {$myload_loadfile == 2} {xschem abort_operation}
if {\$myload_loadfile == 2} {xschem abort_operation}
xschem preview_window destroy {} {}
set initdir "$myload_dir1"
}
set $global_initdir \"\$myload_dir1\"
"
button .load.buttons.home -width 5 -text {Home} -command {
bind .load.l.paneright.draw <Expose> {}
.load.l.paneright.draw configure -background white
@ -2695,32 +2695,32 @@ proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}}
}
myload_set_home $initdir
if { $loadfile != 2} {
bind .load <Return> {
set myload_retval [.load.buttons_bot.entry get]
if {$myload_retval ne {} } {
bind .load <Return> "
set myload_retval \[.load.buttons_bot.entry get\]
if {\$myload_retval ne {} } {
destroy .load
xschem preview_window destroy {} {}
set initdir "$myload_dir1"
set $global_initdir \"\$myload_dir1\"
}
}
bind .load.l.paneright.list <Double-Button-1> {
set myload_retval [.load.buttons_bot.entry get]
if {$myload_retval ne {} &&
![file isdirectory "$myload_dir1/[.load.l.paneright.list get $myload_sel]"]} {
"
bind .load.l.paneright.list <Double-Button-1> "
set myload_retval \[.load.buttons_bot.entry get\]
if {\$myload_retval ne {} &&
!\[file isdirectory \"\$myload_dir1/\[.load.l.paneright.list get \$myload_sel\]\"\]} {
bind .load.l.paneright.draw <Expose> {}
destroy .load
xschem preview_window destroy {} {}
set initdir "$myload_dir1"
set $global_initdir \"\$myload_dir1\"
}
}
"
}
bind .load <Escape> {
bind .load <Escape> "
set myload_retval {}
destroy .load
if {$myload_loadfile == 2} {xschem abort_operation}
if {\$myload_loadfile == 2} {xschem abort_operation}
xschem preview_window destroy {} {}
set initdir "$myload_dir1"
}
set $global_initdir \"\$myload_dir1\"
"
### update
if { [ info exists myload_sash_pos] } {