add PLL content

This commit is contained in:
PhillipRambo 2025-08-18 15:27:25 +02:00
parent 8c4c771a8f
commit 9c6ab850a0
4 changed files with 111 additions and 29 deletions

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 11,
"id": "9f325daf-eb3b-4cf7-8ffe-b9b94e7f66ea",
"metadata": {},
"outputs": [],
@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 12,
"id": "b5b31aca-47bf-4461-8e50-16c20f03b337",
"metadata": {},
"outputs": [],
@ -29,7 +29,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 13,
"id": "743dc381-0d35-4aa9-847c-c42c80c17786",
"metadata": {},
"outputs": [],
@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 14,
"id": "b27d5fca-3436-4df7-895f-f6a4bbd7a80d",
"metadata": {
"jupyter": {
@ -243,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 15,
"id": "fc95a0ff-ba36-46ce-9fa1-64d6d2d7770f",
"metadata": {},
"outputs": [],
@ -253,6 +253,82 @@
"length_2d_nmos = tile_length_to_match_data(nmos.length, nmos.extracted_table['gm'])"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "0cec9718-17e7-42bb-bbfb-732d1c90bcb2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': array([[3.76624204e-10, 6.01959060e-09, 9.87071189e-08, 1.60543800e-06,\n",
" 1.93245942e-05, 1.00782425e-04, 3.04098328e-04, 6.72702794e-04,\n",
" 1.20889547e-03, 1.88107823e-03, 2.64380500e-03, 3.45477089e-03,\n",
" 4.28145425e-03],\n",
" [2.27434005e-09, 4.64820324e-08, 9.46792454e-07, 1.37633087e-05,\n",
" 7.66349258e-05, 2.27211058e-04, 4.84392425e-04, 8.45214177e-04,\n",
" 1.29153416e-03, 1.79815432e-03, 2.33954331e-03, 2.89372122e-03,\n",
" 3.44357151e-03],\n",
" [4.75539874e-09, 1.07745670e-07, 2.21974369e-06, 2.13823078e-05,\n",
" 8.28884513e-05, 2.02094612e-04, 3.83498729e-04, 6.23728731e-04,\n",
" 9.14110395e-04, 1.24216150e-03, 1.59279897e-03, 1.95027457e-03,\n",
" 2.30064266e-03]], dtype=float32),\n",
" 'vth': array([[0.4175789 , 0.4175789 , 0.4175789 , 0.4175789 , 0.4175789 ,\n",
" 0.4175789 , 0.4175789 , 0.4175789 , 0.4175789 , 0.4175789 ,\n",
" 0.4175789 , 0.4175789 , 0.4175789 ],\n",
" [0.31012315, 0.31012315, 0.31012315, 0.31012315, 0.31012315,\n",
" 0.31012315, 0.31012315, 0.31012315, 0.31012315, 0.31012315,\n",
" 0.31012315, 0.31012315, 0.31012315],\n",
" [0.25189924, 0.25189924, 0.25189924, 0.25189924, 0.25189924,\n",
" 0.25189924, 0.25189924, 0.25189924, 0.25189924, 0.25189924,\n",
" 0.25189924, 0.25189924, 0.25189924]], dtype=float32),\n",
" 'gm': array([[1.0355391e-08, 1.6762097e-07, 2.7663464e-06, 4.3945060e-05,\n",
" 4.0340933e-04, 1.3237044e-03, 2.8199644e-03, 4.5541674e-03,\n",
" 6.1132847e-03, 7.2515998e-03, 7.9314727e-03, 8.2337745e-03,\n",
" 8.2622319e-03],\n",
" [6.8324205e-08, 1.4071227e-06, 2.8058514e-05, 3.0460340e-04,\n",
" 1.0163147e-03, 2.0270473e-03, 3.1103410e-03, 4.0744538e-03,\n",
" 4.8087859e-03, 5.2804318e-03, 5.5105267e-03, 5.5445507e-03,\n",
" 5.4319035e-03],\n",
" [1.4800021e-07, 3.3604522e-06, 6.2207786e-05, 3.6775280e-04,\n",
" 8.8785321e-04, 1.5031686e-03, 2.1188618e-03, 2.6710527e-03,\n",
" 3.1156084e-03, 3.4199473e-03, 3.5661045e-03, 3.5598569e-03,\n",
" 3.4301258e-03]], dtype=float32),\n",
" 'gds': array([[4.2991338e-10, 7.1589881e-09, 1.2225600e-07, 2.0337011e-06,\n",
" 2.1824198e-05, 7.4040574e-05, 1.4492353e-04, 2.4114188e-04,\n",
" 3.7066598e-04, 5.5198371e-04, 8.0706168e-04, 1.1493404e-03,\n",
" 1.5826311e-03],\n",
" [2.1960556e-09, 4.7003134e-08, 9.8667385e-07, 1.2744471e-05,\n",
" 4.5941855e-05, 9.0867376e-05, 1.5159344e-04, 2.3945510e-04,\n",
" 3.7418643e-04, 5.7869806e-04, 8.6932670e-04, 1.2510468e-03,\n",
" 1.7183991e-03],\n",
" [3.8504893e-09, 9.1464564e-08, 1.8656532e-06, 1.3157433e-05,\n",
" 3.2548171e-05, 5.7141449e-05, 8.8717396e-05, 1.3273282e-04,\n",
" 2.0318832e-04, 3.2743323e-04, 5.4010993e-04, 8.6352450e-04,\n",
" 1.2929583e-03]], dtype=float32),\n",
" 'length': array([[1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07,\n",
" 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07, 1.3e-07],\n",
" [2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07,\n",
" 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07, 2.6e-07],\n",
" [5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07,\n",
" 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07, 5.2e-07]]),\n",
" 'vbs': 0.0,\n",
" 'vgs': array([[0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2],\n",
" [0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2],\n",
" [0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2]]),\n",
" 'vds': 0.6}"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nmos.extracted_table\n"
]
},
{
"cell_type": "markdown",
"id": "2fc675aa-6d59-4d74-83e2-18c56353db0d",
@ -263,14 +339,14 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 7,
"id": "b7cc630f-b385-47a6-a6f9-ac0d10effffe",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c0d716a395d84be68ee1dbc73a913175",
"model_id": "6135647378824854a249008cff2939aa",
"version_major": 2,
"version_minor": 0
},
@ -309,14 +385,14 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 8,
"id": "3727c42d-a4bf-4eb0-bc11-6e859ae41324",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cba5a4c794944ea1900cd54144dad957",
"model_id": "3de96606da1946dcb4e15f6b7e281eec",
"version_major": 2,
"version_minor": 0
},

