• 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 increase the precision of signal [Verilog-A problem...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 125
  • Views 9499
  • 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 increase the precision of signal [Verilog-A problem]?

YYLee
YYLee over 3 years ago

I used the compare operator ">" to detect the value that higher than a threshold.

But the value is undesirable ...

For example, the following is code, and the input signal AVDD5 (rising from 0 to 5V):

$display("-------------AVDD5: ", V(AVDD5));
   if(V(AVDD5) > 0.72 && V(AVDD5) < 0.73)begin
       $display("-----------[range]--AVDD5: ", V(AVDD5));
   end
   else if(V(AVDD5) > 0.73 && V(AVDD5) < 0.84) begin
        [do something]
   end

       [do something]
   else begin

   end

The result is 

-------------AVDD5: 0.0063628

-------------AVDD5: 0.0203494

-------------AVDD5: 0.0651065

-------------AVDD5: 0.208329

-------------AVDD5: 0.666642

-------------AVDD5: 1.16764

-------------AVDD5: 1.66865

-------------AVDD5: 2.16965

-------------AVDD5: 2.19

-------------AVDD5: 2.25513

As the mark position, i need the range [0.72, 0.73], [0.73, 0.84]

But the time range is too big (0.666666 -> 1.16764), so the if statement couldn't catch it!

Could anyone help me, thank for you a lot!!!!!

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

    OK, you appear to have edited the post after first submitting it. Anyway, I think what you're saying is that it doesn't trigger those if statements because the change is too rapid. That's because an if() statement doesn't force a timestep in the simulator - and so if the simulator tolerances can be met anyway, it could easily have successive time steps at 0.666 and then 1.67V. If you want to guarantee accurate transitions into each region, you would use the @cross() function to trigger the crossing point. You don't necessarily need to have this in the action of the @cross, you could just do:

    @cross(V(AVDD5)-0.72);
    @cross(V(AVDD5)-0.73);
    @cross(V(AVDD5)-0.84);

    bear in mind though that this will slow down the simulation (if there are a lot of crossings) as it has to take time steps to resolve the crossing point and take additional time steps - you need to determine how accurately you need to resolve this. 

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    OK, you appear to have edited the post after first submitting it. Anyway, I think what you're saying is that it doesn't trigger those if statements because the change is too rapid. That's because an if() statement doesn't force a timestep in the simulator - and so if the simulator tolerances can be met anyway, it could easily have successive time steps at 0.666 and then 1.67V. If you want to guarantee accurate transitions into each region, you would use the @cross() function to trigger the crossing point. You don't necessarily need to have this in the action of the @cross, you could just do:

    @cross(V(AVDD5)-0.72);
    @cross(V(AVDD5)-0.73);
    @cross(V(AVDD5)-0.84);

    bear in mind though that this will slow down the simulation (if there are a lot of crossings) as it has to take time steps to resolve the crossing point and take additional time steps - you need to determine how accurately you need to resolve this. 

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
  • YYLee
    YYLee over 3 years ago in reply to Andrew Beckett

    Thank you! Andrew, I solved the problem with @cross. It is important concepts for me!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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