create bgr information

This commit is contained in:
PhillipRambo 2024-12-02 16:17:08 +01:00
parent 6c3fb8a2b6
commit 5a72ef626f
7 changed files with 529 additions and 0 deletions

View File

@ -0,0 +1,153 @@
v {xschem version=3.4.5 file_version=1.2
}
G {}
K {}
V {}
S {}
E {}
N 270 -480 500 -480 {
lab=#net1}
N 540 -480 550 -480 {
lab=vdd}
N 550 -510 550 -480 {
lab=vdd}
N 540 -510 550 -510 {
lab=vdd}
N 500 -480 500 -470 {
lab=#net1}
N 500 -470 740 -470 {
lab=#net1}
N 740 -480 740 -470 {
lab=#net1}
N 230 -530 230 -480 {
lab=vdd}
N 540 -530 780 -530 {
lab=vdd}
N 780 -530 780 -480 {
lab=vdd}
N 540 -530 540 -510 {
lab=vdd}
N 230 -530 540 -530 {
lab=vdd}
N 780 -450 780 -410 {
lab=VBG}
N 780 -410 870 -410 {
lab=VBG}
N 780 -410 780 -380 {
lab=VBG}
N 780 -530 870 -530 {
lab=vdd}
N 540 -450 540 -280 {
lab=#net2}
N 430 -280 540 -280 {
lab=#net2}
N 230 -280 350 -280 {
lab=#net3}
N 230 -450 230 -280 {
lab=#net3}
N 230 -280 230 -160 {
lab=#net3}
N 140 -280 230 -280 {
lab=#net3}
N 140 -220 140 -200 {
lab=GND}
N 780 -320 780 -300 {
lab=GND}
N 540 -280 640 -280 {
lab=#net2}
N 640 -220 640 -200 {
lab=GND}
N 540 -220 540 -160 {
lab=#net4}
N 230 -100 230 -70 {
lab=GND}
N 190 -130 190 -70 {
lab=GND}
N 500 -130 500 -70 {
lab=GND}
N 540 -100 540 -70 {
lab=GND}
C {sg13g2_pr/sg13_lv_pmos.sym} 250 -480 0 1 {name=M3
l=0.6u
w=65u
ng=8
m=1
model=sg13_lv_pmos
spiceprefix=X
}
C {sg13g2_pr/sg13_lv_pmos.sym} 520 -480 0 0 {name=M4
l=0.6u
w=65u
ng=8
m=1
model=sg13_lv_pmos
spiceprefix=X
}
C {/home/pedersen/projects/IHP-AnalogAcademy/modules/module_1_bandgap_reference/part_2_full_bgr/schematic/verilog/veriloga_tbs/diff_amp.sym} 390 -380 1 1 {name=U1 model=diff_amp_cell spiceprefix=X}
C {sg13g2_pr/sg13_lv_pmos.sym} 760 -480 0 0 {name=M5
l=0.6u
w=65u
ng=8
m=1
model=sg13_lv_pmos
spiceprefix=X
}
C {opin.sym} 870 -410 0 0 {name=p1 lab=VBG}
C {res.sym} 780 -350 0 0 {name=R4
value=16k
footprint=1206
device=resistor
m=1}
C {lab_pin.sym} 870 -530 0 1 {name=p2 sig_type=std_logic lab=vdd}
C {res.sym} 140 -250 0 0 {name=R3
value=45k
footprint=1206
device=resistor
m=1}
C {gnd.sym} 140 -200 0 0 {name=l1 lab=GND}
C {gnd.sym} 780 -300 0 0 {name=l2 lab=GND}
C {res.sym} 540 -250 0 0 {name=R1
value=2.145k
footprint=1206
device=resistor
m=1}
C {res.sym} 640 -250 0 0 {name=R2
value=45k
footprint=1206
device=resistor
m=1}
C {gnd.sym} 640 -200 0 0 {name=l3 lab=GND}
C {sg13g2_pr/pnpMPA.sym} 210 -130 0 0 {name=Q1
model=pnpMPA
spiceprefix=X
w=5.0u
l=5.0u
}
C {sg13g2_pr/pnpMPA.sym} 520 -130 0 0 {name=Q2
model=pnpMPA
spiceprefix=X
w=40.0u
l=5.0u
}
C {gnd.sym} 540 -70 0 0 {name=l4 lab=GND}
C {gnd.sym} 500 -70 0 0 {name=l5 lab=GND}
C {gnd.sym} 230 -70 0 0 {name=l6 lab=GND}
C {gnd.sym} 190 -70 0 0 {name=l7 lab=GND}
C {devices/code_shown.sym} -430 -260 0 0 {name=MODEL only_toplevel=true
format="tcleval( @value )"
value="
.lib $::SG13G2_MODELS/cornerHBT.lib hbt_typ
.lib cornerMOSlv.lib mos_tt
"}
C {devices/code_shown.sym} -450 -520 0 0 {name=NGSPICE1 DC Vbe Sim only_toplevel=true
value="
.control
.save all
op
dc TEMP -50 100 5
set wr_singlescale
set wr_vecnames
wrdata vbe_tempvar.txt VBG
.endc
"}

View File

@ -0,0 +1,32 @@
temp-sweep VBG
-5.00000000e+01 -6.56336235e-22
-4.50000000e+01 1.26243168e-24
-4.00000000e+01 2.06119998e-30
-3.50000000e+01 2.15293251e-30
-3.00000000e+01 1.56951276e-30
-2.50000000e+01 1.14620616e-30
-2.00000000e+01 8.40666493e-31
-1.50000000e+01 6.20220706e-31
-1.00000000e+01 4.60730775e-31
-5.00000000e+00 3.44787601e-31
0.00000000e+00 2.59989966e-31
5.00000000e+00 1.97549267e-31
1.00000000e+01 1.51240384e-31
1.50000000e+01 1.16643270e-31
2.00000000e+01 9.06059526e-32
2.50000000e+01 7.08684385e-32
3.00000000e+01 5.58003407e-32
3.50000000e+01 4.42177011e-32
4.00000000e+01 3.52545802e-32
4.50000000e+01 2.82740246e-32
5.00000000e+01 2.28035560e-32
5.50000000e+01 1.84908083e-32
6.00000000e+01 1.50717184e-32
6.50000000e+01 1.23450417e-32
7.00000000e+01 1.01594685e-32
7.50000000e+01 8.39810780e-33
8.00000000e+01 6.97340865e-33
8.50000000e+01 5.81390102e-33
9.00000000e+01 4.86673469e-33
9.50000000e+01 4.08959187e-33
1.00000000e+02 3.44711367e-33

View File

@ -0,0 +1,66 @@
v {xschem version=3.4.5 file_version=1.2
}
G {}
K {}
V {}
S {}
E {}
N 180 -100 180 -80 {
lab=GND}
N 180 -240 180 -200 {
lab=Vbe}
N 180 -240 360 -240 {
lab=Vbe}
N 360 -150 360 -140 {
lab=#net1}
N 360 -80 360 -70 {
lab=GND}
N 360 -240 360 -210 {
lab=Vbe}
N 140 -170 140 -100 {
lab=GND}
N 140 -100 180 -100 {
lab=GND}
N 180 -140 180 -100 {
lab=GND}
N 80 -240 180 -240 {
lab=Vbe}
N 80 -180 80 -160 {
lab=GND}
N 360 -240 410 -240 {
lab=Vbe}
C {devices/gnd.sym} 180 -80 0 0 {name=l1 lab=GND}
C {devices/gnd.sym} 80 -160 0 0 {name=l2 lab=GND}
C {devices/gnd.sym} 360 -70 0 0 {name=l3 lab=GND}
C {devices/code_shown.sym} -370 -420 0 0 {name=NGSPICE DC Vbe Sim only_toplevel=true
value="
.control
.save #net1
.save #net2
op
dc TEMP -50 100 5
set wr_singlescale
set wr_vecnames
wrdata vbe_tempvar.txt Vbe
.endc
"}
C {res.sym} 80 -210 0 0 {name=R1
value=45k
footprint=1206
device=resistor
m=1}
C {isource.sym} 360 -180 2 0 {name=I0 value=25e-6}
C {sg13g2_pr/pnpMPA.sym} 160 -170 0 0 {name=Q2
model=pnpMPA
spiceprefix=X
w=5.0u
l=5.0u
}
C {vsource.sym} 360 -110 0 0 {name=V1 value=1.2 savecurrent=false}
C {devices/code_shown.sym} -460 -90 0 0 {name=MODEL only_toplevel=true
format="tcleval( @value )"
value="
.lib $::SG13G2_MODELS/cornerHBT.lib hbt_typ
"}
C {lab_pin.sym} 410 -240 0 1 {name=p1 sig_type=std_logic lab=Vbe}

View File

@ -0,0 +1,21 @@
// importing libs
`include "discipline.h"
module diff_amp (out, IN1, IN2);
output electrical out;
input electrical IN1, IN2;
parameter real gain = 10; // setting gain to 10 of the differential amplifier
analog begin
V(out) <+ gain * (V(IN1) - V(IN2));
end
endmodule

View File

@ -0,0 +1,75 @@
v {xschem version=3.4.6RC file_version=1.2
}
G {}
K {type=opamp_va
format="@spiceprefix@name @@OUT @@IN1 @@IN2 @model"
template="name=U1 model=diff_amp_cell spiceprefix=X"
device_model="tcleval(
.subckt diff_amp_cell OUT IN1 IN2
N1 out in1 in2 diff_amp_model
.ends diff_amp_cell
.model diff_amp_model diff_amp
.control
* following line specifies the location for the .osdi file so ngspice can use it.
pre_osdi /home/pedersen/chipdesign/cmos_analog/opensource_analog_course/bgr_bjt/verilog/diff_amp.osdi
.endc
)"
}
V {}
S {}
E {}
L 4 -100 -40 -80 -40 {}
L 4 80 0 100 0 {}
L 4 -100 40 -80 40 {}
B 5 97.5 -2.5 102.5 2.5 {name=OUT dir=out}
B 5 -102.5 -42.5 -97.5 -37.5 {name=IN1 dir=in}
B 5 -102.5 37.5 -97.5 42.5 {name=IN2 dir=in}
P 4 4 -80 80 -80 -80 80 -0 -80 80 {}
T {@symname} -64 -6 0 0 0.3 0.3 {}
T {@name} 85 -22 0 0 0.2 0.2 {}
T {IN1} -75 -44 0 0 0.2 0.2 {}
T {OUT} 65 -4 0 1 0.2 0.2 {}
T {IN2} -75 36 0 0 0.2 0.2 {}
T {Ensure port order matches the
order in the verilog-A file.} -30 -70 0 0 0.1 0.1 {hide=instance}

View File

@ -0,0 +1,182 @@
v {xschem version=3.4.5 file_version=1.2
}
G {}
K {}
V {}
S {}
E {}
B 2 840 -900 1640 -500 {flags=graph
y1=2
y2=4
ypos1=0
ypos2=2
divy=5
subdivy=1
unity=1
x1=2.4
x2=4.4
divx=5
subdivx=1
xlabmag=1.0
ylabmag=1.0
node="b
a"
color="6 4"
dataset=-1
unitx=1
logx=0
logy=0
}
B 2 840 -500 1640 -100 {flags=graph
y1=-2
y2=18
ypos1=0
ypos2=2
divy=5
subdivy=1
unity=1
x1=2.4
x2=4.4
divx=5
subdivx=1
xlabmag=1.0
ylabmag=1.0
node=z
color=7
dataset=-1
unitx=1
logx=0
logy=0
}
P 4 5 150 -620 150 -990 720 -990 720 -620 150 -620 {}
P 4 7 410 -620 410 -560 420 -560 410 -540 400 -560 410 -560 410 -620 {}
T {// importing libs
`include "discipline.h"
module diff_amp (out, in1, in2);
output electrical out;
input electrical in1, in2;
parameter real gain = 10; // setting gain to 10 of the differential amplifier
analog begin
V(out) <+ gain * (V(in1) - V(in2));
end
} 150 -980 0 0 0.2 0.2 {font=monospace}
T {create a diff_amp.va file with following code
and compile it into a .osdi file with openvaf.} 160 -1090 0 0 0.4 0.4 {}
N 180 -450 320 -450 {lab=B}
N 80 -530 320 -530 {lab=A}
N 520 -490 640 -490 {lab=Z}
N 80 -290 180 -290 {lab=0}
N 180 -330 180 -290 {lab=0}
N 80 -330 80 -290 {lab=0}
N 80 -530 80 -390 {lab=A}
N 180 -450 180 -390 {lab=B}
N 60 -290 80 -290 {lab=0}
C {diff_amp.sym} 420 -490 0 0 {name=U1}
C {lab_pin.sym} 640 -490 0 1 {name=p1 sig_type=std_logic lab=Z}
C {lab_pin.sym} 80 -530 0 0 {name=p2 sig_type=std_logic lab=A}
C {lab_pin.sym} 180 -450 0 0 {name=p3 sig_type=std_logic lab=B}
C {vsource.sym} 80 -360 0 0 {name=V1 value=3.1 savecurrent=false}
C {vsource.sym} 180 -360 0 0 {name=V2 value=3 savecurrent=false}
C {lab_pin.sym} 60 -290 0 0 {name=p4 sig_type=std_logic lab=0}
C {code_shown.sym} -300 -620 0 0 {name=COMMANDS only_toplevel=false value="
.options savecurrents
.control
save all
op
remzerovec
write tb_diff_amp.raw
dc V1 2 4 0.01
set appendwrite
remzerovec
write tb_diff_amp.raw
.endc"}
C {launcher.sym} 670 -120 0 0 {name=h5
descr="load waves"
tclcommand="xschem raw_read $netlist_dir/tb_diff_amp.raw dc"
}
C {title.sym} 160 -30 0 0 {name=l1 author="Phillip Baade-Pedersen"}
C {launcher.sym} 670 -170 0 0 {name=h1
descr="OP annotate"
tclcommand="xschem annotate_op"
}