for better consistency floater=... attribute for text floaters changed to name=... so token name matches instance refdes (name=...). Documentation added for netlist_dir (netlisting.html) and local_netlist_dir

This commit is contained in:
stefan schippers 2023-05-14 23:43:16 +02:00
parent d577bdde7a
commit 70ea2bb7f1
5 changed files with 40 additions and 24 deletions

View File

@ -25,12 +25,28 @@ p{padding: 15px 30px 10px;}
<kbd>VHDL</kbd>. Netlisting mode can be set in the <kbd>Options</kbd> menu
(<kbd>Vhdl</kbd>, <kbd>Verilog</kbd> <kbd>Spice</kbd> radio buttons)
or with the <kbd>&lt;Shift&gt;V</kbd> key. Once a netlist mode is set, hitting the
<kbd>Netlist</kbd> button on the top-right of the menu bar or the <kbd>&lt;Shift&gt;N</kbd>
key will produce the netlist file in the defined simulation directory.
<kbd>Netlist</kbd> button on the top-right of the menu bar or the <kbd>n</kbd>
key will produce the netlist file in the defined simulation directory.<br>
The simulation directory is one important path that is specified in the <kbd>xschemrc</kbd>
file, if no one is defined XSCHEM will prompt for a directory.
file with the tcl variable <kbd>netlist_dir</kbd> (default if unset is <kbd>~/.xschem/simulations</kbd>)
if <kbd>netlist_dir</kbd> is set to empty value (<kbd>set netlist_dir {}</kbd>)
xschem will prompt user the first time the netlist is created.<br>
The path where netlists are produced can be changed with the
<kbd>Simulation-&gt;Set netlist dir</kbd> menu entry.
<kbd>Simulation-&gt;Set netlist dir</kbd> menu entry or simply by changing the
<kbd>netlist_dir</kbd> variable, either
in the xschemrc file or interactively by giving tcl commands.<br>
If you use xschem interactively by giving tcl commands you may do something like:<br>
<kbd>set netlist_dir [xschem get current_dirname]/spice; xschem netlist</kbd><br>
to have the netlist saved into a <kbd>spice/</kbd> folder into the directory containing the current
schematic (this directory is not necessarily the current directory, like 'pwd').
There is also a <kbd>local_netlist_dir</kbd> variable. If this variable is set to 1
(default setting if unspecified is 0) instead of using <kbd>~/.xschem/simulations</kbd>
the netlist will be saved in <kbd>(directory of current schematic)/simulation</kbd>
The netlist filename is <kbd>cellname.ext</kbd> where <kbd>cellname</kbd> is the name of the
top-level schematic from which the netlist has been generated, and <kbd>ext</kbd> is the
file extension:</p>

View File

@ -105,7 +105,7 @@ const char *get_text_floater(int i)
if(xctx->text[i].floater_instname)
instname = xctx->text[i].floater_instname;
else
instname = get_tok_value(xctx->text[i].prop_ptr, "floater", 0);
instname = get_tok_value(xctx->text[i].prop_ptr, "name", 0);
inst = get_instance(instname);
if(inst >= 0) {
if(xctx->text[i].floater_ptr) {
@ -744,9 +744,9 @@ int set_text_flags(xText *t)
t->flags |= strcmp(str, "bold") ? 0 : TEXT_BOLD;
str = get_tok_value(t->prop_ptr, "hide", 0);
t->flags |= strcmp(str, "true") ? 0 : HIDE_TEXT;
str = get_tok_value(t->prop_ptr, "floater", 0);
str = get_tok_value(t->prop_ptr, "name", 0);
t->flags |= xctx->tok_size ? TEXT_FLOATER : 0;
my_strdup2(_ALLOC_ID_, &t->floater_instname, get_tok_value(t->prop_ptr, "floater", 0));
my_strdup2(_ALLOC_ID_, &t->floater_instname, str);
}
return 0;
}

View File

@ -2415,11 +2415,13 @@ int Tcl_AppInit(Tcl_Interp *inter)
/* set tcl netlist_dir if netlist_dir given on cmdline */
if(cli_opt_netlist_dir[0]) tclsetvar("netlist_dir", cli_opt_netlist_dir);
if(!set_netlist_dir(0, NULL)) {
const char *n;
n = tclgetvar("netlist_dir");
fprintf(errfp, "problems creating netlist directory %s\n", n ? n : "<NULL>");
}
/*
* if(!set_netlist_dir(0, NULL)) {
* const char *n;
* n = tclgetvar("netlist_dir");
* fprintf(errfp, "problems creating netlist directory %s\n", n ? n : "<NULL>");
* }
*/
if(cli_opt_initial_netlist_name[0]) my_strncpy(xctx->netlist_name, cli_opt_initial_netlist_name, S(cli_opt_initial_netlist_name));
enable_layers();

View File

@ -98,6 +98,10 @@
#### If unset $USER_CONF_DIR/simulations is assumed (normally ~/.xschem/simulations)
# set netlist_dir $env(HOME)/.xschem/simulations
##### if this is set to '1' netlists and simulations will go into a simulation/ folder
##### inside the directory containing the top level schematic. Default: not set (0)
# set local_netlist_dir 1
###########################################################################
#### NETLIST AND HIERARCHICAL PRINT EXCLUDE PATTERNS
###########################################################################

View File

@ -177,20 +177,14 @@ T {set between 0 and 1
to simulate
sun radiation
level} 10 -440 0 0 0.2 0.2 {}
T {@name} 875 -698.75 0 0 0.3 0.3 {floater=L2
layer=7}
T {@value} 875 -673.75 0 0 0.3 0.3 {floater=L2
layer=7}
T {m=@m} 875 -648.75 0 0 0.3 0.3 {floater=L2
layer=7}
T {@name} 875 -698.75 0 0 0.3 0.3 {layer=7 name=L2}
T {@value} 875 -673.75 0 0 0.3 0.3 {layer=7 name=L2}
T {m=@m} 875 -648.75 0 0 0.3 0.3 {layer=7 name=L2}
T {Floater text
example} 850 -820 0 0 0.4 0.4 {}
T {@name} 985 -308.75 0 1 0.3 0.3 {floater=C1
layer=7}
T {@value} 985 -286.25 0 1 0.3 0.3 {floater=C1
layer=7}
T {m=@m} 985 -263.75 0 1 0.3 0.3 {floater=C1
layer=7}
T {@name} 985 -308.75 0 1 0.3 0.3 {layer=7 name=C1}
T {@value} 985 -286.25 0 1 0.3 0.3 {layer=7 name=C1}
T {m=@m} 985 -263.75 0 1 0.3 0.3 {layer=7 name=C1}
T {Floater text
example} 870 -440 0 0 0.4 0.4 {}
N 1010 -210 1100 -210 {lab=0}