doc updates (op backannotation)

This commit is contained in:
Stefan Frederik 2022-10-22 10:39:44 +02:00
parent cb652adb5f
commit edf33192a2
9 changed files with 103 additions and 90 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -72,59 +72,26 @@ lappend tcl_files ${XSCHEM_SHAREDIR}/ngspice_backannotate.tcl
You can close the simulator since we need only the <kbd>cmos_example.raw</kbd> file that is now saved
in the simulation directory (usually <kbd>~/.xschem/simulations/cmos_example.raw</kbd>).<br>
Now verify that xschem is able to read the raw file: issue this command in the xschem console:<br>
<kbd>ngspice::annotate</kbd>
<kbd>xschem annotate_op</kbd>
</p>
<pre class="code">
xschem [~] ngspice::annotate
Raw file read ...
xschem [~]
xschem [~] xschem annotate_op
Raw file data read: /home/schippes/.xschem/simulations/cmos_example.raw
points=1, vars=38, datasets=1
0
xschem [~]
</pre>
<p>
If there are no errors we are ready and set.
</p>
<h3> PUSH ANNOTATION METHOD </H3>
<h3> ANNOTATION </H3>
<p>
Start placing some probe elements into the schematic.
The first element is the <kbd>devices/spice_probe.sym</kbd> component. This must be attached to
some schematic wires to show the voltage value.
</p>
<img style="box-shadow:none;" src="backannotation4.png">
<p>
Place some of these elements on various nets, issue the above mentioned <kbd>ngspice::annotate</kbd>
command and see the voltage values in the schematic.
</p>
<img style="box-shadow:none;" src="backannotation5.png">
<p>
Another useful component is the <kbd>devices/ammeter.sym</kbd> one which allow to monitor branch currents.
Break some wires and insert this component as shown here:
</p>
<img style="box-shadow:none;" src="backannotation6.png">
<p class="important">
IMPORTANT: When inserting current probes the circuit topology changes (new nodes are created) so you need to
re-create the netlist and re-run the simulation
</p><br>
<p>
Doing again the <kbd>ngspice::annotate</kbd> command after simulation will update the ammeters showing
the branch currents.
</p>
<img style="box-shadow:none;" src="backannotation7.png">
<p>
These voltage and current values are inserted in the probe components as <b>attributes</b> and thus can be saved
to file. Remember that if you change the circuit the values shown in the probe elements are no longer valid,
you should update the values with a new simulation + annotate operation when done with the changes.<br><br>
What i have described so far is the simplest annotation procedure based on a <b>push</b> method: a tcl script
reads the simulation raw file and 'pushes' voltage and current values into the probe components as instance
attributes. If you do an edit attribute on one of these elements you see the attribute 'pushed' into it by the
annotate script. The advantage of this method is that values pushed into probes can be saved to file and are
thus persistent.
</p>
<img src="backannotation8.png">
<h3> PULL ANNOTATION METHOD </H3>
<p>
There is another annotation procedure that is based on a <b>pull</b> method: the probe objects have tcl commands
embedded that fetch simulation data from a table that has been read by the annotate script.
The annotation procedure is based on a <b>pull</b> method: the probe objects have atributes
or tcl commands
embedded that fetch simulation data from a table that has been read by Xschem.
In addition to specific probe elements also net labels will show voltage values and
ammeters / voltage sources will show currents.
</p>
<p>
@ -153,7 +120,9 @@ write cmos_example.raw
</p>
<img src="backannotation9.png">
<p>
Run again the simulation and the <kbd>ngspice::annotate</kbd> command and values will be updated.
Run again the simulation and the <kbd>xschem annotate_op</kbd> command and values will be updated.
If you enable <kbd>View -&gt; Show hidden texts</kbd> net labels, voltage sources and ammeters will also show
voltages and currents.
</p>
<img style="box-shadow:none;" src="backannotation10.png">
<p>
@ -164,7 +133,7 @@ write cmos_example.raw
<p>
Data annotated into the schematic using these components allows more simulation parameters to be viewed into
the schematic, not being restricted to currents and voltages. Since these components get data using a pull method
data is not persistent and not saved to file. After reloading the file just do a <kbd>ngspice::annotate</kbd>
data is not persistent and not saved to file. After reloading the file just do a <kbd>xschem annotate_op</kbd>
to view data again.
</p>

View File