View File

@ -46,7 +46,8 @@ nmos_sweep = TransistorSweep(
vgs=(0, 1.2, 0.1),
vds=(0, 1.2, 0.1),
vbs=(0, -1.2, -0.1),
length = [130e-9, 260e-9, 390e-9, 520e-9, 650e-9, 780e-9, 910e-9, 1040e-9, 1170e-9, 1300e-9, 1430e-9, 1560e-9, 1690e-9, 1820e-9, 1950e-9, 2080e-9, 2210e-9, 2340e-9, 2470e-9, 2600e-9, 2730e-9, 2860e-9, 2990e-9, 3120e-9, 3250e-9, 3380e-9, 3510e-9, 3640e-9, 3770e-9, 3900e-9, 4030e-9, 4160e-9, 4290e-9, 4420e-9, 4550e-9, 4680e-9, 4810e-9, 4940e-9, 5070e-9, 5200e-9, 5330e-9, 5460e-9, 5590e-9, 5720e-9, 5850e-9, 5980e-9, 6110e-9, 6240e-9, 6370e-9, 6500e-9, 6630e-9, 6760e-9, 6890e-9, 7020e-9, 7150e-9, 7280e-9, 7410e-9, 7540e-9, 7670e-9, 7800e-9, 7930e-9, 8060e-9, 8190e-9, 8320e-9, 8450e-9, 8580e-9, 8710e-9, 8840e-9, 8970e-9, 9100e-9, 9230e-9, 9360e-9, 9490e-9, 9620e-9, 9750e-9, 9880e-9]
length = [130e-9,260e-9,520e-9]
#length = [130e-9, 260e-9, 390e-9, 520e-9, 650e-9, 780e-9, 910e-9, 1040e-9, 1170e-9, 1300e-9, 1430e-9, 1560e-9, 1690e-9, 1820e-9, 1950e-9, 2080e-9, 2210e-9, 2340e-9, 2470e-9, 2600e-9, 2730e-9, 2860e-9, 2990e-9, 3120e-9, 3250e-9, 3380e-9, 3510e-9, 3640e-9, 3770e-9, 3900e-9, 4030e-9, 4160e-9, 4290e-9, 4420e-9, 4550e-9, 4680e-9, 4810e-9, 4940e-9, 5070e-9, 5200e-9, 5330e-9, 5460e-9, 5590e-9, 5720e-9, 5850e-9, 5980e-9, 6110e-9, 6240e-9, 6370e-9, 6500e-9, 6630e-9, 6760e-9, 6890e-9, 7020e-9, 7150e-9, 7280e-9, 7410e-9, 7540e-9, 7670e-9, 7800e-9, 7930e-9, 8060e-9, 8190e-9, 8320e-9, 8450e-9, 8580e-9, 8710e-9, 8840e-9, 8970e-9, 9100e-9, 9230e-9, 9360e-9, 9490e-9, 9620e-9, 9750e-9, 9880e-9]
)

