add verilog_extra_dir symbol attribute to allow specify "ports by attribute" directions: verilog_extra_dir="VCC=input GND=input" verilog_extra="VCC GND" extra="VCC GND" ....; proc set_netlist_dir will show the last set simulation directory instead of the default ~/.xschem/simulations. Changed background color of menu radiobuttons for clarity.

This commit is contained in:
stefan schippers 2024-02-05 11:14:51 +01:00
parent fdc2fb5517
commit 046c23addd
2 changed files with 30 additions and 19 deletions

View File

@ -560,13 +560,22 @@ int verilog_block_netlist(FILE *fd, int i)
}
int_hash_free(&table);
if(extra2) {
char *verilog_extra_dir = NULL;
const char *dir;
my_strdup2(_ALLOC_ID_, &verilog_extra_dir, get_tok_value(xctx->sym[i].prop_ptr, "verilog_extra_dir", 0));
saveptr1 = NULL;
for(extra_ptr = extra2; ; extra_ptr=NULL) {
extra_token=my_strtok_r(extra_ptr, " ", "", 0, &saveptr1);
if(!extra_token) break;
fprintf(fd, " inout %s ;\n", extra_token);
dir = get_tok_value(verilog_extra_dir, extra_token, 0);
if(dir[0]) {
fprintf(fd, " %s %s ;\n", dir, extra_token);
} else {
fprintf(fd, " inout %s ;\n", extra_token);
}
fprintf(fd, " wire %s ;\n", extra_token);
}
my_free(_ALLOC_ID_, &verilog_extra_dir);
}
dbg(1, "verilog_block_netlist(): netlisting %s\n", get_cell( xctx->sch[xctx->currsch], 0));
err |= verilog_netlist(fd, verilog_stop);

View File

