diff --git a/doc/xschem_man/tutorial_ngspice_backannotation.html b/doc/xschem_man/tutorial_ngspice_backannotation.html index 729204a7..9246ac3c 100644 --- a/doc/xschem_man/tutorial_ngspice_backannotation.html +++ b/doc/xschem_man/tutorial_ngspice_backannotation.html @@ -48,18 +48,40 @@ lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl ** referenced file in netlist/simulation directory. .include "models_cmos_example.txt" .control - op - save all - write cmos_example.raw +op +save all +write cmos_example.raw .endc

The important parts are in red in above text. This ensures all variables are saved into the raw file. These instructions are for an interactive ngspice run.
+ You may have other simulations saved in the raw file (dc, tran, ac) however one operating point + must also be present: +

+ +
+.temp 30
+** models are generally not free: you must download
+** SPICE models for active devices and put them into the below
+** referenced file in netlist/simulation directory.
+.include "models_cmos_example.txt"
+.control
+save all
+dc vplus 2.3 2.7 0.001
+write cmos_example.raw
+set appendwrite
+op
+save all
+write cmos_example.raw
+.endc
+ 
+

When done open the Simulation-> Configure simulators and tools dialog box and ensure the Ngspice simulator is selected (not Ngspice batch). Also ensure the spice netlist mode is - selected (Options -> Spice netlist). + selected (Options -> Spice netlist).

+

SIMULATION

@@ -82,8 +104,12 @@ points=1, vars=38, datasets=1 xschem [~]

- If there are no errors we are ready and set. + If there are no errors we are ready and set.
+ you can load also a specific file:

+
+xschem [~] xschem annotate_op $netlist_dir/cmos_example_ngspice.raw
+ 

ANNOTATION

@@ -93,7 +119,6 @@ xschem [~] In addition to specific probe elements also net labels will show voltage values and ammeters / voltage sources will show currents.

-

To ensure all currents are saved modify the STIMULI attributes as follows:

@@ -121,8 +146,6 @@ write cmos_example.raw

Run again the simulation and the xschem annotate_op command and values will be updated. - If you enable View -> Show hidden texts net labels, voltage sources and ammeters will also show - voltages and currents.

diff --git a/scconfig/src/default/find_cc.c b/scconfig/src/default/find_cc.c index 986007e1..bccadbed 100644 --- a/scconfig/src/default/find_cc.c +++ b/scconfig/src/default/find_cc.c @@ -933,11 +933,13 @@ static int try_dll_or_so(int logdepth, int is_dll, const char *lib_ldflags, cons lib_filename = file_name(libname); lib_dirname = dir_name(libname); + len = strlen(lib_filename) - strlen(libname_ext); if (!is_dll) { - len = strlen(lib_filename) - strlen(libname_ext); for (ii=3; ii" NL "#include " - NL "#include " NL "int main(int argc, char *argv[]) {" NL " WIN32_FIND_DATA fd;" NL " HANDLE h;" @@ -156,7 +155,7 @@ int find_fs_findnextfile(const char *name, int logdepth, int fatal) logprintf(logdepth, "find_fs_findnextfile: trying to find FindNextFile...\n"); logdepth++; - if (try_icl(logdepth, "libs/fs/findnextfile", test_c, NULL, NULL, NULL)) return 0; + if (try_icl(logdepth, "libs/fs/findnextfile", test_c, "#include ", NULL, NULL)) return 0; return try_fail(logdepth, "libs/fs/findnextfile"); } diff --git a/xschem_library/examples/cmos_example.sch b/xschem_library/examples/cmos_example.sch index ea771f99..b98f5fd6 100644 --- a/xschem_library/examples/cmos_example.sch +++ b/xschem_library/examples/cmos_example.sch @@ -162,7 +162,7 @@ device="ceramic capacitor" net_name=true} C {lab_pin.sym} 500 -430 0 0 {name=p12 lab=G net_name=true} C {launcher.sym} 700 -60 0 0 {name=h1 descr=Backannotate -tclcommand="xschem annotate_op"} +tclcommand="xschem annotate_op $\{netlist_dir\}/cmos_example_ngspice.raw"} C {launcher.sym} 700 -110 0 0 {name=h2 descr="View raw file" tclcommand="textwindow $netlist_dir/cmos_example.raw"} @@ -1558,6 +1558,7 @@ value=".temp 30 save all op write cmos_example_ngspice.raw +set appendwrite * tran 1n 300n dc vplus 2.3 2.7 0.001 write cmos_example_ngspice.raw