Aleksandr SidunVoltage-controlled oscillator model (VCO)
This is a behavioral sinusoidal VCO model where the output frequency varies linearly with the input control voltage, suitable for PLL behavioral simulations, FM modulation testbenches, and VCO gain characterization without a full transistor-level oscillator. Two variants are provided: Model 1 sets the tuning sensitivity directly via Gain_Hz_per_V (Hz/V); Model 2 derives it automatically from a Start_frequency/Stop_frequency tuning range — convenient when the VCO spec is expressed as a bandwidth rather than a gain slope. Shared parameters include DC_offset (output midpoint), Amplitude, and Points_per_period (simulator steps per cycle — increase this for accurate FFT-based phase-noise analysis). The internal $bound_step call adapts the maximum timestep to the instantaneous frequency, ensuring the waveform is correctly resolved even at high frequencies. A typical use-case is the oscillator core in a PLL behavioral model for lock-time or phase-noise co-simulation.
This article contains two models:
Model 1: Gain (V/Hz) is set directly
Model 2: Gain (V/Hz) is set through start/stop frequency
Tunable parameters:
- [1] Gain (in V/Hz) [2] Start/Stop frequency;
- DC offset;
- Amplitude;
- Start frequency;
- Number of points per period - can be useful for FFT simulations etc.
Cell name: vco
Model type: Verilog-A
1// VCO model
2// Contains two models:
3// Model 1: Gain (V/Hz) is set directly
4// Model 2: Gain (V/Hz) is set through start/stop frequency
5// Author: A. Sidun
6// Source: AnalogHub.ie
7
8\`include "constants.vams"
9\`include "disciplines.vams"
10
11// Model 1: Gain (V/Hz) is set directly
12module vco(out,in);
13voltage out,in;
14parameter real Gain_Hz_per_V = 1e6;
15parameter real DC_offset = 1;
16parameter real Amplitude = 1;
17parameter real Points_per_period = 100;
18parameter real Start_freq = 1e6;
19real phase, freq;
20
21analog begin
22freq = Start_freq+Gain_Hz_per_V*V(in);
23phase = idtmod(freq,0,1);
24V(out) <+ DC_offset+Amplitude*cos(2*\`M_PI*phase);
25$bound_step(1/(Points_per_period*freq));
26end
27endmodule
28
29// Model 2: Gain (V/Hz) is set through start/stop frequency
30module vco(out,in);
31voltage out,in;
32parameter real DC_offset = 1;
33parameter real Amplitude = 1;
34parameter real Points_per_period = 100;
35parameter real Start_frequency = 1e6;
36parameter real Stop_frequency = 10e6;
37real phase, freq, gain;
38
39analog begin
40gain = Stop_frequency/Start_frequency;
41freq = Start_frequency+gain*V(in);
42phase = idtmod(freq,0,1);
43V(out) <+ DC_offset+Amplitude*cos(2*\`M_PI*phase);
44$bound_step(1/(Points_per_period*freq));
45end
46endmodule