part: surface the functional mixed-signal model separately

The `spice` field on a digital part is a power and loading macromodel — it draws
the right quiescent current and cannot shift a bit. Showing it under a single
"SPICE model" heading implies the part is simulatable, which for the digital
parts it was not.

`spice_mixed` is a model that performs the part's actual function, verified by
simulation, and it is now shown as its own section with what was verified and
what is not modelled. The download bundles both, so a deck gets the functional
model and keeps the supply behaviour.
This commit is contained in:
gator 2026-08-16 17:41:49 +00:00
parent 529aa947e1
commit c9e17b4f67

View file

@ -105,7 +105,12 @@ window.ppcbReady(async () => {
${ser}
${pinsList ? `<div class="section"><h3>Pins &amp; pads</h3><div class="pins">${pinsList}</div></div>` : ''}
${(tagList || kr) ? `<div class="section"><h3>Requirement tags</h3><div class="tags">${kr}${tagList}</div></div>` : ''}
${p.spice ? `<div class="section"><h3>SPICE model</h3><details class="more"><summary>show model</summary><pre class="spice">${esc(p.spice)}</pre></details></div>` : ''}
${p.spice_mixed ? `<div class="section"><h3>Mixed-signal model <span class="ok">✓ simulatable</span></h3>
<p style="color:var(--text);line-height:1.6;margin:0 0 8px">${esc(p.spice_mixed_note || '')}</p>
${p.spice_mixed_verified ? `<p class="hint" style="margin:0 0 8px">Verified — ${esc(p.spice_mixed_verified)}</p>` : ''}
${(p.spice_mixed_ports || []).length ? `<p class="hint" style="margin:0 0 8px">.SUBCKT ${esc(p.spice_mixed_subckt || '')} ${esc((p.spice_mixed_ports || []).join(' '))}</p>` : ''}
<details class="more"><summary>show model</summary><pre class="spice">${esc(p.spice_mixed)}</pre></details></div>` : ''}
${p.spice ? `<div class="section"><h3>Supply / loading model</h3><details class="more"><summary>show model</summary><pre class="spice">${esc(p.spice)}</pre></details></div>` : ''}
</div>
</div>`;
@ -121,7 +126,9 @@ window.ppcbReady(async () => {
document.getElementById('dl-all').onclick = async () => {
try { const wrl = await (await fetch(p.model_3d)).text(); dl(`${p.id}.wrl`, wrl); } catch {}
dl(`${p.id}.cir`, `* ${p.mpn} SPICE model — PromptPCB Parts\n${p.spice || ''}\n`);
dl(`${p.id}.cir`, `* ${p.mpn} — PromptPCB Parts\n`
+ (p.spice_mixed ? `* functional mixed-signal model (${p.spice_mixed_subckt})\n${p.spice_mixed}\n\n` : '')
+ (p.spice ? `* supply / loading macromodel\n${p.spice}\n` : ''));
dl(`${p.id}.json`, JSON.stringify(p, null, 2), 'application/json');
};
document.getElementById('lib').onclick = () => {