added commands xschem get schprop|schvhdprop|schverilogprop|schtedaxprop|schsymbolprop, "xschem create_text" renamed to "xschem text" for syntax consistency

This commit is contained in:
stefan schippers 2023-09-29 09:46:31 +02:00
parent 64cb20dab9
commit c569f93a65
4 changed files with 63 additions and 37 deletions

View File

@ -492,16 +492,6 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
@ -581,13 +571,6 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
Create an xplot file in netlist/simulation directory with
the list of highlighted nodes in a format the selected waveform
viewer understands (bespice, gaw, ngspice) </pre>
<li><kbd> create_text draw x y rot flip text props size</kbd></li><pre>
Create a text object
draw is a flag. If set to 1 will draw the created text
x, y, rot, flip specify the position and orientation
text is the text string
props is the attribute string
size sets the size </pre>
<li><kbd> cut</kbd></li><pre>
Cut selection to clipboard </pre>
<li><kbd> debug n</kbd></li><pre>
@ -689,6 +672,11 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
<li><kbd> sellayer </kbd> layer number for selection </li>
<li><kbd> semaphore </kbd> used for debug </li>
<li><kbd> schname </kbd> get full path of current sch. if 'n' given get sch of level 'n' </li>
<li><kbd> schprop </kbd> get schematic "spice" global attributes </li>
<li><kbd> schvhdlprop </kbd> get schematic "vhdl" global attributes </li>
<li><kbd> schverilogprop </kbd> get schematic "verilog" global attributes </li>
<li><kbd> schsymbolprop </kbd> get schematic "symbol" global attributes </li>
<li><kbd> schtedaxprop </kbd> get schematic "tedax" global attributes </li>
<li><kbd> sch_path </kbd> get hierarchy path. if 'n' given get hierpath of level 'n' </li>
<li><kbd> sch_to_compare </kbd> if set return schematic current design is compared with </li>
<li><kbd> temp_dir </kbd> get windows temporary dir </li>
@ -1257,6 +1245,13 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
0.0 0.0 1.8 0.3
0.1 0.0 1.5 0.6
... ... ... ...</pre>
<li><kbd> text x y rot flip text props size draw</kbd></li><pre>
Create a text object
x, y, rot, flip specify the position and orientation
text is the text string
props is the attribute string
size sets the size
draw is a flag. If set to 1 will draw the created text </pre>
<li><kbd> test </kbd></li><pre>
testmode </pre>
<li><kbd> toggle_colorscheme</kbd></li><pre>
@ -1333,6 +1328,16 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"

View File

@ -27,7 +27,7 @@ proc create_graph {title rawfile node {analysis tran} {color {4 5 6 7 8 9 10 11
xschem clear force
# add title text
xschem create_text 1 30 -350 0 0 $title {} 0.5
xschem text 30 -350 0 0 $title {} 0.5 1
# clear loaded raw file if any
xschem raw_clear
# set current layer to graph layer (grey, layer 2)

View File

@ -38,7 +38,7 @@ proc place_sym_pins {filename dir {x 0} {y 0} {spacing 20}} {
xschem rect $x1 $y1 $x2 $y2 -1 "name=$name dir=$dir" 0
xschem set rectcolor 4 ;# symbol line color
xschem line $x $y [expr {$x + $line_offset}] $y {} 0
xschem create_text 0 [expr {$x + $offset}] [expr {$y - 4}] 0 $flip $name {} 0.2
xschem text [expr {$x + $offset}] [expr {$y - 4}] 0 $flip $name {} 0.2 0
incr y $spacing
}
xschem set schsymbolprop "type=subcircuit\nformat=\"@name @pinlist @symname\"\ntemplate=\"name=X1\""

View File

@ -567,24 +567,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_ResetResult(interp);
}
/* create_text draw x y rot flip text props size
* Create a text object
* draw is a flag. If set to 1 will draw the created text
* x, y, rot, flip specify the position and orientation
* text is the text string
* props is the attribute string
* size sets the size */
else if(!strcmp(argv[1], "create_text") )
{
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
if(argc > 9) {
create_text(atoi(argv[2]), atof(argv[3]), atof(argv[4]), atoi(argv[5]), atoi(argv[6]),
argv[7], argv[8], atof(argv[9]), atof(argv[9]));
}
Tcl_ResetResult(interp);
}
/* cut
* Cut selection to clipboard */
else if(!strcmp(argv[1], "cut"))
@ -1189,6 +1171,26 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_SetResult(interp, xctx->sch[x], TCL_VOLATILE);
}
}
else if(!strcmp(argv[2], "schprop")) /* get schematic "spice" global attributes */
{
Tcl_SetResult(interp, xctx->schprop ? xctx->schprop : "", TCL_VOLATILE);
}
else if(!strcmp(argv[2], "schvhdlprop")) /* get schematic "vhdl" global attributes */
{
Tcl_SetResult(interp, xctx->schvhdlprop ? xctx->schvhdlprop : "", TCL_VOLATILE);
}
else if(!strcmp(argv[2], "schverilogprop")) /* get schematic "verilog" global attributes */
{
Tcl_SetResult(interp, xctx->schverilogprop ? xctx->schverilogprop : "", TCL_VOLATILE);
}
else if(!strcmp(argv[2], "schsymbolprop")) /* get schematic "symbol" global attributes */
{
Tcl_SetResult(interp, xctx->schsymbolprop ? xctx->schsymbolprop : "", TCL_VOLATILE);
}
else if(!strcmp(argv[2], "schtedaxprop")) /* get schematic "tedax" global attributes */
{
Tcl_SetResult(interp, xctx->schtedaxprop ? xctx->schtedaxprop : "", TCL_VOLATILE);
}
else if(!strcmp(argv[2], "sch_path")) /* get hierarchy path. if 'n' given get hierpath of level 'n' */
{
int x;
@ -4393,6 +4395,25 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
Tcl_ResetResult(interp);
}
/* text x y rot flip text props size draw
* Create a text object
* x, y, rot, flip specify the position and orientation
* text is the text string
* props is the attribute string
* size sets the size
* draw is a flag. If set to 1 will draw the created text */
else if(!strcmp(argv[1], "text") )
{
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
if(argc < 10) {Tcl_SetResult(interp,
"xschem text requires 8 additional arguments", TCL_STATIC); return TCL_ERROR;}
create_text(atoi(argv[9]), atof(argv[2]), atof(argv[3]), atoi(argv[4]), atoi(argv[5]),
argv[6], argv[7], atof(argv[8]), atof(argv[9]));
Tcl_ResetResult(interp);
}
/* test
* testmode */
else if(!strcmp(argv[1], "test"))