Logo von Openvaf

Openvaf

Community
Arcadia-1
openvaf

Compile Verilog-A device models with OpenVAF and simulate them in ngspice via OSDI. Use this skill whenever the user wants to: compile a .va file, run a Verilog-A model in ngspice, use OpenVAF, load an OSDI model, test a compact device model, or set up the OpenVAF + ngspice toolchain. Also use when the user mentions OSDI, compact models, BSIM, PSP, HICUM, or wants to simulate custom MOSFET/BJT/diode/varactor models written in Verilog-A. Complements the `veriloga` writing skill and the `ngspice` simulation skill.

Übersicht

HerausgeberArcadia-1
Repositoryveriloga-skills
Skill-Nameopenvaf
Sterne
39
Forks
13
Mitgelieferte Dateien
18
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 18 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von Arcadia-1 auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Openvaf in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/Arcadia-1/veriloga-skills/tree/main/openvaf
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Arcadia-1/veriloga-skills.git /tmp/veriloga-skills
mkdir -p .claude/skills
cp -r /tmp/veriloga-skills/openvaf .claude/skills/openvaf
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Openvaf in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Openvaf automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Openvaf nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

OpenVAF + ngspice: Compile and Simulate Verilog-A Models

This skill covers the full flow: write a Verilog-A compact model → compile it with OpenVAF → load the compiled .osdi plugin in ngspice → run simulations.

Scope: What OpenVAF Can and Cannot Compile

OpenVAF implements the analog subset of the Verilog-AMS LRM 2.4.0. It is designed for compact device models (MOSFETs, BJTs, diodes, varactors, resistors, capacitors) — the kind of models that define I-V and C-V relationships.

Supported features

  • analog begin / end blocks
  • I(), V() branch access, <+ contributions
  • ddt(), idt(), idtmod(), ddx()
  • $vt, $temperature, $abstime
  • @(initial_step), @(final_step)
  • $strobe, $display, $bound_step
  • limexp(), ln(), exp(), sqrt(), pow(), abs(), min(), max()
  • $param_given(), parameter ranges
  • Noise: white_noise(), flicker_noise()
  • All math from constants.vams

NOT supported (will cause compile errors)

FeatureWhy
@(cross(...))Event monitoring — behavioral, not compact-model
@(above(...))Same reason
Named events, or-combined eventsSame reason
Arrays inside modules (integer A[0:7])Not implemented
genvar / generate loopsNot implemented
Arithmetic shift (<<<, >>>)Not implemented, no plans to add
Digital / mixed-signal constructsAnalog subset only

Bottom line: If your .va file uses @(cross), arrays, or genvar, it is a behavioral model and cannot be compiled with OpenVAF. Use a full Verilog-AMS simulator (Cadence AMS, Synopsys HSPICE, Mentor AFS) instead. The veriloga skill covers writing both behavioral blocks and compact models; this skill covers compiling and simulating the compact-model subset.


1. Installation

OpenVAF (the compiler)

Read references/install.md for detailed step-by-step instructions for Windows and Linux. The short version:

  1. Download the prebuilt binary from https://openvaf.semimod.de/download/
    • Windows: rename the downloaded file to openvaf.exe
    • Linux: make executable with chmod +x
  2. Place on PATH (e.g., C:\tools\ on Windows, /usr/local/bin/ on Linux)
  3. Windows only: install Microsoft Visual C++ Build Tools ("Desktop development with C++" workload) — OpenVAF needs the MSVC linker
  4. Verify: openvaf --help should print usage info

ngspice (the simulator)

Requires ngspice 39 or later for OSDI support. Read the ngspice skill for general ngspice setup, or see references/install.md for the OSDI-specific parts.


2. The Workflow

  .va file ──→ openvaf ──→ .osdi file ──→ ngspice loads it ──→ simulation

Step 1: Compile

On Linux (or if MSVC is in PATH):

bash
openvaf mymodel.va

On Windows, the MSVC linker environment must be loaded first. Use this one-liner from any shell:

bash
cmd.exe /c "call \"C:\Program Files (x86)\Microsoft Visual Studio\<ver>\BuildTools\VC\Auxiliary\Build\vcvarsall.bat\" x64 >nul 2>&1 & openvaf.exe mymodel.va"

Replace <ver> with your VS version (e.g., 18, 2022). Without this, OpenVAF crashes because it can't find the MSVC link.exe.

Produces mymodel.osdi in the same directory. Compilation typically takes under 1 second for simple models.

Step 2: Write an ngspice netlist that loads the model

spice
* Test circuit for mymodel
V1 in 0 DC 1.0