View File

@ -12,7 +12,7 @@ ypos2=2
divy=5
subdivy=1
unity=1
x1=0
x1=4.0396485e-08
divx=5
subdivx=4
@ -24,7 +24,7 @@ dataset=-1
unitx=1
logx=0
logy=0
x2=1e-06
x2=4.0503685e-08
color=4
node=clk}
B 2 20 -855 820 -455 {flags=graph
@ -35,7 +35,7 @@ ypos2=2
divy=5
subdivy=1
unity=1
x1=0
x1=4.0396485e-08
divx=5
subdivx=4
@ -47,7 +47,7 @@ dataset=-1
unitx=1
logx=0
logy=0
x2=1e-06
x2=4.0503685e-08
color=4
@ -60,7 +60,7 @@ ypos2=2
divy=5
subdivy=1
unity=1
x1=0
x1=4.0396485e-08
divx=5
subdivx=4
@ -72,20 +72,19 @@ dataset=-1
unitx=1
logx=0
logy=0
x2=1e-06
x2=4.0503685e-08
color=4
node=vout}
B 2 850 -805 1650 -405 {flags=graph
y1=1.1
y2=1.2
y1=-0.13480066
y2=1.3283316
ypos1=0
ypos2=2
divy=5
subdivy=1
unity=1
x1=0
divx=5
subdivx=4
@ -97,10 +96,13 @@ dataset=-1
unitx=1
logx=0
logy=0
x2=1e-06
color=4
node=outp}
node=outp
x2=4.0503685e-08
x1=4.0396485e-08
hcursor1_y=0.13669334
hcursor2_y=1.0706523}
B 2 850 -395 1650 5 {flags=graph
y1=0.24502661
y2=1.4615386
@ -109,7 +111,7 @@ ypos2=2
divy=5
subdivy=1
unity=1
x1=0
x1=4.0396485e-08
divx=5
subdivx=4
@ -121,7 +123,7 @@ dataset=-1
unitx=1
logx=0
logy=0
x2=1e-06
x2=4.0503685e-08
color=4
@ -182,15 +184,13 @@ N 80 -300 80 -280 {
lab=vinp}
N 80 -380 80 -360 {
lab=GND}
C {devices/code_shown.sym} -775 -550 0 0 {name=MODEL only_toplevel=false
C {devices/code_shown.sym} -1305 -680 0 0 {name=MODEL only_toplevel=false
format="tcleval( @value )"
value="
.lib cornerMOSlv.lib mos_tt
"}
C {devices/code_shown.sym} -865 -1040 0 0 {name=NGSPICE only_toplevel=false
C {devices/code_shown.sym} -1325 -1180 0 0 {name=NGSPICE only_toplevel=false
value="
.include comparator_tb.save
.param temp=27
.param clock = 100e6 ; 100 MHz clock
.param period = \{1/clock\}
@ -205,10 +205,15 @@ write comparator_tb.raw
set appendwrite
* Transient analysis
.options meas_step_max=1e-10
tran 500p 1u
let vindiff = v(vinp) - v(vbias)
let clk = v(clk)
let vout = v(outp) - v(outm)
meas TRAN rise_time TRIG v(outp) VAL=0.12 TD=9n RISE=4 TARG v(outp) VAL=1.08 TD=9n RISE=4
meas TRAN fall_time TRIG v(outp) VAL=1.08 TD=9n RISE=4 TARG v(outp) VAL=0.12 TD=9n RISE=4
write comparator_tb.raw
.endc
"}
@ -262,7 +267,7 @@ C {launcher.sym} -210 -850 0 0 {name=h5
descr="load waves"
tclcommand="xschem raw_read $netlist_dir/comparator_tb.raw tran"
}
C {launcher.sym} -210 -765 0 0 {name=h2
C {launcher.sym} -210 -775 0 0 {name=h2
descr=SimulateNGSPICE
tclcommand="
# Setup the default simulation commands if not already set up
@ -286,7 +291,7 @@ write_data [save_params] $netlist_dir/[file rootname [file tail [xschem get curr
xschem netlist
simulate
"}
C {DIFF_COMPARATOR.sym} 270 -220 0 0 {name=x2
C {DIFF_COMPARATOR.sym} 270 -220 0 0 {name=x1
schematic=DIFF_COMPARATOR_pex
spice_sym_def=
"