add command `xschem fill_type n fill_type`

This commit is contained in:
stefan schippers 2024-01-15 00:45:24 +01:00
parent 17e24e0f5f
commit c46afdc582
4 changed files with 36 additions and 3 deletions

View File

@ -548,6 +548,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
<li><kbd> abort_operation</kbd></li><pre>
@ -682,6 +683,9 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
xschem expandlabel {2*A[3:0]} --&gt; A[3],A[2],A[1],A[0],A[3],A[2],A[1],A[0] 8
last field is the number of bits
since [ and ] are TCL special characters argument must be quoted with { and } </pre>
<li><kbd> fill_type n fill_type [nodraw]</kbd></li><pre>
Set fill type for layer 'n', fill_type may be 'solid' or 'stipple' or 'empty'
If 'nodraw' is given do not redraw window.</pre>
<li><kbd> find_nth string sep quote keep_quote n</kbd></li><pre>
Find n-th field string separated by characters in sep. 1st field is in position 1
do not split quoted fields (if quote characters are given) and return unquoted.
@ -1483,6 +1487,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"

View File

@ -908,13 +908,38 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else { cmd_found = 0;}
break;
case 'f': /*----------------------------------------------*/
/* fill_type n fill_type [nodraw]
* Set fill type for layer 'n', fill_type may be 'solid' or 'stipple' or 'empty'
* If 'nodraw' is given do not redraw window.
*/
if(!strcmp(argv[1], "fill_type"))
{
int dr = 1;
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
if(argc > 3) {
int n = atoi(argv[2]);
if(n >=0 && n < cadlayers) {
if(!strcmp(argv[3], "solid")) xctx->fill_type[n]=1;
else if(!strcmp(argv[3], "stipple")) xctx->fill_type[n]=2;
else if(!strcmp(argv[3], "empty")) xctx->fill_type[n]=0;
free_gc();
create_gc();
enable_layers();
build_colors(0.0, 0.0);
resetwin(1, 0, 1, 0, 0); /* recreate pixmap. resetwin(create_pixmap, clear_pixmap, force, w, h) */
if(argc > 4 && !strcmp(argv[4], "nodraw")) dr = 0;
if(dr) draw();
}
}
}
/* find_nth string sep quote keep_quote n
* Find n-th field string separated by characters in sep. 1st field is in position 1
* do not split quoted fields (if quote characters are given) and return unquoted.
* xschem find_nth {aaa,bbb,ccc,ddd} {,} 2 --> bbb
* xschem find_nth {aaa, "bbb, ccc" , ddd} { ,} {"} 2 --> bbb, ccc
*/
if(!strcmp(argv[1], "find_nth"))
else if(!strcmp(argv[1], "find_nth"))
{
if(argc > 6) {
Tcl_SetResult(interp, find_nth(argv[2], argv[3], argv[4], atoi(argv[5]), atoi(argv[6])), TCL_VOLATILE);

View File

@ -403,7 +403,7 @@ static void free_xschem_data()
my_free(_ALLOC_ID_, &xctx);
}
static void create_gc(void)
void create_gc(void)
{
int i;
for(i=0;i<cadlayers; ++i)
@ -417,7 +417,7 @@ static void create_gc(void)
}
}
static void free_gc()
void free_gc()
{
int i;
for(i=0;i<cadlayers; ++i) {

View File

@ -1663,6 +1663,8 @@ extern int prepare_netlist_structs(int for_netlist);
extern int skip_instance(int i, int skip_short, int lvs_ignore);
extern int shorted_instance(int i, int lvs_ignore);
extern int compare_schematics(const char *filename);
extern void create_gc(void);
extern void free_gc(void);
extern int warning_overlapped_symbols(int sel);
extern void free_simdata(void);
extern void delete_netlist_structs(void);