rename xschem_simulator/ n.sym and p.sym to ntrans.sym and ptrans.sym to avoid confusion with symbols in rom8k/; place tk_messageBox above right xschem window when using multiple (single process) windows.

This commit is contained in:
Stefan Frederik 2021-12-17 03:29:53 +01:00
parent 72f365f995
commit 993c3a24c2
7 changed files with 35 additions and 119 deletions

View File

@ -832,7 +832,8 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
if(key=='a' && state == 0) /* make symbol */
{
if(xctx->semaphore >= 2) break;
tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}");
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] "
"-message {do you want to make symbol view ?}");
if(strcmp(tclresult(),"ok")==0)
{
save_schematic(xctx->sch[xctx->currsch]);
@ -967,7 +968,8 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
if(key=='s' && state & Mod1Mask) /* reload */
{
if(xctx->semaphore >= 2) break;
tcleval("tk_messageBox -type okcancel -message {Are you sure you want to reload from disk?}");
tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] "
"-message {Are you sure you want to reload from disk?}");
if(strcmp(tclresult(),"ok")==0) {
char filename[PATH_MAX];
unselect_all();
@ -1306,7 +1308,8 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
else if(xctx->netlist_type == CAD_TEDAX_NETLIST)
global_tedax_netlist(1);
else
if(has_x) tcleval("tk_messageBox -type ok -message {Please Set netlisting mode (Options menu)}");
if(has_x) tcleval("tk_messageBox -type ok -parent [xschem get topwindow] "
"-message {Please Set netlisting mode (Options menu)}");
dbg(1, "callback(): -------------\n");
}
@ -1328,7 +1331,8 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
else if(xctx->netlist_type == CAD_TEDAX_NETLIST)
global_tedax_netlist(0);
else
if(has_x) tcleval("tk_messageBox -type ok -message {Please Set netlisting mode (Options menu)}");
if(has_x) tcleval("tk_messageBox -type ok -parent [xschem get topwindow] "
"-message {Please Set netlisting mode (Options menu)}");
dbg(1, "callback(): -------------\n");
}
break;

View File

@ -110,7 +110,8 @@ const char *expandlabel(const char *s, int *m)
cmd = my_malloc(526, l);
fprintf(errfp, "syntax error in %s\n", s);
my_snprintf(cmd, l,
"tk_messageBox -icon error -type ok -message {Syntax error in identifier expansion: %s}", s);
"tk_messageBox -icon error -type ok -parent [xschem get topwindow] "
"-message {Syntax error in identifier expansion: %s}", s);
if(has_x) tcleval(cmd);
my_free(543, &cmd);

View File

