Skip to content
Beta.va@modelscript/verilog-a 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Co-sim / Export
Projections Modelica, SPICE
Live ExampleNonlinearMemristor.va

Verilog-A Compact Semiconductor & Memristive Device Model

Behavioral analog compact model formulating KCL branch current contributions and internal state charge derivatives across electrical terminals.

Playground
Source (17 lines)
1`include "disciplines.vams"
2 
3module nonlinear_diode_rc(anode, cathode);
4  inout anode, cathode;
5  electrical anode, cathode;
6 
7  parameter real Is = 1.0e-14 from (0:inf);
8  parameter real Vt = 0.02585 from (0:inf);
9  parameter real Rs = 12.5    from (0:inf);
10  parameter real Cj = 2.4e-12 from [0:inf);
11 
12  analog begin
13    I(anode, cathode) <+ Is * (limexp(V(anode, cathode) / Vt) - 1.0);
14    I(anode, cathode) <+ V(anode, cathode) / Rs;
15    I(anode, cathode) <+ Cj * ddt(V(anode, cathode));
16  end
17endmodule
Verilog-A Terminal & Analog Branch Schematic
«electrical_port» Terminal: anode «analog_i» Shockley PN Branch «kcl contribution» I <+ Is*(limexp(V/Vt) - 1) «analog_i» Ohmic Conductance «kcl contribution» I <+ V(anode,cathode) / Rs «analog_ddt» Depletion Capacitance «dynamic charge» I <+ Cj * ddt(V) «electrical_port» Terminal: cathode
Drag to pan · Click % to reset

Verilog-A & Verilog-AMS Compact Modeling (.va, .vams) ​

@modelscript/verilog-a (languages/verilog-a) provides compiler, analog behavioral simulation, continuous DAE lowering, and SPICE netlist export for the IEEE 1857 Verilog-A and Verilog-AMS analog compact modeling language.


Supported Extensions & Standards ​

ExtensionStandard / FormatDescription
.vaIEEE 1857 / OVI Verilog-AContinuous-time analog behavioral hardware description language
.vamsAccellera Verilog-AMSMixed-signal analog/digital compact device modeling

Key Capabilities ​

1. Analog Behavioral Disciplines & Natures ​

  • Native support for physical disciplines and cross-domain nature definitions:
    • Electrical: Potential Voltage (V), Flow Current (I).
    • Thermal: Potential Temperature (T), Flow Power (P).
    • Rotational / Mechanical: Potential Angle (θ), Flow Torque (τ).
  • Supports branch formulation, reference nodes (ground), and conservative multi-port Kirchhoff networks.

2. Analog Contribution Statements & Dynamic Operators ​

  • Full evaluation of continuous-time analog contribution operators (<+):I(p,n)<+Isat(exp⁡(V(p,n)nVt)−1)+ddt(CjV(p,n))
  • Dynamic Operators: Time derivative ddt(x), time integration idt(x), transport delay absdelay(x, td), and transition filters.
  • Transistor Compact Models: Enables high-speed simulation of BSIM, EKV, diode, and custom micro-electro-mechanical (MEMS) behavioral models.

3. Direct DAE Lowering ​

  • Lowers continuous behavioral equations, branch relations, and small-signal Jacobians directly into @modelscript/runtime's DAEBuilder linear memory arena.
  • Eliminates intermediate C-code generation or proprietary simulator compiling steps.

4. Polyglot Projections ​

  • Modelica (verilogAToModelica): Translates Verilog-A modules into acausal Modelica.Electrical.Analog component classes.
  • SPICE (verilogAToSpice): Generates equivalent SPICE subcircuit netlists (.subckt) with nonlinear behavioral voltage/current sources (B-sources).

Static Analysis & Device Modeling Linter Rules ​

The Verilog-A linter detects compact modeling bugs and numerical convergence pitfalls:

10 rules6 error4 warning Run with msx verilog-a lint

CodeRuleSeverityMessage
M7601unassigned-analog-brancherrorElectrical port pair '<p>' and '<n>' has no constitutive branch equation in analog block.
M7602discontinuous-derivative-expressionwarningDiscontinuous time-derivative operator '<func>()' used inside conditional branch statement.
M7603invalid-parameter-rangeerrorParameter '<name>' default value <val> violates declared range '<range>'.
M7604unbounded-exponential-growthwarningUnbounded exponential function 'exp()' used instead of safe 'limexp()' in '<ctx>'.
M7605port-discipline-mismatcherrorPort '<port>' has no declared discipline or mismatch with module domain.
M7606undefined-node-referenceerrorBranch access '<branch>' references undeclared node '<node>'.
M7607duplicate-module-declarationerrorDuplicate module declaration for '<name>'.
M7608zero-resistance-brancherrorPotential contribution '<branch>' forms an unconstrained ideal short-circuit.
M7609floating-internal-nodewarningInternal node '<node>' is declared but never referenced in any analog branch equation.
M7610unsupported-analog-primitivewarningUnsupported or deprecated analog primitive '<primitive>'.

Generated from languages/verilog-a/src/lints/rules.ts. All languages →


CLI Usage ​

bash
# Lint a Verilog-A semiconductor device model
msx verilog-a lint MOS_Transistor.va

# Lower analog behavioral equations to ModelScript linear DAE arena
msx verilog-a to-dae MOS_Transistor.va --out=transistor.dae.json

# Project into standard Modelica 3.x acausal analog component
msx verilog-a to-modelica MOS_Transistor.va -o MOS_Transistor.mo

# Export to SPICE subcircuit with nonlinear behavioral sources
msx verilog-a to-spice MOS_Transistor.va -o MOS_Transistor.sub

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy