Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .trinity/seals/analog_AnalogMosPsp103.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,35 @@
},
{
"spec": "specs/analog/mos_psp103_data.t27",
"spec_hash": "sha256:c3d11a64e1fb2eddb7724acb75bcf7c242551a683a7d265a7cdd0d208c8d4d7b"
"spec_hash": "sha256:d233143ed2fa30d3bd0ff9546a2df008d568e4a4d9c7e0ef69ffedee2e92a5d6"
},
{
"spec": "specs/analog/mos_table.t27",
"spec_hash": "sha256:16d28f10fa8663926dddb4bcced981cdc4cd8f38a6b748e4b7688f2e56bbab6c"
"spec_hash": "sha256:54e248069ae620d18d260231e238b6bc42dc3c65792bd1673b162c2dc97b2edb"
},
{
"spec": "specs/analog/sar_comparator.t27",
"spec_hash": "sha256:db347ab1845e5323822b3ab77ba3d43b9923d105cc717e7224ad54c7328d23a7"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:69fd7266d0521ec8d562ada8c030435202a0d2224d474dc5c5a9fc491000df19",
"gen_hash_rust": "sha256:745bf1988b0cb964b0196d6ea22d468bf839236585dd64e82d92ea70630e9e7b",
"gen_hash_verilog": "sha256:83361d5ce963f001d2afb09ca4d82d7dbf14caa8beecb7c6f5e3f67ac7cb8bc5",
"gen_hash_zig": "sha256:1b08ed9b9f43e9567fbfd414e308b40c86570febae56f72d7161f3d3b15d8704",
"gen_hash_c": "sha256:3e5e50bdd2f832394e41c7fc942ee2b98b9553db46d1988c37721c08b6847fbb",
"gen_hash_rust": "sha256:a88d4dacaeaf61bda5deb575152a70c098241e617a292cb4d74df64e4214a3df",
"gen_hash_verilog": "sha256:7c29cf75695e6734bfd23fed2f64db8fe522506e0cb1b4bf3a94dd1f266bfaf3",
"gen_hash_zig": "sha256:5e470893c4dc6c81ad93b2af02b9d8a981eb3678a82ea86c2c1ba7ecaf81b4d5",
"module": "AnalogMosPsp103",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T18:09:16Z",
"sealed_at": "2026-10-19T19:25:21Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:d178addc19558d26f503d3f5493e9815fa534209fb14169244b0b439c431b2a9",
"spec_hash": "sha256:3edf0828e56e30977b96c2e943d203aac805fd197800d37a57fb4fc61c7152d8",
"spec_path": "specs/analog/mos_psp103.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 25,
"total": 25,
"passed": 35,
"total": 35,
"vacuous": 0
},
"toolchain": {
Expand Down
16 changes: 8 additions & 8 deletions .trinity/seals/analog_AnalogMosPsp103Data.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:9e8e5b97faba8e2120066681472986c2b70b5207fb9f26c57a38f527f531c576",
"gen_hash_rust": "sha256:715acf0a48c1f1ba88df704ffc3a48ab3190d65a4282270bb2976a57c1450954",
"gen_hash_verilog": "sha256:f6f05bdafbac3e28a73cc54412ed776429b0ef7ce1c08219fa7dfabc2c98ebdd",
"gen_hash_zig": "sha256:9a77f32c1a9ee683b89349a0d2e87d166a1a3a8154663dfdb79053c0d11895eb",
"gen_hash_c": "sha256:a02b76251db8d7a64d65c32aad434a1847ac703ad6a71f16e4c1b970e0ea74b5",
"gen_hash_rust": "sha256:395c8a715aade1101e29f187926bfa9a985f6134ba5777dcf467ead14fc9732b",
"gen_hash_verilog": "sha256:dc49c09d8a3a13829b2cb9fba5450faa1f9d50da2611d75e06f2562e0d2cab13",
"gen_hash_zig": "sha256:8b372dfd2e05f42a44f713738843f75750e9a4c21d2f55c35dcac0db763bea8d",
"module": "AnalogMosPsp103Data",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T18:09:24Z",
"sealed_at": "2026-10-19T19:25:27Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:c3d11a64e1fb2eddb7724acb75bcf7c242551a683a7d265a7cdd0d208c8d4d7b",
"spec_hash": "sha256:d233143ed2fa30d3bd0ff9546a2df008d568e4a4d9c7e0ef69ffedee2e92a5d6",
"spec_path": "specs/analog/mos_psp103_data.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 9,
"total": 9,
"passed": 10,
"total": 10,
"vacuous": 0
},
"toolchain": {
Expand Down
18 changes: 9 additions & 9 deletions .trinity/seals/analog_AnalogMosTable.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"built_by": "t27c-bootstrap@0.5.2+c948f4df7",
"built_by": "t27c-bootstrap@0.5.2+42a4860c4",
"closure": [
{
"spec": "specs/analog/linear.t27",
"spec_hash": "sha256:3ddef7be183aba583ed285334ee389b48a65b41335e98914514235db7c4e5d62"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:e0ca09255f83209260afff210947c8af851f5412f9aa7a40f7f5b148a29ac739",
"gen_hash_rust": "sha256:dd4d433feaf2d937fc3acb769f6a9a8febc6d7cc58363dbc061ad9922eba3eb6",
"gen_hash_verilog": "sha256:b7e968dea3013590b323ce7c40e3be8df1d047bf6bde5b58768de36438102e7d",
"gen_hash_zig": "sha256:652d1bfbd355d08e8eca4a3f13a4957322006510c310d796111db8aac65ef1d0",
"gen_hash_c": "sha256:0d463e6735ad1e4b396815cc2cd3fbeaf247b51957a064a17401c55c662e7c09",
"gen_hash_rust": "sha256:88836ddfbb71fe8ead14846b2366b665f9bc75c79744eacaa5c393835356a3cc",
"gen_hash_verilog": "sha256:81cec1ae23c7262af635c0fca6a89e7b20a57473d4b3a1d011fbcb6a4f5e2e07",
"gen_hash_zig": "sha256:b6d45978701159e277778cb20711620e7f45af9ea9385df6a06d353b323e79ab",
"module": "AnalogMosTable",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T13:35:45Z",
"sealed_at": "2026-10-19T19:25:12Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:16d28f10fa8663926dddb4bcced981cdc4cd8f38a6b748e4b7688f2e56bbab6c",
"spec_hash": "sha256:54e248069ae620d18d260231e238b6bc42dc3c65792bd1673b162c2dc97b2edb",
"spec_path": "specs/analog/mos_table.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 17,
"total": 17,
"passed": 20,
"total": 20,
"vacuous": 0
},
"toolchain": {
Expand Down
138 changes: 138 additions & 0 deletions specs/analog/decks/psp103_idpa_tt.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
IHP SG13G2 PSP103 log-domain current tables, corner mos_tt
* specs/analog/decks/psp103_idpa_tt.cir -- the log-domain current tables for specs/analog/mos_psp103_data.t27 (M3c-2, #10881, epic #10486), the weak-inversion-accurate
* read of mos_table.t27. A netlist plus a .control block that prints the numbers.
* Model: IHP-Open-PDK commit 21133f219b1a6da10d803e345761e77415ceff40, ihp-sg13g2/libs.tech/ngspice/models/cornerMOSlv.lib (PSP 103.6, revision 200310), section
* mos_tt; the model code is libs.tech/verilog-a/psp103/psp103.va of the same commit, compiled with OpenVAF-Reloaded v24.0.2mob to psp103.osdi (and psp103_nqs.osdi).
* Temperature 27 C (TNOM 27 C). Devices: sg13_lv_nmos w=1.0u l=0.45u ng=1 m=1 and sg13_lv_pmos w=3.0u l=0.45u ng=1 m=1, exactly the devices of psp103_tab_tt.cir (the same
* netlist lines).
* Solver options: reltol 1e-6, vntol 1e-9, abstol 1e-14, as psp103_tab_tt.cir.
* Paths are NOT in this file. ngspice reads two environment variables: IHP_PDK, the IHP-Open-PDK checkout, and IHP_OSDI, the directory that holds the compiled
* psp103.osdi and psp103_nqs.osdi.
* Run: IHP_PDK=<checkout> IHP_OSDI=<osdi dir> ngspice -b psp103_idpa_tt.cir > psp103_idpa_tt.out (ngspice-47)
* THE TABLE. A node is the drain current Id, divided by the factor of weak inversion F = 1 - exp(-Vds / s(Vgs)), as log2 in 1/65536 of an octave, relative to
* IUNIT = 1 / (200 * 2^32) A = 1.164 pA (one table word of the linear tables, 298 pA, over 256). With the gate scale
* s(Vgs) = sqrt(0.030^2 + (0.65 * max(Vgs - 0.23, 0))^2) volts, rv = nint(4096 / s) (the word the reader multiplies Vds by), s_eff = 4096 / rv,
* the word of node (ix, iy), Vgs = ix * 15.625 mV (ix = 0 .. 96), Vds = iy * 31.25 mV (iy = 0 .. 48), is
* iy >= 1: nint(65536 * log2(max(Id / F(Vds; s_eff), IUNIT) / IUNIT))
* iy = 0: nint(65536 * log2(max(s_eff * gds0, IUNIT) / IUNIT)) gds0 = the output conductance ngspice reports at Vds = 0, the limit of Id / F there.
* Index ix * 49 + iy, ix outer, 4753 rows. The PMOS is read at Vsg = 1.5 V - Vgp and Vsd = 1.5 V - Vdp, source and bulk on the 1.5 V rail, the same words.
* What it prints. Between "BEGIN name" and "END name" every row "<index> TAB <value>" is one number, in sweep order (the first sweep source runs fastest).
* The values are pasted into the spec in that order, none changed.
* lam_n, lam_p the 4753 words of the NMOS and of the PMOS (as above); r_n, r_p rv at Vgs = ix * 15.625 mV, 97 rows each.
* cen_n, cen_p Id in pA (nint(Id * 1e12)) at 1000 held-out points that are CENTRES of cells of this grid, the places a chord of it is worst: point k = 1..1000 is
* Vgs (Vsg) = (floor(96 frac(k a1)) + 1/2) * 15.625 mV and Vds (Vsd) = (floor(48 frac(k a2)) + 1/2) * 31.25 mV, a1 = 0.7548776662466927, a2 = 0.5698402909980532.
* nmos table device: drain VDN, gate VGN, source and bulk at 0 V
.lib $IHP_PDK/ihp-sg13g2/libs.tech/ngspice/models/cornerMOSlv.lib mos_tt
VDN dn 0 0
VGN gn 0 0
XMN dn gn 0 0 sg13_lv_nmos w=1.0u l=0.45u ng=1 m=1
* pmos table device: source and bulk at the 1.5 V rail, drain VDP and gate VGP, both swept downward from 1.5 V
VSP sp 0 1.5
VDP dp 0 1.5
VGP gp 0 1.5
XMP dp gp sp sp sg13_lv_pmos w=3.0u l=0.45u ng=1 m=1
* held-out points: B sources compute the cell centre from the sweep variable k; the zero-volt sources VRDN, VRDP measure the drain current
VK k 0 1
BRGN rgn 0 V = (floor(96*(v(k)*0.7548776662466927-floor(v(k)*0.7548776662466927)))+0.5)*0.015625
BRDN rdn0 0 V = (floor(48*(v(k)*0.5698402909980532-floor(v(k)*0.5698402909980532)))+0.5)*0.03125
VRDN rdn0 rdn 0
XRN rdn rgn 0 0 sg13_lv_nmos w=1.0u l=0.45u ng=1 m=1
BRGP rgp 0 V = 1.5-(floor(96*(v(k)*0.7548776662466927-floor(v(k)*0.7548776662466927)))+0.5)*0.015625
BRDP rdp0 0 V = 1.5-(floor(48*(v(k)*0.5698402909980532-floor(v(k)*0.5698402909980532)))+0.5)*0.03125
VRDP rdp rdp0 0
VRSP rsp 0 1.5
XRP rdp rgp rsp rsp sg13_lv_pmos w=3.0u l=0.45u ng=1 m=1
.temp 27
.options reltol=1e-6 vntol=1e-9 abstol=1e-14
.control
pre_osdi $IHP_OSDI/psp103.osdi
pre_osdi $IHP_OSDI/psp103_nqs.osdi
set numdgt=10
set noprintscale
save all @n.xmn.nsg13_lv_nmos[gds] @n.xmp.nsg13_lv_pmos[gds]
* the output conductance at Vds = 0 at the 97 gate nodes, and the gate scale and its word there (the same for both devices); plots dc1 (nmos) and dc2 (pmos)
alter VDN = 0
dc VGN 0 1.5 0.015625
let gzn = @n.xmn.nsg13_lv_nmos[gds]
let kk = vector(97)
let vgk = kk * 0.015625
let ovk = (vgk - 0.23 + abs(vgk - 0.23)) / 2
let sk = sqrt(0.03 * 0.03 + 0.65 * 0.65 * ovk * ovk)
let rk = nint(4096 / sk)
let sek = 4096 / rk
let an = gzn * sek
let zn = (an + 1.1641532182693481e-12 + abs(an - 1.1641532182693481e-12)) / 2
let l0n = nint(65536 / ln(2) * ln(zn / 1.1641532182693481e-12))
alter VDP = 1.5
dc VGP 1.5 0 -0.015625
let gzp = @n.xmp.nsg13_lv_pmos[gds]
let kk = vector(97)
let vgk = kk * 0.015625
let ovk = (vgk - 0.23 + abs(vgk - 0.23)) / 2
let sk = sqrt(0.03 * 0.03 + 0.65 * 0.65 * ovk * ovk)
let rk = nint(4096 / sk)
let sek = 4096 / rk
let ap = gzp * sek
let zp = (ap + 1.1641532182693481e-12 + abs(ap - 1.1641532182693481e-12)) / 2
let l0p = nint(65536 / ln(2) * ln(zp / 1.1641532182693481e-12))
echo BEGIN r_n
print rk
echo END r_n
echo BEGIN r_p
print rk
echo END r_p
* the NMOS grid
alter VDN = 0
dc VDN 0 1.5 0.03125 VGN 0 1.5 0.015625
let vgn = v(gn)
let vdn = v(dn)
let ovn = (vgn - 0.23 + abs(vgn - 0.23)) / 2
let sn = sqrt(0.03 * 0.03 + 0.65 * 0.65 * ovn * ovn)
let rn = nint(4096 / sn)
let fn = 1 - exp(0 - vdn * rn / 4096)
let idn = 0 - i(VDN)
let qn = (idn + abs(idn)) / 2
let jn = qn / (fn + 1e-30)
let mn = (jn + 1.1641532182693481e-12 + abs(jn - 1.1641532182693481e-12)) / 2
let lamn = nint(65536 / ln(2) * ln(mn / 1.1641532182693481e-12))
let k = 0
while k < 97
let lamn[k*49] = dc1.l0n[k]
let k = k + 1
end
echo BEGIN lam_n
print lamn
echo END lam_n
* the PMOS grid
alter VDP = 1.5
dc VDP 1.5 0 -0.03125 VGP 1.5 0 -0.015625
let vgp = 1.5 - v(gp)
let vdp = 1.5 - v(dp)
let ovp = (vgp - 0.23 + abs(vgp - 0.23)) / 2
let sp = sqrt(0.03 * 0.03 + 0.65 * 0.65 * ovp * ovp)
let rp = nint(4096 / sp)
let fp = 1 - exp(0 - vdp * rp / 4096)
let idp = i(VDP)
let qp = (idp + abs(idp)) / 2
let jp = qp / (fp + 1e-30)
let mp = (jp + 1.1641532182693481e-12 + abs(jp - 1.1641532182693481e-12)) / 2
let lamp = nint(65536 / ln(2) * ln(mp / 1.1641532182693481e-12))
let k = 0
while k < 97
let lamp[k*49] = dc2.l0p[k]
let k = k + 1
end
echo BEGIN lam_p
print lamp
echo END lam_p
echo BEGIN cen_n
dc VK 1 1000 1
let u = nint(i(VRDN) * 1e12)
print u
echo END cen_n
echo BEGIN cen_p
let u = nint(i(VRDP) * 1e12)
print u
echo END cen_p
.endc
.end
Loading
Loading