@ -10,8 +10,8 @@ y1=1.16665
y2=5.05705
divy=4
subdivy=1
x1=2.3
x2=2.7
x1=2.28
x2=2.68
divx=6
subdivx=1
node="v(diffout)
@ -25,8 +25,8 @@ y1=0
y2=130
divy=4
subdivy=1
x1=2.3
x2=2.7
x1=2.28
x2=2.68
divx=6
subdivx=1
node="\\"GAIN;diffout deriv()\\""
@ -46,44 +46,84 @@ T {This is an example of a code block that will
be placed as a header in the netlist.
use 'place=header' attribute and set the
header text as a 'value' attribute} 440 -750 0 0 0.4 0.4 {}
N 30 -310 30 -280 {}
N 30 -310 60 -310 {}
N 260 -240 260 -190 {}
N 260 -190 300 -190 {}
N 300 -190 300 -160 {}
N 300 -160 530 -160 {}
N 500 -290 520 -290 {}
N 670 -290 690 -290 {}
N 500 -260 690 -260 {}
N 440 -290 460 -290 {}
N 730 -290 750 -290 {}
N 690 -490 740 -490 {}
N 450 -490 500 -490 {}
N 540 -490 650 -490 {}
N 540 -490 540 -460 {}
N 500 -460 540 -460 {}
N 690 -560 690 -520 {}
N 500 -560 690 -560 {}
N 500 -560 500 -520 {}
N 570 -580 570 -560 {}
N 690 -420 830 -420 {}
N 30 -440 30 -410 {}
N 30 -440 60 -440 {}
N 30 -590 30 -560 {}
N 30 -590 60 -590 {}
N 570 -130 570 -100 {}
N 570 -130 590 -130 {}
N 590 -160 590 -130 {}
N 570 -160 590 -160 {}
N 260 -130 260 -100 {}
N 240 -130 260 -130 {}
N 240 -160 240 -130 {}
N 240 -160 260 -160 {}
N 690 -460 690 -380 {}
N 500 -460 500 -380 {}
N 570 -260 570 -250 {}
N 500 -380 500 -320 {}
N 570 -250 570 -190 {}
N 30 -310 30 -280 {
lab=VCC}
N 30 -310 60 -310 {
lab=VCC}
N 260 -240 260 -190 {
lab=GN}
N 260 -190 300 -190 {
lab=GN}
N 300 -190 300 -160 {
lab=GN}
N 300 -160 530 -160 {
lab=GN}
N 500 -290 520 -290 {
lab=0}
N 670 -290 690 -290 {
lab=0}
N 500 -260 690 -260 {
lab=#net1}
N 440 -290 460 -290 {
lab=PLUS}
N 730 -290 750 -290 {
lab=MINUS}
N 690 -490 740 -490 {
lab=VCC}
N 450 -490 500 -490 {
lab=VCC}
N 540 -490 650 -490 {
lab=G}
N 540 -490 540 -460 {
lab=G}
N 500 -460 540 -460 {
lab=G}
N 690 -560 690 -520 {
lab=VCC}
N 500 -560 690 -560 {
lab=VCC}
N 500 -560 500 -520 {
lab=VCC}
N 570 -580 570 -560 {
lab=VCC}
N 690 -420 830 -420 {
lab=DIFFOUT}
N 30 -440 30 -410 {
lab=PLUS}
N 30 -440 60 -440 {
lab=PLUS}
N 30 -590 30 -560 {
lab=MINUS}
N 30 -590 60 -590 {
lab=MINUS}
N 570 -130 570 -100 {
lab=0}
N 570 -130 590 -130 {
lab=0}
N 590 -160 590 -130 {
lab=0}
N 570 -160 590 -160 {
lab=0}
N 260 -130 260 -100 {
lab=0}
N 240 -130 260 -130 {
lab=0}
N 240 -160 240 -130 {
lab=0}
N 240 -160 260 -160 {
lab=0}
N 690 -460 690 -400 {
lab=DIFFOUT}
N 500 -460 500 -380 {
lab=G}
N 570 -260 570 -250 {
lab=#net1}
N 500 -380 500 -320 {
lab=G}
N 570 -250 570 -190 {
lab=#net1}
N 690 -340 690 -320 {
lab=#net2}
C {lab_pin.sym} 750 -360 0 0 {name=p20 lab=0 net_name=true}
C {lab_pin.sym} 30 -220 0 0 {name=p17 lab=0 net_name=true}
C {title.sym} 160 -30 0 0 {name=l1 author="Stefan Schippers" net_name=true}
@ -1502,7 +1542,7 @@ AAAAAAAUQAAAAAAAAAAAsNOBK6VIGr83mZmZmZkFQAAAAAAAAAAALEMc6+I2Gj8ulnI1PmwuPwAAAAAA
qATYwoHxPgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPMYWeXiNho/AAAAAAAAAAAAAAAAAAAAAH/C5o3VGEA/AAAAAAAAAABoaaYTROgVPwAAAAAAAAAAAAAAAAAAAADz
CM4WDmYpPwAAAAAAAAAAgcd9hMKB8T4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLuyUYROgVPwAAAAAAAAAAAAAAAAAAAADEUmEID4QTQIWFPStEFwhAgE0obp729D8A
AAAAAAAEQK/MmE1vlvc/N5mZmZmZBUAAAAAAAAAAAAAAAAAAABRAAAAAAAAAAADsyD76tEgavw=="}
C {ammeter.sym} 690 -350 0 1 {name=Vmeas}
C {ammeter.sym} 690 -370 0 1 {name=Vmeas}
C {simulator_commands.sym} 920 -360 0 0 {name=COMMANDS
simulator=ngspice
only_toplevel=true
@ -1545,3 +1585,7 @@ value=".temp 30
.dc vplus 2.3 2.7 0.001
"}
C {ngspice_get_value.sym} 520 -310 0 0 {name=r6 node=i(@$\{path\}m4[id])
descr="I="}
C {ngspice_get_value.sym} 670 -310 0 1 {name=r7 node=i(@$\{path\}m5[id])
descr="I="}