• 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. Moving average offset in verilogA

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 126
  • Views 13538
  • 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

Moving average offset in verilogA

jorgevdelacruzN
jorgevdelacruzN over 4 years ago

Hi,

I'm using the "11277434" solution to implement a moving average function on verilogA but the problem is that I'm always getting a different offset on the simulations. Is there any way to cancel this offset? I saw that in the new version of the function for the viva calculator this problem, with the offset, was solved. Unfortunately, I can't migrate the skill code into verilogA. Do you have any suggestions to avoid the offset issue in the verilogA code?

verilogA Code:

parameter    real    gain=1.0;
parameter    real    time_window= 1u from (0:inf);

real x, k1;

analog begin

    @(initial_step) k1 = gain/time_window;

    x    =    k1*(V(in)- absdelay(V(in),time_window));
    V(out) <+  idt(x,0.0);
end
endmodule

  • Cancel
Parents
  • slim15
    slim15 over 3 years ago

    I found the verilogA and also encountered the offset issue. In my application I was able to work around it by first determining the initial offset at time=0 and used it to calculate the integral

    parameter    real    gain=1.0;
    parameter    real    time_window= 1u from (0:inf);

    real x, k1;

    real y0;

    analog begin

        @(initial_step) begin

          k1 = gain/time_window;

         y0 = V(in);

        end

        x    =    k1*(V(in)- absdelay(V(in),time_window));
        V(out) <+  y0 + idt(x,0.0);
    end
    endmodule

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • slim15
    slim15 over 3 years ago

    I found the verilogA and also encountered the offset issue. In my application I was able to work around it by first determining the initial offset at time=0 and used it to calculate the integral

    parameter    real    gain=1.0;
    parameter    real    time_window= 1u from (0:inf);

    real x, k1;

    real y0;

    analog begin

        @(initial_step) begin

          k1 = gain/time_window;

         y0 = V(in);

        end

        x    =    k1*(V(in)- absdelay(V(in),time_window));
        V(out) <+  y0 + idt(x,0.0);
    end
    endmodule

    • 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