跳到正文
cccskills
免费在 GitHub 公开

sim

Circuit simulation and pre-fabrication validation. Trigger on: "simulate", "run simulation", "spice", "check stability", "ripple analysis", "phase margin", "power supply simulation", "AC analysis", "transient analysis". Includes automated SPICE simulation via ngspice, RF chain analysis (scikit-rf), power/clock analysis (PyLTSpice), and PCB EM (openEMS FDTD). Run before ordering to validate performance before spending on prototypes.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Auto-Detection

Before running simulations, discover existing projects in the current directory:

python -m circuit_weaver discover --json

If projects are found, select the target project automatically (most recently modified, or ask the user if multiple exist). Use the project's design.yaml and any existing SPICE models in spice_models/ directory.


Quick Start (Automated)

Run automated simulations on any Circuit Weaver design:

# Run all simulations (power, signal, thermal)
python -m circuit_weaver simulate design.yaml -o ./sims

# Run only power supply simulations
python -m circuit_weaver simulate design.yaml -o ./sims --type power

# Fetch SPICE models first, then simulate
python -m circuit_weaver fetch-spice design.yaml
python -m circuit_weaver simulate design.yaml -o ./sims --model-dir ./spice_models

# JSON output for programmatic use
python -m circuit_weaver simulate design.yaml -o ./sims --json

The simulator auto-detects power regulators, filters, and op-amps from the design spec and generates appropriate SPICE netlists + analysis cards.


Three-Layer Stack (Advanced / Manual)

Layer 1 -- RF Chain (scikit-rf)

Cascades S2P files (filters, LNAs, mixers, PCB traces) to compute end-to-end insertion loss, return loss, and noise figure across the signal chain.

import skrf as rf

bpf   = rf.Network("sims/rf/filters/bpf_2450.s2p")
lna   = rf.Network("sims/rf/lna/lna.s2p")
trace = rf.Network("sims/rf/traces/microstrip_50ohm_5mm.s2p")

chain = bpf ** lna ** trace
print(f"IL @ 2.45 GHz: {-chain.s21.db[freq_idx]:.1f} dB")
print(f"NF: {chain.nf(T=290)[freq_idx]:.2f} dB")

S2P sources (priority order):

  1. Vendor-measured data (request from manufacturer -- best)
  2. Datasheet typical curves extracted with WebPlotDigitizer
  3. Synthetic models (document clearly -- mark as unvalidated)

Simulation targets (fill in per project):

Signal pathTargetResult
RX insertion loss< X dBTBD
TX insertion loss< Y dBTBD
Noise figure< Z dBTBD

Layer 2 -- Power / Clock (LTspice / PyLTSpice)

Transient and AC analysis of power supply circuits and clock distribution. Validates regulator stability, output ripple, PDN impedance, and load response.

from PyLTSpice import LTspice

lt = LTspice("sims/power/buck_3v3.asc")
lt.run()
vout = lt.get_trace("V(vout)")
ripple_mv = (vout.max() - vout.min()) * 1000
print(f"Output ripple: {ripple_mv:.1f} mV")

Subcircuits to simulate (fill in per project):

SubcircuitAnalysis typeKey metric
Buck converterTransient + ACRipple < X mV, phase margin > 45 deg
LDOTransientDropout headroom, PSRR
Crystal oscillatorTransientStartup time, frequency accuracy
PDN impedanceACZ < X mohm at operating frequency

SPICE model sources:

  • Manufacturer SPICE models (from product page -- preferred)
  • IBIS models for digital ICs (use ibis2spice if needed)
  • LTspice built-in library for generic models

Layer 3 -- PCB EM (openEMS FDTD)

Full-wave electromagnetic simulation for antenna performance, via transitions, edge coupling, and shielding effectiveness. Most expensive -- run selectively.

Run Layer 3 for:

  • On-board antennas (patch, meandered monopole, chip antenna matching)
  • Via transitions on high-speed interfaces (> 5 Gbps)
  • Near-field coupling characterization between modules
  • Shielding can effectiveness

Skip Layer 3 for:

  • Standard passive components
  • Well-characterized reference designs validated by manufacturer
# openEMS requires platform binary + Python bindings
# See: https://openems.de/start/
python3 sims/em/antenna/run_sim.py

Directory Structure

sims/
  rf/         -- scikit-rf scripts + S2P files
  power/      -- LTspice .asc schematics + PyLTSpice runner scripts
  em/         -- openEMS geometry definitions + run scripts
  results/    -- output plots and summary JSONs (add to .gitignore if large)

Pre-Fab Simulation Checklist

  • Layer 1: All RF paths passing insertion loss targets
  • Layer 1: Noise figure budget within sensitivity requirement
  • Layer 2: All regulators stable (phase margin > 45 deg)
  • Layer 2: Output ripple < specification on all rails
  • Layer 2: PDN impedance < target at operating frequency
  • Layer 3: Antenna efficiency > target (if on-board antenna)
  • Layer 3: Via transitions characterized for high-speed interfaces

Requirements

pip install scikit-rf PyLTSpice
# openEMS: see https://openems.de/start/ for platform-specific install

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

autoroute

免费

Route non-critical nets on a real KiCad PCB or Specctra DSN through Circuit Weaver's fail-closed Freerouting integration. Use after placement and net-class setup when the user requests autorouting, a validated SES session, routing diagnostics, or post-route cleanup. Keep critical power, RF, clock, crystal, switching, and differential nets manual.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

bom

免费

BOM management, sourcing, pricing, export, and fabrication preparation. Load the canonical Circuit Weaver skill from `skills/bom/SKILL.md`.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

bom

免费

Manage an electronics bill of materials across distributors and fabricators: part selection, stock, pricing, alternates, ordering, KiCad properties, and BOM/CPL export. Use for distributor-neutral sourcing, cost comparison, order preparation, or requests such as "what parts do I need" and "export for JLCPCB". Do not take over schematic analysis or a complete new-design workflow unless the requested task is specifically its sourcing/manufacturing stage.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

Create, import, analyze, or resume an end-to-end Circuit Weaver electronic design with durable project state. Load the canonical workflow from skills/circuit-weaver/SKILL.md. Use kicad for one-off file inspection, bom for sourcing, and design-wizard only when explicitly requested.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

Create, import, analyze, resume, or revise an end-to-end Circuit Weaver electronic design from requirements through validated functional KiCad schematics, placement review, and a truthful manufacturing handoff. Use for new designs and for existing KiCad/PCB/Gerber projects that need durable state. Use kicad for one-off file inspection, bom for standalone sourcing, and design-wizard only when the user explicitly requests the slower questionnaire.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

Run the explicit, human-in-the-loop Circuit Weaver questionnaire from requirements through a validated design and KiCad handoff. Use only when the user asks for the design-wizard skill, the offline interactive wizard, or a slow step-by-step guided questionnaire. Do not trigger for ordinary new-design requests; use circuit-weaver for automatic end-to-end orchestration.

中文简介正在准备中。当前显示原文说明。

mattpainter701/kicad_automations202026年10月19日 更新

查看 mattpainter701 的全部技能

报告此技能的问题