add PLL content

This commit is contained in:
PhillipRambo 2025-08-18 15:24:55 +02:00
parent b7eccce3e4
commit 286b9ade69
5 changed files with 309 additions and 0 deletions

View File

@ -0,0 +1,82 @@
v {xschem version=3.4.6 file_version=1.2}
G {}
K {}
V {}
S {}
E {}
N 150 -100 150 -50 {lab=#net1}
N 280 -50 410 -50 {lab=#net1}
N 410 -100 410 -50 {lab=#net1}
N 280 -50 280 -20 {lab=#net1}
N 150 -50 280 -50 {lab=#net1}
N 150 -220 150 -160 {lab=Out-}
N 410 -220 410 -160 {lab=Out+}
N 150 -330 150 -290 {lab=vdd}
N 410 -330 410 -290 {lab=vdd}
N 280 -330 410 -330 {lab=vdd}
N 80 -130 110 -130 {lab=In+}
N 450 -130 480 -130 {lab=In-}
N 150 -330 280 -330 {lab=vdd}
N 280 -370 280 -330 {lab=vdd}
N 150 -130 200 -130 {lab=gnd}
N 360 -130 410 -130 {lab=gnd}
N 0 -220 150 -220 {lab=Out-}
N 150 -230 150 -220 {lab=Out-}
N -0 -220 -0 -200 {lab=Out-}
N -30 -220 0 -220 {lab=Out-}
N -0 -140 -0 -120 {lab=gnd}
N 410 -220 560 -220 {lab=Out+}
N 560 -220 560 -200 {lab=Out+}
N 560 -220 590 -220 {lab=Out+}
N 560 -140 560 -120 {lab=gnd}
N 410 -240 410 -220 {lab=Out+}
N 280 40 280 60 {lab=gnd}
C {sg13g2_pr/sg13_lv_nmos.sym} 430 -130 0 1 {name=M1
l=0.26u
w=2.6u
ng=1
m=1
model=sg13_lv_nmos
spiceprefix=X
}
C {sg13g2_pr/sg13_lv_nmos.sym} 130 -130 0 0 {name=M2
l=0.26u
w=2.6u
ng=1
m=1
model=sg13_lv_nmos
spiceprefix=X
}
C {res.sym} 150 -260 0 0 {name=R1
value=5k
footprint=1206
device=resistor
m=1}
C {res.sym} 410 -260 0 0 {name=R2
value=5k
footprint=1206
device=resistor
m=1}
C {ipin.sym} 80 -130 0 0 {name=p3 lab=In+}
C {iopin.sym} 280 -370 2 0 {name=p5 lab=vdd}
C {iopin.sym} 280 60 2 0 {name=p1 lab=gnd}
C {lab_pin.sym} 360 -130 0 0 {name=p2 sig_type=std_logic lab=gnd}
C {lab_pin.sym} 200 -130 2 0 {name=p6 sig_type=std_logic lab=gnd}
C {capa.sym} 0 -170 0 0 {name=C1
m=1
value=0.5f
footprint=1206
device="ceramic capacitor"}
C {lab_pin.sym} 0 -120 0 0 {name=p7 sig_type=std_logic lab=gnd}
C {ipin.sym} 480 -130 0 1 {name=p8 lab=In-}
C {capa.sym} 560 -170 0 1 {name=C2
m=1
value=0.5f
footprint=1206
device="ceramic capacitor"}
C {lab_pin.sym} 560 -120 0 1 {name=p9 sig_type=std_logic lab=gnd}
C {opin.sym} 590 -220 0 0 {name=p10 lab=Out+}
C {opin.sym} -30 -220 0 1 {name=p11 lab=Out-}
C {isource.sym} 280 10 0 0 {name=I0 value=200u}
C {sg13g2_pr/annotate_fet_params.sym} 700 -230 0 0 {name=annot1 ref=M1}
C {sg13g2_pr/annotate_fet_params.sym} 810 -230 0 0 {name=annot2 ref=M2}

View File

@ -0,0 +1,30 @@
v {xschem version=3.4.6 file_version=1.2}
G {}
K {type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
}
V {}
S {}
E {}
L 4 -20 40 0 40 {}
L 4 -20 -40 0 -40 {}
L 4 -150 -40 -130 -40 {}
L 4 -150 40 -130 40 {}
L 7 -100 -70 -100 -50 {}
L 7 -100 50 -100 70 {}
B 5 -102.5 -72.5 -97.5 -67.5 {name=vdd dir=inout}
B 5 -2.5 37.5 2.5 42.5 {name=Out+ dir=out}
B 5 -2.5 -42.5 2.5 -37.5 {name=Out- dir=out}
B 5 -152.5 -42.5 -147.5 -37.5 {name=In+ dir=in}
B 5 -152.5 37.5 -147.5 42.5 {name=In- dir=in}
B 5 -102.5 67.5 -97.5 72.5 {name=gnd dir=inout}
P 4 5 0 0 -130 -60 -130 60 0 0 0 0 {}
T {@symname} -124.5 4 0 0 0.1 0.1 {}
T {@name} -68.75 4.25 0 0 0.1 0.1 {}
T {vdd} -105 -26 2 1 0.2 0.2 {}
T {Out+} -25 36 0 1 0.2 0.2 {}
T {Out-} -25 -44 0 1 0.2 0.2 {}
T {In+} -125 -44 0 0 0.2 0.2 {}
T {In-} -125 36 0 0 0.2 0.2 {}
T {gnd} -105 44 2 1 0.2 0.2 {}

View File

@ -0,0 +1,117 @@
v {xschem version=3.4.6 file_version=1.2}
G {}
K {}
V {}
S {}
E {}
B 2 1250 -560 2050 -160 {flags=graph
y1=-0.59
y2=1.3
ypos1=0
ypos2=2
divy=5
subdivy=1
unity=1
x1=0
x2=2e-09
divx=5
subdivx=1
xlabmag=1.0
ylabmag=1.0
dataset=-1
unitx=1
logx=0
logy=0
color="4 7 12"
node="voplus
vominus
vo_diff"}
N 650 -240 700 -240 {lab=#net1}
N 650 -160 700 -160 {lab=#net2}
N 850 -240 900 -240 {lab=#net3}
N 850 -160 900 -160 {lab=#net4}
N 550 -290 550 -270 {lab=vdd}
N 750 -290 950 -290 {lab=vdd}
N 950 -290 950 -270 {lab=vdd}
N 750 -290 750 -270 {lab=vdd}
N 550 -290 750 -290 {lab=vdd}
N 550 -130 550 -110 {lab=GND}
N 550 -110 750 -110 {lab=GND}
N 750 -130 750 -110 {lab=GND}
N 750 -110 950 -110 {lab=GND}
N 950 -130 950 -110 {lab=GND}
N 480 -240 500 -240 {lab=Voplus}
N 480 -330 1070 -330 {lab=Voplus}
N 1050 -240 1070 -240 {lab=Voplus}
N 480 -330 480 -240 {lab=Voplus}
N 1070 -330 1070 -240 {lab=Voplus}
N 1070 -160 1070 -70 {lab=Vominus}
N 1050 -160 1070 -160 {lab=Vominus}
N 480 -160 500 -160 {lab=Vominus}
N 480 -160 480 -70 {lab=Vominus}
N 400 -130 400 -90 {lab=GND}
N 480 -70 1070 -70 {lab=Vominus}
N 400 -230 400 -190 {lab=vdd}
C {differential_core.sym} 650 -200 0 0 {name=x1}
C {differential_core.sym} 850 -200 0 0 {name=x2}
C {differential_core.sym} 1050 -200 0 0 {name=x3}
C {lab_pin.sym} 950 -290 2 0 {name=p1 sig_type=std_logic lab=vdd}
C {vsource.sym} 400 -160 0 0 {name=V1 value=1.2 savecurrent=false}
C {gnd.sym} 950 -110 0 0 {name=l1 lab=GND}
C {gnd.sym} 400 -90 0 0 {name=l2 lab=GND}
C {lab_pin.sym} 400 -230 2 0 {name=p2 sig_type=std_logic lab=vdd}
C {opin.sym} 1070 -330 0 0 {name=p3 lab=Voplus}
C {opin.sym} 1070 -70 2 1 {name=p4 lab=Vominus}
C {code_shown.sym} 0 -450 0 0 {name=transient_tb only_toplevel=false
value="
.include diff_oscillator_tb.save
.param temp=27
.ic V(Voplus)=1.2
.control
save all
op
write diff_oscillator_tb.raw
set appendwrite
tran 10p 2n
save all
let vo_diff = v(Voplus) - v(Vominus)
write diff_oscillator_tb.raw
.endc
"}
C {devices/code_shown.sym} 0 -110 0 0 {name=MODEL only_toplevel=true
format="tcleval( @value )"
value=".lib cornerMOSlv.lib mos_tt
"}
C {launcher.sym} 1310 -70 0 0 {name=h3
descr=SimulateNGSPICE
tclcommand="
# Setup the default simulation commands if not already set up
# for example by already launched simulations.
set_sim_defaults
puts $sim(spice,1,cmd)
# Change the Xyce command. In the spice category there are currently
# 5 commands (0, 1, 2, 3, 4). Command 3 is the Xyce batch
# you can get the number by querying $sim(spice,n)
set sim(spice,1,cmd) \{ngspice \\"$N\\" -a\}
# change the simulator to be used (Xyce)
set sim(spice,default) 0
# Create FET and BIP .save file
mkdir -p $netlist_dir
write_data [save_params] $netlist_dir/[file rootname [file tail [xschem get current_name]]].save
# run netlist and simulation
xschem netlist
simulate
"}
C {devices/launcher.sym} 1310 -110 0 0 {name=h1
descr="OP annotate"
tclcommand="xschem annotate_op"
}
C {launcher.sym} 1310 -30 0 0 {name=h5
descr="load waves"
tclcommand="xschem raw_read $netlist_dir/diff_oscillator_tb.raw tran"
}

View File

@ -0,0 +1,62 @@
* Place this .save file with a .include line in your testbench
.save @n.x1.xm1.nsg13_lv_nmos[ids]
.save @n.x1.xm1.nsg13_lv_nmos[gm]
.save @n.x1.xm1.nsg13_lv_nmos[gds]
.save @n.x1.xm1.nsg13_lv_nmos[vth]
.save @n.x1.xm1.nsg13_lv_nmos[vgs]
.save @n.x1.xm1.nsg13_lv_nmos[vdss]
.save @n.x1.xm1.nsg13_lv_nmos[vds]
.save @n.x1.xm1.nsg13_lv_nmos[cgg]
.save @n.x1.xm1.nsg13_lv_nmos[cgsol]
.save @n.x1.xm1.nsg13_lv_nmos[cgdol]
.save @n.x1.xm2.nsg13_lv_nmos[ids]
.save @n.x1.xm2.nsg13_lv_nmos[gm]
.save @n.x1.xm2.nsg13_lv_nmos[gds]
.save @n.x1.xm2.nsg13_lv_nmos[vth]
.save @n.x1.xm2.nsg13_lv_nmos[vgs]
.save @n.x1.xm2.nsg13_lv_nmos[vdss]
.save @n.x1.xm2.nsg13_lv_nmos[vds]
.save @n.x1.xm2.nsg13_lv_nmos[cgg]
.save @n.x1.xm2.nsg13_lv_nmos[cgsol]
.save @n.x1.xm2.nsg13_lv_nmos[cgdol]
.save @n.x2.xm1.nsg13_lv_nmos[ids]
.save @n.x2.xm1.nsg13_lv_nmos[gm]
.save @n.x2.xm1.nsg13_lv_nmos[gds]
.save @n.x2.xm1.nsg13_lv_nmos[vth]
.save @n.x2.xm1.nsg13_lv_nmos[vgs]
.save @n.x2.xm1.nsg13_lv_nmos[vdss]
.save @n.x2.xm1.nsg13_lv_nmos[vds]
.save @n.x2.xm1.nsg13_lv_nmos[cgg]
.save @n.x2.xm1.nsg13_lv_nmos[cgsol]
.save @n.x2.xm1.nsg13_lv_nmos[cgdol]
.save @n.x2.xm2.nsg13_lv_nmos[ids]
.save @n.x2.xm2.nsg13_lv_nmos[gm]
.save @n.x2.xm2.nsg13_lv_nmos[gds]
.save @n.x2.xm2.nsg13_lv_nmos[vth]
.save @n.x2.xm2.nsg13_lv_nmos[vgs]
.save @n.x2.xm2.nsg13_lv_nmos[vdss]
.save @n.x2.xm2.nsg13_lv_nmos[vds]
.save @n.x2.xm2.nsg13_lv_nmos[cgg]
.save @n.x2.xm2.nsg13_lv_nmos[cgsol]
.save @n.x2.xm2.nsg13_lv_nmos[cgdol]
.save @n.x3.xm1.nsg13_lv_nmos[ids]
.save @n.x3.xm1.nsg13_lv_nmos[gm]
.save @n.x3.xm1.nsg13_lv_nmos[gds]
.save @n.x3.xm1.nsg13_lv_nmos[vth]
.save @n.x3.xm1.nsg13_lv_nmos[vgs]
.save @n.x3.xm1.nsg13_lv_nmos[vdss]
.save @n.x3.xm1.nsg13_lv_nmos[vds]
.save @n.x3.xm1.nsg13_lv_nmos[cgg]
.save @n.x3.xm1.nsg13_lv_nmos[cgsol]
.save @n.x3.xm1.nsg13_lv_nmos[cgdol]
.save @n.x3.xm2.nsg13_lv_nmos[ids]
.save @n.x3.xm2.nsg13_lv_nmos[gm]
.save @n.x3.xm2.nsg13_lv_nmos[gds]
.save @n.x3.xm2.nsg13_lv_nmos[vth]
.save @n.x3.xm2.nsg13_lv_nmos[vgs]
.save @n.x3.xm2.nsg13_lv_nmos[vdss]
.save @n.x3.xm2.nsg13_lv_nmos[vds]
.save @n.x3.xm2.nsg13_lv_nmos[cgg]
.save @n.x3.xm2.nsg13_lv_nmos[cgsol]
.save @n.x3.xm2.nsg13_lv_nmos[cgdol]

View File

@ -0,0 +1,18 @@
# xschemrc - Custom configuration file for xschem
# This file sources another xschemrc file from a known location
# Source the base configuration from a known location
source $::env(PDK_ROOT)/$::env(PDK)/libs.tech/xschem/xschemrc
# (Optional) Add any custom overrides or extensions below
# set xschem_library_path /home/user/my_libs
# set xschem_gui_font "Monospace 10"
#### include skywater libraries. Here I use [pwd]. This works if I start xschem from here.
###only if you dont have this setup already ###
###append XSCHEM_LIBRARY_PATH :[file dirname [info script]]
#### Add custom libraries (directories with .lib files)
append XSCHEM_LIBRARY_PATH :../schematic/