• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Mixed-Signal Design
  3. Simulation of VerilogA model of a VCO ?

Stats

  • Replies 4
  • Subscribers 64
  • Views 153
  • Members are here 0

Simulation of VerilogA model of a VCO ?

PE202503078250
PE202503078250 14 hours ago

I'm using a very simple verilogA model of a VCO and running HB as well as PSS simulations, but neither of them converge. However, the transient simulation runs. 
Is there some simulation engine specific reason behind this or are there some specific settings to be used ?

  • Cancel
  • Sign in to reply
Parents
  • Andrew Beckett
    Andrew Beckett 14 hours ago

    Can you share the model? The common mistake is for the phase not to be periodic, which is solvable using idtmod rather than idt - but seeing the model would really help here.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • PE202503078250
    PE202503078250 13 hours ago in reply to Andrew Beckett

    Hi Andrew, thanks for the reply. Below given is the VerilogA model


    module VCO(out_p, out_n, Vtp, Vtn, tail);

    inout out_p, out_n; // Differential outputs
    input Vtp, Vtn; // Differential tuning voltage


    electrical out_p, out_n, Vtp, Vtn, tail;

    // ============================
    // Parameters
    // ============================
    parameter real fvco = 4.5e9; // Center frequency in Hz
    parameter real Kvco = 1.0e6; // VCO gain in Hz/V
    parameter real Vout_CM = 0.8; // Output common-mode voltage (V)
    parameter real Avco = 0.5; // Differential peak amplitude (V)

    // ============================
    // Internal variables
    // ============================
    real freq, phase;
    real Vctrl_diff;

    analog begin
    // Compute differential tuning voltage
    Vctrl_diff = V(Vtp) - V(Vtn);

    // Frequency as function of control voltage
    freq = fvco + Kvco * Vctrl_diff;

    // Integrate frequency to get phase (rad)
    phase = 2 * `M_PI * idt(freq, 0.0);

    // Output differential sine wave
    V(out_p) <+ Vout_CM + Avco * sin(phase);
    V(out_n) <+ Vout_CM - Avco * sin(phase);
    end

    endmodule

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 13 hours ago in reply to PE202503078250

    If you change the line:

    phase = 2 * `M_PI * idt(freq, 0.0);

    to

    phase = 2 * `M_PI * idtmod(freq, 0.0, 1);

    Then it will converge with PSS. The issue with the original was that the phase keeps increasing and so there's no periodic solution.

    The problem, however, is that idtmod is not supported in harmonic balance. Somehow I'd not noticed that - let me do some digging (I found an internal request on this but no clear outcome).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Andrew Beckett
    Andrew Beckett 12 hours ago in reply to Andrew Beckett

    I'd also suggest you add:

    $bound_step(1/freq/20);

    to the model to force a few more time steps per period. The dynamic timestep control tends to need a bit of a clue with oscillator models as other things in the circuit may not be enough to cause the time steps to be small enough to follow the output properly.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett 12 hours ago in reply to Andrew Beckett

    I'd also suggest you add:

    $bound_step(1/freq/20);

    to the model to force a few more time steps per period. The dynamic timestep control tends to need a bit of a clue with oscillator models as other things in the circuit may not be enough to cause the time steps to be small enough to follow the output properly.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information