.control
pre_osdi mymodel.osdi
dc V1 0 5 0.01
plot -i(V1)
.endc

.model m1 mymodel paramA=1.0 paramB=2.0
Nr1 in 0 m1

.end

Step 3: Run

bash
ngspice test.spice

3. Netlist Rules for OSDI Models

These rules are specific to OSDI-loaded models in ngspice. Getting any of them wrong causes cryptic errors.

Rule 1: Use pre_osdi, not osdi

The pre_ prefix tells ngspice to load the model before parsing the netlist. Without it, ngspice won't recognize the model type and will fail.

spice
.control
pre_osdi mymodel.osdi
.endc

Rule 2: Instance names start with N

All OSDI device instances must have names beginning with the letter N:

spice
Nr1 in out mymod            ✓ correct
Nq1 col base emit sub mymod ✓ correct
R1  in out mymod            ✗ wrong — ngspice treats it as a built-in resistor
M1  d g s b mymod           ✗ wrong — ngspice treats it as a built-in MOSFET

Rule 3: .model uses the exact Verilog-A module name

The .model statement must reference the exact module name from the .va source:

verilog
// In myresistor.va:
module myresistor(p, n);    // ← this name
spice
.model r1k myresistor r=1000    ✓ matches module name
.model r1k resistor r=1000      ✗ wrong — conflicts with ngspice built-in

Rule 4: Avoid module names that clash with ngspice built-ins

Do NOT name your module resistor, capacitor, inductor, diode, nmos, pmos, npn, pnp, or other ngspice built-in type names. Use a unique name like myresistor, custom_diode, nmos_sq, etc.

Rule 5: Path resolution for .osdi files

Path styleResolves from
pre_osdi mymodel.osdingspice's lib/ngspice/ directory
pre_osdi ./mymodel.osdiNetlist directory
pre_osdi /abs/path/mymodel.osdiAbsolute path

For portable projects, keep the .osdi file next to the netlist and use ./.


4. Complete Examples

Example A: Simple resistor

See assets/example_resistor.va and assets/test_resistor.spice for the complete files. This is the simplest possible round-trip: a two-terminal resistor model.

Example B: Square-law MOSFET

See assets/example_mosfet.va and assets/test_mosfet.spice for a basic MOSFET with linear/saturation regions and body effect — demonstrates a 4-terminal device.

Example C: Voltage-dependent capacitor (varactor)

See assets/example_varactor.va and assets/test_varactor.spice for a C(V) model using ddt() — demonstrates dynamic (charge-based) modeling.


5. Troubleshooting

Read references/troubleshooting.md for a comprehensive list. The most common issues:

SymptomCauseFix
Library couldn't be loadedWrong path to .osdiUse ./mymodel.osdi for relative path
unrecognized parameterpre_osdi missing or after netlistMove pre_osdi into .control block
Instance ignored silentlyName doesn't start with NRename to N... prefix
LINK: fatal error on compileMissing MSVC Build Tools (Windows)Install "Desktop development with C++"
Crash / Illegal instructionMissing VC++ runtimeInstall "Microsoft Visual C++ Redistributable"
Module name conflictModule named resistor etc.Rename to unique name

6. Pre-compiled Model Library

The VA-Models repository provides pre-compiled .osdi files for standard compact models (BSIM-CMG, PSP, HICUM, EKV, MEXTRAM, etc.) for both Windows and Linux, ready for ngspice 39+. Consider using these instead of compiling from source when working with standard models.


Further Reading

  • references/install.md — Detailed installation instructions
  • references/troubleshooting.md — Extended troubleshooting guide
  • references/supported_features.md — Full feature support table
  • assets/ — Complete example files ready to compile and run

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Openvaf?

Compile Verilog-A device models with OpenVAF and simulate them in ngspice via OSDI. Use this skill whenever the user wants to: compile a .va file, run a Verilog-A model in ngspice, use OpenVAF, load an OSDI model, test a compact device model, or set up the OpenVAF + ngspice toolchain. Also use when the user mentions OSDI, compact models, BSIM, PSP, HICUM, or wants to simulate custom MOSFET/BJT/diode/varactor models written in Verilog-A. Complements the `veriloga` writing skill and the `ngspice` simulation skill.

Warum Openvaf in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Openvaf besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Openvaf in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/Arcadia-1/veriloga-skills/tree/main/openvaf ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Openvaf nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Openvaf verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Openvaf damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Openvaf kostenlos?

Der Skill wird von Arcadia-1 auf GitHub veröffentlicht. Die Lizenzbedingungen finden Sie im Repository. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