@ -4013,8 +4013,10 @@ proc set_netlist_dir { change {dir {} }} {
}
if { $dir eq {} } {
# set to default simulations/ directory.
if {$local_netlist_dir == 0 } {
if {$local_netlist_dir == 0 && $netlist_dir eq {}} {
set initdir "$USER_CONF_DIR/simulations"
} elseif {$local_netlist_dir == 0 } {
set initdir $netlist_dir
} elseif { $netlist_dir ne {} } {
set initdir $netlist_dir
} else {
@ -7128,19 +7130,19 @@ proc build_widgets { {topwin {} } } {
$topwin.menubar.option.menu.netlist add checkbutton -label "Split netlist" -variable split_files \
-accelerator {}
$topwin.menubar.option.menu.netlist add radiobutton -label "Spice netlist"\
-variable netlist_type -value spice -accelerator {Ctrl+Shift+V} \
-background grey60 -variable netlist_type -value spice -accelerator {Ctrl+Shift+V} \
-command "xschem set netlist_type spice; xschem redraw"
$topwin.menubar.option.menu.netlist add radiobutton -label "VHDL netlist"\
-variable netlist_type -value vhdl -accelerator {Ctrl+Shift+V} \
-background grey60 -variable netlist_type -value vhdl -accelerator {Ctrl+Shift+V} \
-command "xschem set netlist_type vhdl; xschem redraw"
$topwin.menubar.option.menu.netlist add radiobutton -label "Verilog netlist"\
-variable netlist_type -value verilog -accelerator {Ctrl+Shift+V} \
-background grey60 -variable netlist_type -value verilog -accelerator {Ctrl+Shift+V} \
-command "xschem set netlist_type verilog; xschem redraw"
$topwin.menubar.option.menu.netlist add radiobutton -label "tEDAx netlist" \
-variable netlist_type -value tedax -accelerator {Ctrl+Shift+V} \
-background grey60 -variable netlist_type -value tedax -accelerator {Ctrl+Shift+V} \
-command "xschem set netlist_type tedax; xschem redraw"
$topwin.menubar.option.menu.netlist add radiobutton -label "Symbol global attrs" \
-variable netlist_type -value symbol -accelerator {Ctrl+Shift+V} \
-background grey60 -variable netlist_type -value symbol -accelerator {Ctrl+Shift+V} \
-command "xschem set netlist_type symbol; xschem redraw"
@ -7181,11 +7183,11 @@ proc build_widgets { {topwin {} } } {
$topwin.menubar.edit.menu add command -label "Rotate selected objects" -state normal \
-command {xschem rotate} -accelerator {Shift-R}
$topwin.menubar.edit.menu add radiobutton -label "Unconstrained move" -variable constrained_move \
-value 0 -command {xschem set constrained_move 0}
-background grey60 -value 0 -command {xschem set constrained_move 0}
$topwin.menubar.edit.menu add radiobutton -label "Constrained Horizontal move" -variable constrained_move \
-value 1 -accelerator H -command {xschem set constrained_move 1}
-background grey60 -value 1 -accelerator H -command {xschem set constrained_move 1}
$topwin.menubar.edit.menu add radiobutton -label "Constrained Vertical move" -variable constrained_move \
-value 2 -accelerator V -command {xschem set constrained_move 2}
-background grey60 -value 2 -accelerator V -command {xschem set constrained_move 2}
$topwin.menubar.edit.menu add command -label "Push schematic" -command "xschem descend" -accelerator E
toolbar_add EditPushSch "xschem descend" "Push schematic" $topwin
$topwin.menubar.edit.menu add command -label "Push symbol" -command "xschem descend_symbol" -accelerator I
@ -7327,13 +7329,13 @@ proc build_widgets { {topwin {} } } {
$topwin.menubar.prop.menu add command -background red -label "Edit file (danger!)" \
-command "xschem edit_file" -accelerator Alt+Q
$topwin.menubar.sym.menu add radiobutton -label "Show symbols" \
-variable hide_symbols -value 0 \
-background grey60 -variable hide_symbols -value 0 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
$topwin.menubar.sym.menu add radiobutton -label "Show instance Bounding boxes for subcircuit symbols" \
-variable hide_symbols -value 1 \
-background grey60 -variable hide_symbols -value 1 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
$topwin.menubar.sym.menu add radiobutton -label "Show instance Bounding boxes for all symbols" \
-variable hide_symbols -value 2 \
-background grey60 -variable hide_symbols -value 2 \
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
$topwin.menubar.sym.menu add command -label "Set symbol width" \
-command {
@ -7470,14 +7472,14 @@ proc build_widgets { {topwin {} } } {
}
$topwin.menubar.simulation.menu add checkbutton -label "Show netlist after netlist command" \
-variable netlist_show -accelerator {Shift+A}
$topwin.menubar.simulation.menu add radiobutton -label "set netlisting directory" \
-variable local_netlist_dir -value 0 \
$topwin.menubar.simulation.menu add radiobutton -indicatoron 1 -label "Use netlist directory" \
-background grey60 -variable local_netlist_dir -value 0 \
-command {set_netlist_dir 1 }
$topwin.menubar.simulation.menu add radiobutton -label "Use 'simulation' dir in schematic dir" \
-variable local_netlist_dir -value 1 \
$topwin.menubar.simulation.menu add radiobutton -indicatoron 1 -label "Use 'simulation' dir in schematic dir" \
-background grey60 -variable local_netlist_dir -value 1 \
-command {set_netlist_dir 1 }
$topwin.menubar.simulation.menu add radiobutton -label "Use 'simulation/\[schname\]' dir in schematic dir" \
-variable local_netlist_dir -value 2 \
$topwin.menubar.simulation.menu add radiobutton -indicatoron 1 -label "Use 'simulation/\[schname\]' dir in schematic dir" \
-background grey60 -variable local_netlist_dir -value 2 \
-command {set_netlist_dir 1 }
$topwin.menubar.simulation.menu add command -label {Configure simulators and tools} -command {simconf}
if {$OS == {Windows}} {