@ -2224,7 +2224,8 @@ void make_schematic_symbol_from_sel(void)
my_strncpy(filename, tclresult(), S(filename));
if (!strcmp(filename, xctx->sch[xctx->currsch])) {
if (has_x)
tcleval("tk_messageBox -type ok -message {Cannot overwrite current schematic}");
tcleval("tk_messageBox -type ok -parent [xschem get topwindow] "
"-message {Cannot overwrite current schematic}");
}
else if (strlen(filename)) {
if (xctx->lastsel) xctx->push_undo();
@ -2234,7 +2235,8 @@ void make_schematic_symbol_from_sel(void)
if (has_x)
{
my_snprintf(name, S(name),
"tk_messageBox -type okcancel -message {do you want to make symbol view for %s ?}", filename);
"tk_messageBox -type okcancel -parent [xschem get topwindow] "
"-message {do you want to make symbol view for %s ?}", filename);
tcleval(name);
}
if (!has_x || !strcmp(tclresult(), "ok")) {

View File

@ -1584,7 +1584,8 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(!strcmp(argv[1],"make_symbol"))
{
cmd_found = 1;
if(has_x) tcleval("tk_messageBox -type okcancel -message {do you want to make symbol view ?}");
if(has_x) tcleval("tk_messageBox -type okcancel -parent [xschem get topwindow] "
"-message {do you want to make symbol view ?}");
if(!has_x || strcmp(tclresult(),"ok")==0) {
save_schematic(xctx->sch[xctx->currsch]);
make_symbol();
@ -1650,7 +1651,8 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else if(xctx->netlist_type == CAD_TEDAX_NETLIST)
global_tedax_netlist(1);
else
if(has_x) tcleval("tk_messageBox -type ok -message {Please Set netlisting mode (Options menu)}");
if(has_x) tcleval("tk_messageBox -type ok -parent [xschem get topwindow] "
"-message {Please Set netlisting mode (Options menu)}");
}
}
@ -2148,7 +2150,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
else r = search(argv[4],argv[5],1,select);
if(r == 0) {
if(has_x && !strcmp(argv[1],"searchmenu"))
tcleval("tk_messageBox -type ok -message {Not found.}");
tcleval("tk_messageBox -type ok -parent [xschem get topwindow] -message {Not found.}");
Tcl_SetResult(interp,"0", TCL_STATIC);
} else {
Tcl_SetResult(interp,"1", TCL_STATIC);

View File

@ -1,48 +0,0 @@
v {xschem version=3.0.0 file_version=1.2 }
G {}
K {type=nmos
function0="Z 2 1 M"
verilog_format="nmos #(@risedel , @falldel , @offdel ) @name ( @@d , @@s , @@g );"
format="@name @pinlist @model w=@w l=@l
+ ad='@w *4.3u' as='@w *4.3u'
+ pd='@w *2+8.6u' ps='@w *2+8.6u'
+ m=@m"
template="name=m1 model=cmosn w=4u l=2.4u m=1 risedel=50 falldel=50 offdel=50"
generic_type="model=string"
}
V {}
S {}
E {}
L 3 26.25 -28.75 26.25 -21.25 {}
L 3 26.25 -28.75 27.5 -28.75 {}
L 3 27.5 -28.75 28.75 -26.25 {}
L 3 28.75 -26.25 28.75 -23.75 {}
L 3 27.5 -21.25 28.75 -23.75 {}
L 3 26.25 -21.25 27.5 -21.25 {}
L 4 5 -30 5 30 {}
L 4 5 -20 20 -20 {}
L 4 20 -30 20 -20 {}
L 4 5 20 20 20 {}
L 4 20 20 20 30 {}
L 4 -5 -15 -5 15 {type=nmos
format="@name @pinlist @model w=@w l=@l
+ ad=\{@w *4.4u\}
+ as=\{@w *4.4u\}
+ pd=\{@w *2+8.8\}
+ ps=\{@w *2+8.8u\}
+ SA=8u SB=8u m=@m"
template="name=m1 model=cmosn w=2u l=1.2u m=1"
generic_type="model=string"
}
L 4 -5 0 -5 5 {}
L 4 -20 0 -12.5 0 {}
L 4 -20 0 -5 0 {}
L 4 10 0 20 0 {}
L 4 5 -5 10 0 {}
L 4 5 5 10 0 {}
B 5 17.5 -32.5 22.5 -27.5 {name=d dir=inout}
B 5 -22.5 -2.5 -17.5 2.5 {name=g dir=in goto=0}
B 5 17.5 27.5 22.5 32.5 {name=s dir=inout}
B 5 17.5 -2.5 22.5 2.5 {name=b dir=in}
T {@w\\/@l\\/@m} 7.5 -17.5 0 0 0.2 0.2 {}
T {@name} 7.5 5 0 0 0.2 0.2 {}

View File

@ -1,45 +0,0 @@
v {xschem version=3.0.0 file_version=1.2 }
G {}
K {type=pmos
function0="2 Z 1 M"
verilog_format="pmos #(@risedel , @falldel , @offdel ) @name ( @@d , @@s , @@g );"
format="@name @pinlist @model w=@w l=@l
+ ad='@w *4.6u' as='@w *4.6u'
+ pd='@w *2+9.2u' ps='@w *2+9.2u'
+ m=@m"
template="name=m1 model=cmosp w=4u l=2.4u risedel=50 falldel=50 offdel=50 m=1"
generic_type="model=string"
}
V {}
S {}
E {}
L 3 26.25 21.25 26.25 28.75 {}
L 3 26.25 21.25 27.5 21.25 {}
L 3 27.5 21.25 28.75 23.75 {}
L 3 28.75 23.75 28.75 26.25 {}
L 3 27.5 28.75 28.75 26.25 {}
L 3 26.25 28.75 27.5 28.75 {}
L 4 5 20 20 20 {}
L 4 20 20 20 30 {}
L 4 5 -20 20 -20 {}
L 4 20 -30 20 -20 {}
L 4 -5 -15 -5 15 {}
L 4 -5 -5 -5 -0 {}
L 4 -7.5 -5 -5 -2.5 {}
L 4 -10 -5 -7.5 -5 {}
L 4 -12.5 -2.5 -10 -5 {}
L 4 -12.5 -2.5 -12.5 2.5 {}
L 4 -12.5 2.5 -10 5 {}
L 4 -10 5 -7.5 5 {}
L 4 -7.5 5 -5 2.5 {}
L 4 -20 0 -12.5 -0 {}
L 4 5 -30 5 30 {11}
L 4 5 -5 10 0 {}
L 4 5 5 10 0 {}
L 4 10 0 20 0 {}
B 5 17.5 27.5 22.5 32.5 {name=d dir=inout}
B 5 -22.5 -2.5 -17.5 2.5 {name=g dir=in goto=0}
B 5 17.5 -32.5 22.5 -27.5 {name=s dir=inout}
B 5 17.5 -2.5 22.5 2.5 {name=b dir=in}
T {@w\\/@l\\/@m} 7.5 -17.5 0 0 0.2 0.2 {}
T {@name} 7.5 5 0 0 0.2 0.2 {999}

View File

@ -261,22 +261,22 @@ C {dlrtp_1.sym} 830 -690 0 0 {name=x15 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefi
C {dlrtn_1.sym} 560 -690 0 0 {name=x16 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {dfrtp_1.sym} 180 -720 0 0 {name=x13 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {inv_2.sym} 170 -820 0 1 {name=x14 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {n.sym} 1820 -240 0 0 {name=m7 model=cmosn w=wn l=lln m=1}
C {n.sym} 1950 -190 0 0 {name=m8 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 1820 -240 0 0 {name=m7 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 1950 -190 0 0 {name=m8 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 1690 -280 0 0 {name=p24 lab=A}
C {lab_pin.sym} 1690 -190 0 0 {name=p25 lab=B}
C {lab_pin.sym} 2030 -190 0 1 {name=p27 lab=GND}
C {lab_pin.sym} 1890 -240 0 1 {name=p30 lab=GND}
C {p.sym} 1820 -340 0 0 {name=m4 model=cmosp w=wp l=lp m=1 }
C {p.sym} 1820 -440 0 0 {name=m9 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 1820 -340 0 0 {name=m4 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 1820 -440 0 0 {name=m9 model=cmosp w=wp l=lp m=1 }
C {lab_pin.sym} 2020 -300 0 1 {name=p26 lab=Z}
C {lab_pin.sym} 1900 -440 0 1 {name=p31 lab=VCC}
C {gnd.sym} 1840 -140 0 0 {name=l3 lab=GND}
C {vdd.sym} 1840 -500 0 0 {name=l4 lab=VCC}
C {p.sym} 2330 -440 0 0 {name=m2 model=cmosp w=wp l=lp m=1 }
C {p.sym} 2450 -380 0 0 {name=m3 model=cmosp w=wp l=lp m=1 }
C {n.sym} 2370 -260 0 0 {name=m5 model=cmosn w=wn l=lln m=1}
C {n.sym} 2370 -170 0 0 {name=m6 model=cmosn w=wn l=lln m=1}
C {ptrans.sym} 2330 -440 0 0 {name=m2 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 2450 -380 0 0 {name=m3 model=cmosp w=wp l=lp m=1 }
C {ntrans.sym} 2370 -260 0 0 {name=m5 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 2370 -170 0 0 {name=m6 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 2440 -260 0 1 {name=p22 lab=GND}
C {lab_pin.sym} 2440 -170 0 1 {name=p28 lab=GND}
C {lab_pin.sym} 2410 -440 0 1 {name=p29 lab=VCC}
@ -286,25 +286,25 @@ C {gnd.sym} 2390 -120 0 0 {name=l12 lab=GND}
C {lab_pin.sym} 2180 -310 0 0 {name=p21 lab=B}
C {lab_pin.sym} 2180 -350 0 0 {name=p23 lab=A}
C {inv_2.sym} 660 -820 0 1 {name=x17 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {n.sym} 300 -1170 1 0 {name=m1 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 300 -1170 1 0 {name=m1 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 300 -1150 1 1 {name=p6 lab=GND}
C {p.sym} 300 -1010 3 0 {name=m10 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 300 -1010 3 0 {name=m10 model=cmosp w=wp l=lp m=1 }
C {lab_pin.sym} 300 -1030 3 1 {name=p18 lab=VCC}
C {inv_2.sym} 210 -1220 0 0 {name=x18 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {n.sym} 300 -1430 1 0 {name=m11 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 300 -1430 1 0 {name=m11 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 300 -1410 1 1 {name=p33 lab=GND}
C {p.sym} 300 -1270 3 0 {name=m12 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 300 -1270 3 0 {name=m12 model=cmosp w=wp l=lp m=1 }
C {lab_pin.sym} 300 -1290 3 1 {name=p34 lab=VCC}
C {vdd.sym} 100 -1350 0 0 {name=l5 lab=VCC}
C {gnd.sym} 100 -1090 0 0 {name=l6 lab=GND}
C {n.sym} 650 -1170 3 1 {name=m13 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 650 -1170 3 1 {name=m13 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 650 -1150 1 1 {name=p35 lab=GND}
C {p.sym} 650 -1010 1 1 {name=m14 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 650 -1010 1 1 {name=m14 model=cmosp w=wp l=lp m=1 }
C {lab_pin.sym} 650 -1030 3 1 {name=p36 lab=VCC}
C {inv_2.sym} 740 -1220 0 1 {name=x19 VGND=VGND VNB=VNB VPB=VPB VPWR=VPWR prefix=sky130_fd_sc_hd__ }
C {n.sym} 650 -1430 3 1 {name=m15 model=cmosn w=wn l=lln m=1}
C {ntrans.sym} 650 -1430 3 1 {name=m15 model=cmosn w=wn l=lln m=1}
C {lab_pin.sym} 650 -1410 1 1 {name=p37 lab=GND}
C {p.sym} 650 -1270 1 1 {name=m16 model=cmosp w=wp l=lp m=1 }
C {ptrans.sym} 650 -1270 1 1 {name=m16 model=cmosp w=wp l=lp m=1 }
C {lab_pin.sym} 650 -1290 3 1 {name=p38 lab=VCC}
C {vdd.sym} 850 -1350 0 1 {name=l7 lab=VCC}
C {gnd.sym} 850 -1090 0 1 {name=l8 lab=GND}