persistent load file dialog (Shift-Insert) now correctly handles generator script selection (do nothing until user adds () or (param1,param2,...) to generator name).
This commit is contained in:
parent
ee7dc8982a
commit
9593d41f09
|
|
@ -351,6 +351,18 @@
|
|||
<Component Id="cmp8C7AB373FA963AF5F88C8B394FB28B19" Guid="{2769EF54-5FCC-4F01-8EF9-38FB088B49AD}">
|
||||
<File Id="fil4477B2695680604C6F6AA9F5E0E2FFB1" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\install_xschem.html" />
|
||||
</Component>
|
||||
<Component Id="cmp9D7115210A8866197FB4C7594E7CB7CF" Guid="{7FE310DA-ED92-4A55-9B92-A30280B91E70}">
|
||||
<File Id="fil2F1C2868A0660CBF692C20795D28F0B6" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\instance_based_implementation_01.png" />
|
||||
</Component>
|
||||
<Component Id="cmp72EFAE4CB2B8A2B5ED8A785D4C565C68" Guid="{A66CD465-8088-45EB-B1F7-BD59967302F4}">
|
||||
<File Id="fil9673B620CC067BC8BC1EAB6F89B58DC5" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\instance_based_implementation_02.png" />
|
||||
</Component>
|
||||
<Component Id="cmp5C04C95A67E090E0421B204F319D4216" Guid="{31D7ED34-DAB4-4A63-B97F-8655506E7DCB}">
|
||||
<File Id="fil2B3AB07BDBC11B1A8D30C3F688474716" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\instance_based_implementation_03.png" />
|
||||
</Component>
|
||||
<Component Id="cmpE415804152519EC8DE1A4531549F43A1" Guid="{2492BED0-6AB2-4FA7-BD75-85B29A2226C1}">
|
||||
<File Id="fil257D69C3B519AEDA7869DB9500C1FE75" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\instance_based_implementation_04.png" />
|
||||
</Component>
|
||||
<Component Id="cmp2DB8618704C7034B543BD78F8410CB70" Guid="{83F8DFAB-5FFC-4D6C-9CCD-89BF2D9D4B1F}">
|
||||
<File Id="filABBDDFFF90735804749ED6C5727372C5" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\load_schematic.png" />
|
||||
</Component>
|
||||
|
|
@ -531,6 +543,15 @@
|
|||
<Component Id="cmp80D71431189149660F707A733ED9DC48" Guid="{90281885-9FA3-4F22-9AD5-8438D1C6439F}">
|
||||
<File Id="fil357970DD2C11943DF6420EF42642EB1C" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\symbol_generation6.png" />
|
||||
</Component>
|
||||
<Component Id="cmp14C7D96F77333525B6BDFBCBF7AB9CA3" Guid="{E555176E-5B03-4920-A358-3A73343EBB38}">
|
||||
<File Id="fil769446F0F3B253C5050DCAB87CCDDD41" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\symbol_generators01.png" />
|
||||
</Component>
|
||||
<Component Id="cmpDE7F31AEB44A68034AA9A9FC61A10273" Guid="{861E66CE-CFCC-4F94-A8F2-2762F3FD4381}">
|
||||
<File Id="fil6ADBC78007047FC155237D4ACC26C98B" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\symbol_generators02.png" />
|
||||
</Component>
|
||||
<Component Id="cmp64456081A2F7796762FBF32E72BD32E8" Guid="{897DEC28-7F63-4B78-BAA1-3040A8ECBDB6}">
|
||||
<File Id="fil3BCC9EA97E466FEBC43573FD37F99938" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\symbol_generators03.png" />
|
||||
</Component>
|
||||
<Component Id="cmp4E173EB8A7B4151CF229043A306A5618" Guid="{90058AB6-91F5-42D9-AF76-51C4762A780B}">
|
||||
<File Id="filCA3BA0C82FEE664384F4C8ADA0482FE9" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\symbol_properties1.png" />
|
||||
</Component>
|
||||
|
|
@ -660,6 +681,9 @@
|
|||
<Component Id="cmp985E62F77AD4CAB5BAD58A8FB1DDE01C" Guid="{1E33007E-8EFC-4088-92CB-F9345AD1E259}">
|
||||
<File Id="filCE8F73D37564708A2A7577F6572AB436" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_install_xschem_10.png" />
|
||||
</Component>
|
||||
<Component Id="cmp1FDDA235D8F5FB7FE4A87DB567130688" Guid="{E1133E6A-1E30-4BE3-BDE6-2858634D90C5}">
|
||||
<File Id="fil69F1DF47B740420085B90CDA4B817E6E" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_instance_based_implementation.html" />
|
||||
</Component>
|
||||
<Component Id="cmpE446C6E6AE8E31BAB020041B768CE39F" Guid="{1CA6FEE9-B22D-4CCF-8D4A-C0D0EB1BE429}">
|
||||
<File Id="fil053FE6DA638A1B0E61F3A31E35D7802F" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_ngspice_backannotation.html" />
|
||||
</Component>
|
||||
|
|
@ -696,6 +720,9 @@
|
|||
<Component Id="cmpF6C3D9737087F3D9B2228B21C6734980" Guid="{5D6112F2-6700-4D32-93BF-6CA9CFAAAB7B}">
|
||||
<File Id="fil4FA1C5C00C93E9729B1D42AAF2DC8786" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_run_simulation_10.png" />
|
||||
</Component>
|
||||
<Component Id="cmp774E63A5CA21989193C0A5221E254967" Guid="{A302D953-7497-4B1A-871F-95066D0CD928}">
|
||||
<File Id="fil26E89D7E68D72A1CB270E2D55FE2FE46" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_symbol_generators.html" />
|
||||
</Component>
|
||||
<Component Id="cmpA1AF34A5AB0E46E83E2489246BC02E35" Guid="{D505CB00-A64B-427C-AFE8-B00A08538225}">
|
||||
<File Id="filAE2DADB4EC5D12FB0073EC1A86C9BB29" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\tutorial_symgen.html" />
|
||||
</Component>
|
||||
|
|
@ -1100,6 +1127,10 @@
|
|||
<ComponentRef Id="cmp7D84114D6FDF0E09CB66A982B3C581C3" />
|
||||
<ComponentRef Id="cmpDB80566B13B66B2A92E91DA0585404A9" />
|
||||
<ComponentRef Id="cmp8C7AB373FA963AF5F88C8B394FB28B19" />
|
||||
<ComponentRef Id="cmp9D7115210A8866197FB4C7594E7CB7CF" />
|
||||
<ComponentRef Id="cmp72EFAE4CB2B8A2B5ED8A785D4C565C68" />
|
||||
<ComponentRef Id="cmp5C04C95A67E090E0421B204F319D4216" />
|
||||
<ComponentRef Id="cmpE415804152519EC8DE1A4531549F43A1" />
|
||||
<ComponentRef Id="cmp2DB8618704C7034B543BD78F8410CB70" />
|
||||
<ComponentRef Id="cmp8A2095B0FF09EA0F68B73AAAC60EA69B" />
|
||||
<ComponentRef Id="cmp97047CA23E73FCF9A2A774BE2B268856" />
|
||||
|
|
@ -1160,6 +1191,9 @@
|
|||
<ComponentRef Id="cmp7361D09B42DD785D86E85494B40CB7E5" />
|
||||
<ComponentRef Id="cmpFD4E64677B8277F8F66B179CC7D77CBF" />
|
||||
<ComponentRef Id="cmp80D71431189149660F707A733ED9DC48" />
|
||||
<ComponentRef Id="cmp14C7D96F77333525B6BDFBCBF7AB9CA3" />
|
||||
<ComponentRef Id="cmpDE7F31AEB44A68034AA9A9FC61A10273" />
|
||||
<ComponentRef Id="cmp64456081A2F7796762FBF32E72BD32E8" />
|
||||
<ComponentRef Id="cmp4E173EB8A7B4151CF229043A306A5618" />
|
||||
<ComponentRef Id="cmpB389126DA86CA574DE924B2998CB8630" />
|
||||
<ComponentRef Id="cmp6D2ED59DF2340D1122FD7F1D589EF887" />
|
||||
|
|
@ -1203,6 +1237,7 @@
|
|||
<ComponentRef Id="cmp710F4F002ED6F6CB0E9862784C453AF1" />
|
||||
<ComponentRef Id="cmp651906A147E90D0C461D5C5590A9A51D" />
|
||||
<ComponentRef Id="cmp985E62F77AD4CAB5BAD58A8FB1DDE01C" />
|
||||
<ComponentRef Id="cmp1FDDA235D8F5FB7FE4A87DB567130688" />
|
||||
<ComponentRef Id="cmpE446C6E6AE8E31BAB020041B768CE39F" />
|
||||
<ComponentRef Id="cmp15745350561238600071BBE2E3F27222" />
|
||||
<ComponentRef Id="cmp52C11CD4D51DFF7449A091F7881DA4B1" />
|
||||
|
|
@ -1215,6 +1250,7 @@
|
|||
<ComponentRef Id="cmpF30BEF86E910B592533E88B56DEEF496" />
|
||||
<ComponentRef Id="cmpB914BD58B465D9996191A52C41981288" />
|
||||
<ComponentRef Id="cmpF6C3D9737087F3D9B2228B21C6734980" />
|
||||
<ComponentRef Id="cmp774E63A5CA21989193C0A5221E254967" />
|
||||
<ComponentRef Id="cmpA1AF34A5AB0E46E83E2489246BC02E35" />
|
||||
<ComponentRef Id="cmp89BE8EF1B2B36CB950714E6DDEC886BB" />
|
||||
<ComponentRef Id="cmp24AB399EEF91852024CB83CD0A4EF749" />
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -658,8 +658,23 @@
|
|||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir0E49847221518A8EA1A21E5E7C2A0013" Name="generators">
|
||||
<Component Id="cmpA3A8C99756B5494DF212791423946D83" Guid="{36014B23-7000-4768-9D74-140CFCD1DF1B}">
|
||||
<File Id="fil04CAE669A88A44DBB23F914651373D6E" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\gen1.awk" />
|
||||
<Component Id="cmp32465EBB4792AC111E037BC93352D608" Guid="{AF168DB3-7773-4827-9440-A66CE3EC0377}">
|
||||
<File Id="fil2394C46591EC087671BABBB84C6A7A38" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\my_inv.sch" />
|
||||
</Component>
|
||||
<Component Id="cmp2FDFB818395E2338E0060D6F28271CE7" Guid="{D5ECCD09-F9EF-49DD-A580-ACA7C412F655}">
|
||||
<File Id="filDCFDB550B6C29A336880A1572644E706" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\my_inv.sym" />
|
||||
</Component>
|
||||
<Component Id="cmpD694720EA8D2EEE4E58970628CFBC57A" Guid="{4A19C027-6F09-49E0-882B-B2CEE0CC6AF4}">
|
||||
<File Id="fil04A857FE7499CAB218B6B6842FC16201" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\schematicgen" />
|
||||
</Component>
|
||||
<Component Id="cmp58DEF4BE570C94119EE2C3392A79729E" Guid="{4E5077D3-9AD2-4B60-927E-189B490B39BB}">
|
||||
<File Id="filE5921602E7E3F12690CF1D1BD574EFD9" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\symbolgen" />
|
||||
</Component>
|
||||
<Component Id="cmp564B680048CCEDCA705AB3D245A19E30" Guid="{B9DEB694-0240-4CA7-A71A-539F16C39DE4}">
|
||||
<File Id="filC194343F1D6B4EE6B4AF35363CDA35E4" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\test_symbolgen.sch" />
|
||||
</Component>
|
||||
<Component Id="cmpB218B4D54FEA02DE77E9B9650F18D0C6" Guid="{77B96C8E-BAE3-4359-ACF4-C9153C03B9EA}">
|
||||
<File Id="filBC497F0A745564CF36911A229B6B453D" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\generators\test_symbolgen.sym" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dirC2FFADF72B5C7D98118119748AE42242" Name="gschem_import">
|
||||
|
|
@ -4770,6 +4785,29 @@
|
|||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="dir66E75AF8489D831CEE96A9484F188CC0" Name="inst_sch_select">
|
||||
<Component Id="cmp7FA1B8D455F612D245224AC7EAF95A6C" Guid="{451D1C93-06A3-4119-8130-4C8A555766BA}">
|
||||
<File Id="filF84E499EC377EDCE3CEC8BD8D987A15D" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\comp_65nm.sch" />
|
||||
</Component>
|
||||
<Component Id="cmpA694725AC90906B120BC6ED052B820EC" Guid="{7DB0DC5B-5605-49D5-839A-38AD5C39E087}">
|
||||
<File Id="filF3BF35891CD9065B7BAE81514DB651B3" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\comp_65nm.sym" />
|
||||
</Component>
|
||||
<Component Id="cmp9F68EB0D01C258AFF8A160616F017CC6" Guid="{29EF4B4F-220A-4D20-B658-30D434F9F822}">
|
||||
<File Id="fil5132E7C32EBFF52214702F73D3936B0E" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\comp_65nm_empty.sch" />
|
||||
</Component>
|
||||
<Component Id="cmpC49759288BFBD4977B75C3C2666BFB1A" Guid="{FF1F79F9-1969-4BEE-A84D-541459AFDD9C}">
|
||||
<File Id="filEEC392331868D39BCF38F222B0F0BDE2" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\comp_65nm_file.cir" />
|
||||
</Component>
|
||||
<Component Id="cmp192C74207CA975756F65616672478110" Guid="{3706C5AD-C104-494A-B664-DEB07667A8B3}">
|
||||
<File Id="filF6591742485594FADE7363F8CB7C10F7" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\comp_65nm_parax.sch" />
|
||||
</Component>
|
||||
<Component Id="cmp8907B142997C1E0613C32A1C536C5122" Guid="{955C050B-2D41-42AC-A988-92A33E682F4E}">
|
||||
<File Id="fil31820620336E6D619A3D1A05DBB16AB7" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\inst_sch_select.sch" />
|
||||
</Component>
|
||||
<Component Id="cmp17EC96974E9D7222C8BAD002E8B6A792" Guid="{1FA12206-7FD4-410C-8777-576F16C20660}">
|
||||
<File Id="filC645184C32A43605586C0A08A0F7C090" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\inst_sch_select\inst_sch_select.sym" />
|
||||
</Component>
|
||||
</Directory>
|
||||
<Directory Id="dir3668575F6014E6A92C7235870346AFD6" Name="logic">
|
||||
<Component Id="cmp9B1CE895DCA915D6CEFBA5A5D4D37400" Guid="{CBF63ED8-D043-4D5E-8879-9050731F857F}">
|
||||
<File Id="filAB5FEC1CABE5893BF61A29D2052CEE86" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\logic\bf.sch" />
|
||||
|
|
@ -5661,7 +5699,12 @@
|
|||
<ComponentRef Id="cmp30D416247CB7868426C9E8075767CD1A" />
|
||||
<ComponentRef Id="cmpB573F1750B3939F980B65D02B78EE0E3" />
|
||||
<ComponentRef Id="cmp07A884BAD56D6B1718967173C498C3C3" />
|
||||
<ComponentRef Id="cmpA3A8C99756B5494DF212791423946D83" />
|
||||
<ComponentRef Id="cmp32465EBB4792AC111E037BC93352D608" />
|
||||
<ComponentRef Id="cmp2FDFB818395E2338E0060D6F28271CE7" />
|
||||
<ComponentRef Id="cmpD694720EA8D2EEE4E58970628CFBC57A" />
|
||||
<ComponentRef Id="cmp58DEF4BE570C94119EE2C3392A79729E" />
|
||||
<ComponentRef Id="cmp564B680048CCEDCA705AB3D245A19E30" />
|
||||
<ComponentRef Id="cmpB218B4D54FEA02DE77E9B9650F18D0C6" />
|
||||
<ComponentRef Id="cmp93CCC992DFDB8670EC1762AF056E9A71" />
|
||||
<ComponentRef Id="cmp0B11FB04799ACF558B70C4BCB047090B" />
|
||||
<ComponentRef Id="cmpE6B72E17713734939AF051305C56B340" />
|
||||
|
|
@ -7030,6 +7073,13 @@
|
|||
<ComponentRef Id="cmp17B3126A87BE08784E2F6F45E02C384B" />
|
||||
<ComponentRef Id="cmpF7EBB80CBCB3911C75082F4AB3A6FBC7" />
|
||||
<ComponentRef Id="cmpAE952C594E6F45CF215B573DD54FA856" />
|
||||
<ComponentRef Id="cmp7FA1B8D455F612D245224AC7EAF95A6C" />
|
||||
<ComponentRef Id="cmpA694725AC90906B120BC6ED052B820EC" />
|
||||
<ComponentRef Id="cmp9F68EB0D01C258AFF8A160616F017CC6" />
|
||||
<ComponentRef Id="cmpC49759288BFBD4977B75C3C2666BFB1A" />
|
||||
<ComponentRef Id="cmp192C74207CA975756F65616672478110" />
|
||||
<ComponentRef Id="cmp8907B142997C1E0613C32A1C536C5122" />
|
||||
<ComponentRef Id="cmp17EC96974E9D7222C8BAD002E8B6A792" />
|
||||
<ComponentRef Id="cmp9B1CE895DCA915D6CEFBA5A5D4D37400" />
|
||||
<ComponentRef Id="cmpF9947E906DDED663C2C821472A297896" />
|
||||
<ComponentRef Id="cmp1AB0B7735659D3625B964D55B764AF38" />
|
||||
|
|
|
|||
|
|
@ -579,6 +579,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
attribute. </pre>
|
||||
<li><kbd> enable_layers</kbd></li><pre>
|
||||
Enable/disable layers depending on tcl array variable enable_layer() </pre>
|
||||
<li><kbd> escape_chars source</kbd></li><pre>
|
||||
escape tcl special characters with backslash </pre>
|
||||
<li><kbd> exit</kbd></li><pre>
|
||||
Exit the program, ask for confirm if current file modified. </pre>
|
||||
<li><kbd> expandlabel lab</kbd></li><pre>
|
||||
|
|
@ -640,6 +642,10 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
<li><kbd> yorigin </kbd> y coordinate of origin </li>
|
||||
<li><kbd> zoom </kbd> zoom level </li>
|
||||
</ul>
|
||||
<li><kbd> get_cell cell n_dirs</kbd></li><pre>
|
||||
return result of get_cell function </pre>
|
||||
<li><kbd> get_cell_w_ext cell n_dirs</kbd></li><pre>
|
||||
return result of get_cell_w_ext function </pre>
|
||||
<li><kbd> getprop instance|instance_pin|symbol|text ref </kbd></li><pre>
|
||||
|
||||
getprop instance inst
|
||||
|
|
@ -748,6 +754,8 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
Example: xschem instances_to_net PANEL
|
||||
--> { {Vsw} {plus} {580} {-560} } { {p2} {p} {660} {-440} }
|
||||
{ {Vpanel1} {minus} {600} {-440} } </pre>
|
||||
<li><kbd> is_symgen symbol</kbd></li><pre>
|
||||
tell if 'symbol' is agenerator (symbol(param1,param2,...) </pre>
|
||||
<li><kbd> line x1 y1 x2 y2 [pos]</kbd></li><pre>
|
||||
Place a line on current layer (rectcolor)
|
||||
if integer number 'pos' is given place line at indicated
|
||||
|
|
@ -1163,7 +1171,6 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- TCL global variables -->
|
||||
|
|
|
|||
|
|
@ -1874,7 +1874,7 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
|||
}
|
||||
if((key==XK_Insert && (state & ShiftMask)) || (key == 'i' && state == ControlMask)) /* insert sym */
|
||||
{
|
||||
tcleval("load_file_dialog {Insert symbol} *.sym INITIALINSTDIR 2");
|
||||
tcleval("load_file_dialog {Insert symbol} {} INITIALINSTDIR 2");
|
||||
break;
|
||||
}
|
||||
if(key==XK_Insert || (key == 'I' && state == ShiftMask) ) /* insert sym */
|
||||
|
|
|
|||
|
|
@ -3168,7 +3168,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
generator = is_generator(cmd);
|
||||
if(generator) {
|
||||
cmd = get_generator_command(cmd);
|
||||
dbg(1, "l_s_d(): cmd=%s\n", cmd);
|
||||
dbg(1, "l_s_d(): generator: cmd=%s\n", cmd);
|
||||
if(cmd) {
|
||||
lcc[level].fd = popen(cmd, "r"); /* execute ss="/path/to/xxx par1 par2 ..." and pipe in the stdout */
|
||||
my_free(_ALLOC_ID_, &cmd);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@
|
|||
#define xunlink unlink
|
||||
#define xfseek fseek
|
||||
#define xftell ftell
|
||||
#define popen popen
|
||||
#define pclose pclose
|
||||
#else
|
||||
#include <tkWinInt.h>
|
||||
#define xunlink _unlink
|
||||
|
|
@ -100,6 +102,8 @@ extern void change_to_unix_fn(char* fn);
|
|||
extern char win_temp_dir[PATH_MAX];
|
||||
#define xfseek _fseeki64
|
||||
#define xftell _ftelli64
|
||||
#define popen _popen
|
||||
#define pclose _pclose
|
||||
#endif
|
||||
|
||||
#undef HAS_XCB
|
||||
|
|
|
|||
|
|
@ -2378,15 +2378,20 @@ proc is_xschem_file {f} {
|
|||
set score 0
|
||||
set instances 0
|
||||
set nline 0
|
||||
set generator 0
|
||||
if {$a} {
|
||||
puts stderr "Can not open file $f"
|
||||
} else {
|
||||
fconfigure $fd -translation binary
|
||||
while { [gets $fd line] >=0 } {
|
||||
# this is a script. not an xschem file
|
||||
if { $nline == 0 && [regexp {^#!} $line] } {
|
||||
set ret GENERATOR
|
||||
break
|
||||
} ;# this is a script. not an xschem file
|
||||
#### too dangerous executing an arbitrary script...
|
||||
# close $fd
|
||||
# set fd [open "|$f"]
|
||||
set generator 1
|
||||
# continue
|
||||
}
|
||||
if { [regexp {^[TKGVSE] \{} $line] } { incr score }
|
||||
if { [regexp {^[BL] +[0-9]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +\{} $line] } {incr score}
|
||||
if { [regexp {^N +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +[-0-9.eE]+ +\{} $line] } {incr score}
|
||||
|
|
@ -2397,7 +2402,9 @@ proc is_xschem_file {f} {
|
|||
incr nline
|
||||
}
|
||||
if { $score > 4 } { set ret 1} ;# Heuristic decision :-)
|
||||
if { $ret ne {0} && $ret ne {GENERATOR}} {
|
||||
if {$generator eq {1}} {
|
||||
set ret GENERATOR
|
||||
} elseif { $ret ne {0}} {
|
||||
if { $instances} {
|
||||
set ret SCHEMATIC
|
||||
} else {
|
||||
|
|
@ -2644,14 +2651,28 @@ proc myload_getresult {loadfile confirm_overwrt} {
|
|||
}
|
||||
set type [is_xschem_file "$fname"]
|
||||
if { $type eq {0} || $type eq {GENERATOR} } {
|
||||
set answer [
|
||||
alert_ "$fname does not seem to be an xschem file...\nContinue?" {} 0 1]
|
||||
if { $type eq {0} } {
|
||||
set answer [alert_ "$fname does not seem to be an xschem file...\nContinue?" {} 0 1]
|
||||
} else { ;# $type == GENERATOR
|
||||
set answer 1
|
||||
}
|
||||
if { $answer eq {0}} {
|
||||
set myload_retval {}
|
||||
return {}
|
||||
} else {
|
||||
return "$fname"
|
||||
} else { ;# $answer == 1
|
||||
if { $type eq {GENERATOR} } {
|
||||
if { [regexp {\([^()]*\)$} $fname]} {
|
||||
return "$fname"
|
||||
} else {
|
||||
set myload_retval {}
|
||||
return {}
|
||||
}
|
||||
}
|
||||
# $type == 0 so return empty string
|
||||
set myload_retval {}
|
||||
return {}
|
||||
}
|
||||
# $type == SYMBOL or SCHEMATIC
|
||||
} elseif { $type ne {SYMBOL} && ($myload_ext eq {*.sym}) } { ;# SCHEMATIC
|
||||
set answer [
|
||||
alert_ "$fname does not seem to be a SYMBOL file...\nContinue?" {} 0 1]
|
||||
|
|
|
|||
Loading…
Reference in New Issue