• 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. Custom IC Design
  3. How to plot the verilogA module data points using OCEAN

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 129
  • Views 16448
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to plot the verilogA module data points using OCEAN

RFStuff
RFStuff over 12 years ago

 Dear All,

I used a verilogA module in my schematic which measures the period of the output  waveform of a block.

The verilogA code is as follows:-

`include "disciplines.vams"

(*instrument_module*)
module frequency_meter(in);
    parameter real thresh=0;    // threshold (V)
    parameter integer dir = 1 from [-1:1] exclude 0;
                // 1 for rising edges, -1 for falling
    input in;
    voltage in;
    integer timing;
    real t0, t, period, freq;
    analog begin
    t = last_crossing(V(in) - thresh, dir);
    @(cross(V(in) - thresh, dir)) begin
        if (timing) begin
        period = t - t0;
        freq = 1/period;
        $strobe("period = %rs (measured at %rs).\n", t - t0, $abstime);
        end
        t0 = t;
        timing = 1;
    end
    end
endmodule

 

I want to plot freq versus time  using OCEAN script.

Can anybody please tell how it can be done.

I did :

save I5:period I5:freq
plot(I5:freq).

This gives error in OCEAN script.

But in input.scs file I worte:-

save I5:period I5:freq 

I ran the simulation and in the wavescan I was able to plot freq-vs-time.

 

 

 

Kind Regards,

 

 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    blowup won't, abstol might. Depends on what frequencies you're dealing with - ideally abstol should be about a millionth of a typical frequency that is being measured.

    Also, the transition time should not be excessively sharp if the frequency is low. Or it may be too short - I don't know what frequency ranges you're dealing with.

    Regards,

    Andrew. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    blowup won't, abstol might. Depends on what frequencies you're dealing with - ideally abstol should be about a millionth of a typical frequency that is being measured.

    Also, the transition time should not be excessively sharp if the frequency is low. Or it may be too short - I don't know what frequency ranges you're dealing with.

    Regards,

    Andrew. 

    • Cancel
    • Vote Up 0 Vote Down
    • 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