• 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. VerilogA compiler

Stats

  • Locked Locked
  • Replies 11
  • Subscribers 126
  • Views 19467
  • 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

VerilogA compiler

Sali
Sali over 11 years ago

 Dear all,

I'm using VerilogA model in my design in Cadence, I have some variables in the model that should be changed with time, actually I have two questions:

1- Is there a way to display the value of those variables during the analog simulation? I was looking for VerilogA compiler to test my code first but I didn't find, can some one suggest me a website or any information?

2- The statement of  @(initial_step), does it mean the command after it will be exceuted only one time, which is the begining of the simulation?

 

Thank you in advance,

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    You can use the $strobe or $display (or even $debug) task to display information during simulation. You can also use the "saveahdlvars" option on the Outputs->Save All form in ADE and then you can plot any variables versus time (you'll need to use the results browser to access them) and then you can see how they vary.

    And yes, the Initial_step means that it will execute at the beginning.

    See the VerilogA documentation (Run <MMSIMinstDir>/bin/cdnshelp to bring up the documentation, and you'll be able to find the VerilogA reference manual within that).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sali
    Sali over 11 years ago

     Thank you so much for your help.

    Actually I'm looking also for the potentiometer, I didn't find such a device under any library, any idea? 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    It's not clear to me what the potentiometer model would do - would the control input be a non-electrical discipline describing the angle of turn of the pot, or the ratio through the potential divider? Or would it be a parameter? 

    It doesn't sound terribly difficult to implement (since it's just a potential divider). If it was controlled by a parameter, something like this (completely untested):

    `include "disciplines.vams"

    module potentiometer(PLUS,MINUS,TAP);
    inout PLUS, MINUS, TAP;
    electrical PLUS, MINUS, TAP;
    parameter real ratio = 0.5 from [0:1.0];
    parameter real r = 1k;

    analog begin
      V(PLUS,TAP) <+ I(PLUS,TAP)*(1-ratio)*r;
      V(TAP,MINUS) <+ I(TAP,MINUS)*ratio*r;
    end

    endmodule

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sali
    Sali over 11 years ago

     Thank you so much for your help, I'm going to try this model and see.

    I have one more question please, when I execute the "ddt" operator inside if statenment it gives an error , I need the derivative to be zero as a condition to implement some code, any idea ?

     Thank you again,

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    You should be able to put the ddt outside of the if, and then use the results of it inside the if, possibly to compute a result based on that. Bit difficult to be precise without knowing what you're trying to do. The reason it complains is that the derivative needs to be computed on every iteration of the solver, and if it is placed inside a conditional statement, it would not be executed all the time.

    Regards,

    Andrew. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sali
    Sali over 11 years ago

     Thank you for your reply

    Actually I ran the following and I'm still have the error of "Error found by spectre during AHDL read-in.
        ERROR (VACOMP-1554): "/home/thesis/Chua3/CalculateTheWeightR12/veriloga/veriloga.va", near line 25: Encountered an attempt to access a quantity that depends on a time derivative. The software allows only symbolic use of such quantities. Either remove the need to access this quantity or create an internal node, assign the voltage of the internal node to this quantity, and access the voltage of the internal node.
        ERROR (VACOMP-1816): Exiting AHDL compilation.
    :

     e=0.5*(V(y22,gnd)-standard);
    x=ddt(V(y22,gnd));
    if(x==0)begin
    if(e>0)
    A11=A11-eatah;
    else if(e<0)
    A11=A11+eatah;
    end

     Could you please expalin more how to solve this error.

    Thanks 

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    You didn't give the error, but a guess is that the problem is the assignment to a variable.

    Rather than assigning the result of the ddt to a variable, better to use a contribution statement. So:

    electrical x;

    analog begin
    ...
      V(x) <+ ddt(y22,gnd);
      if(abs(V(x))<1e-5 begin
        ...

    Note that you should never do an == on a floating point number in any language, but particularly in a circuit simulator you might have a number that is numerically very close to zero, but not precisely zero. So as you can see I'm seeing if it is close to zero rather than using ==.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sali
    Sali over 11 years ago

     Thank you for your help.

    It works with me now, but the question is can I use ddt and ddx to model the differential equation? I'm asking this question because ddt gave me unexpected result, I use it to test when the curve reached the stable point (becames fixed to a certain value for the rest of the simulation) so I expected the ddt to be changing until becomes zero when the curve becomes stable but it always gives me 3 althogh the curve is stable after a certain period of time?

    and is there a way to build a model in Cadence using a high level language liek C++?

    Thanks again

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Sali
    Sali over 11 years ago

     Waiting for any feedback please?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Tawna
    Tawna over 11 years ago

    If you would like immediate feedback, please contact Customer Support at http://support.cadence.com .

    The folks who answer questions on this forum do it "outside of their day job".

     

    best regards,

    Tawna

    • 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