diff --git a/src/spice_netlist.c b/src/spice_netlist.c index a9719fda..647cef6d 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -227,6 +227,10 @@ void global_spice_netlist(int global) /* netlister driver */ tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); dbg(1, "global_spice_netlist(): opening %s for writing\n",netl_filename); fd=fopen(netl_filename, "w"); + if(fd==NULL) { + dbg(0, "global_spice_netlist(): problems opening netlist file\n"); + return; + } fprintf(fd, "** sch_path: %s\n", xctx->sch[xctx->currsch]); if(xctx->netlist_name[0]) { @@ -234,10 +238,6 @@ void global_spice_netlist(int global) /* netlister driver */ } else { my_snprintf(cellname, S(cellname), "%s.spice", skip_dir(xctx->sch[xctx->currsch])); } - if(fd==NULL) { - dbg(0, "global_spice_netlist(): problems opening netlist file\n"); - return; - } first = 0; for(i=0;iinstances;i++) /* print netlist_commands of top level cell with 'place=header' property */ { diff --git a/src/tedax_netlist.c b/src/tedax_netlist.c index 0fe85d1a..9a8751e1 100644 --- a/src/tedax_netlist.c +++ b/src/tedax_netlist.c @@ -147,6 +147,10 @@ void global_tedax_netlist(int global) /* netlister driver */ my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); fd=fopen(netl_filename, "w"); + if(fd==NULL){ + dbg(0, "global_tedax_netlist(): problems opening netlist file\n"); + return; + } fprintf(fd, "## sch_path: %s\n", xctx->sch[xctx->currsch]); if(xctx->netlist_name[0]) { @@ -155,10 +159,6 @@ void global_tedax_netlist(int global) /* netlister driver */ my_snprintf(cellname, S(cellname), "%s.tdx", skip_dir(xctx->sch[xctx->currsch])); } - if(fd==NULL){ - dbg(0, "global_tedax_netlist(): problems opening netlist file\n"); - return; - } /* netlist_options */ for(i=0;iinstances;i++) { if(!(xctx->inst[i].ptr+ xctx->sym)->type) continue; diff --git a/src/verilog_netlist.c b/src/verilog_netlist.c index 4cdb34ef..d91f811d 100644 --- a/src/verilog_netlist.c +++ b/src/verilog_netlist.c @@ -103,6 +103,10 @@ void global_verilog_netlist(int global) /* netlister driver */ my_snprintf(netl_filename, S(netl_filename), "%s/.%s_%d", tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]),getpid()); fd=fopen(netl_filename, "w"); + if(fd==NULL){ + dbg(0, "global_verilog_netlist(): problems opening netlist file\n"); + return; + } fprintf(fd, "// sch_path: %s\n", xctx->sch[xctx->currsch]); if(xctx->netlist_name[0]) { @@ -111,10 +115,6 @@ void global_verilog_netlist(int global) /* netlister driver */ my_snprintf(cellname, S(cellname), "%s.v", skip_dir(xctx->sch[xctx->currsch])); } - if(fd==NULL){ - dbg(0, "global_verilog_netlist(): problems opening netlist file\n"); - return; - } dbg(1, "global_verilog_netlist(): opening %s for writing\n",netl_filename); diff --git a/src/vhdl_netlist.c b/src/vhdl_netlist.c index 4c0af20d..e8fc8008 100644 --- a/src/vhdl_netlist.c +++ b/src/vhdl_netlist.c @@ -143,6 +143,10 @@ void global_vhdl_netlist(int global) /* netlister driver */ tclgetvar("netlist_dir"), skip_dir(xctx->sch[xctx->currsch]), getpid()); fd=fopen(netl_filename, "w"); + if(fd==NULL){ + dbg(0, "global_vhdl_netlist(): problems opening netlist file\n"); + return; + } fprintf(fd, "-- sch_path: %s\n", xctx->sch[xctx->currsch]); if(xctx->netlist_name[0]) { @@ -151,10 +155,6 @@ void global_vhdl_netlist(int global) /* netlister driver */ my_snprintf(cellname, S(cellname), "%s.vhdl", skip_dir(xctx->sch[xctx->currsch])); } - if(fd==NULL){ - dbg(0, "global_vhdl_netlist(): problems opening netlist file\n"); - return; - } dbg(1, "global_vhdl_netlist(): opening %s for writing\n",netl_filename); dbg(1, "global_vhdl_netlist(): printing top level packages\n"); diff --git a/xschem_library/examples/poweramp.sch b/xschem_library/examples/poweramp.sch index 7c87c9d9..3e8be280 100644 --- a/xschem_library/examples/poweramp.sch +++ b/xschem_library/examples/poweramp.sch @@ -18,8 +18,8 @@ B 2 1200 -500 1880 -310 {flags=graph y1 = -0.0059 y2 = 11 divy = 6 -x1=0.0365975 -x2=0.0372189 +x1=0.0119263 +x2=0.0123791 divx=10 node="i(v.x1.vu) i(v.x0.vu) @@ -31,8 +31,8 @@ B 2 1200 -830 1880 -520 {flags=graph y1 = -49 y2 = 59 divy = 12 -x1=0.0365975 -x2=0.0372189 +x1=0.0119263 +x2=0.0123791 divx=10 node="outp outm @@ -46,21 +46,21 @@ B 2 1200 -1020 1880 -830 {flags=graph y1 = 2.4e-11 y2 = 840 divy = 6 -x1=0.0365975 -x2=0.0372189 +x1=0.0119263 +x2=0.0123791 divx=10 unitx=m color="4 7" node="\\"supply power;i(vcurrvnn) vnn * i(vcurrvpp) vpp * +\\" -\\"running average supply power;i(vcurrvnn) vnn * i(vcurrvpp) vpp * + 1e-4 ravg()\\""} +\\"running average supply power;i(vcurrvnn) vnn * i(vcurrvpp) vpp * + 1.0e-4 ravg()\\""} B 2 1200 -310 1880 -120 {flags=graph y1 = 0.0077 y2 = 850 divy = 6 -x1=0.0365975 -x2=0.0372189 +x1=0.0119263 +x2=0.0123791 divx=10