• 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. Spectre setting for comparator-based PWM

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 14930
  • 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

Spectre setting for comparator-based PWM

greatqs
greatqs over 10 years ago

All,

I'm simulating a circuit with sinusoid being open-loop PWM modulated (natural sampled). Theoretically, the open-loop PWM modulation should be linear (no direct in-band signal harmonics). However, when I did the Spectre simulation with sweeping the reltol parameter, I found the distortion after anti-aliasing filtered and FFT is very big ( < 80dB) highly dependent on reltol with significant numerical noise floor. The THD gets flat (~140dB) until I set 'reltol' to some ridiculous value (method=gear2only, errpreset=conservative, reltol=1e-9).

I suspect this relates to Spectre time step algorithm to handle sharp zero-crossing points with good enough time step "accuracy" as I observed "numerical" jitter before in some frequency divider design which can be workaround by time step algorithm (i.e. LVLTIM) in other simulator.

Does anyone has experience on this and could share some lights?

Thanks,

QS

 

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

    A common cause of distortion in the FFT is caused by interpolation error when you are performing the FFT. Without knowing what the signals look like before you do the FFT, it's hard to know whether this will be the case, but ensuring that you minimise this interpolation error is easily achieved and is not costly.

    In general I would disagree with Shawn's suggestion of controlling maxstep. Forcing maxstep to be small is a good way of slowing the simulation down significantly (whereas tightening the reltol whilst loosening lteratio can tighten accuracy without vastly increasing the number of time steps). If you are reducing the timestep to reduce interpolation error, you would be better off using strobeperiod. If you are using the dft() function in ADE (which is a Fast Fourier Transform, always using a power of two number of points, regardless of the number you specify - it will use a power of two), then setting strobeperiod as a transient option such that the strobe points match the sample points for the FFT will cause the simulator to solve at the points you are sampling rather than them being interpolated between two simulated points either side of the sample point - this can significantly improve the accuracy of what you see in the FFT.

    Normally you only see the strobe points saved, but if you want to see the other points too, you also need to set strobeoutput=all. This isn't on the tran options form (despite it having been available in spectre for a number of releases now - I really must get around to ensuring that gets fixed) - so you have to go to the Misc tab (I think that's what it's called) of the tran options form, and find the field Additional Parameters (might be Additional Arguments), and type in strobeoutput=all.

    In general there aren't many cases where I set maxstep; one of the few is when simulating oscillators - but for most other driven circuits its not necessary or advisable.

    Regards,

    Andrew.

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

    A common cause of distortion in the FFT is caused by interpolation error when you are performing the FFT. Without knowing what the signals look like before you do the FFT, it's hard to know whether this will be the case, but ensuring that you minimise this interpolation error is easily achieved and is not costly.

    In general I would disagree with Shawn's suggestion of controlling maxstep. Forcing maxstep to be small is a good way of slowing the simulation down significantly (whereas tightening the reltol whilst loosening lteratio can tighten accuracy without vastly increasing the number of time steps). If you are reducing the timestep to reduce interpolation error, you would be better off using strobeperiod. If you are using the dft() function in ADE (which is a Fast Fourier Transform, always using a power of two number of points, regardless of the number you specify - it will use a power of two), then setting strobeperiod as a transient option such that the strobe points match the sample points for the FFT will cause the simulator to solve at the points you are sampling rather than them being interpolated between two simulated points either side of the sample point - this can significantly improve the accuracy of what you see in the FFT.

    Normally you only see the strobe points saved, but if you want to see the other points too, you also need to set strobeoutput=all. This isn't on the tran options form (despite it having been available in spectre for a number of releases now - I really must get around to ensuring that gets fixed) - so you have to go to the Misc tab (I think that's what it's called) of the tran options form, and find the field Additional Parameters (might be Additional Arguments), and type in strobeoutput=all.

    In general there aren't many cases where I set maxstep; one of the few is when simulating oscillators - but for most other driven circuits its not necessary or advisable.

    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