• 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. detecting process corner from within verilogA model

Stats

  • Locked Locked
  • Replies 20
  • Subscribers 127
  • Views 23664
  • 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

detecting process corner from within verilogA model

SoniaMK
SoniaMK over 7 years ago

Hello,

I need to create a model of a current source in verilogA but the value of the current depends also on the process corner. Is there a way for the verilogA model to detect what corner the simulation runs with? In ADEL we specify the corners through an include statement like this:

include <model file> section=typical

Thanks

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    I would suggest you have a parameter that is set in the corners (i.e. a global variable), and then pass that as an instance parameter to your Verilog-A model.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SoniaMK
    SoniaMK over 7 years ago
    Thanks, Andrew, for replying. If I understand correctly your suggestion, it is to include a parameter in the model deck indicating the corners. Unfortunately, I can't touch the model files as they come from the foundry and are not supposed to be edited.

    Regards
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    There's nothing to stop you defining your own wrapper around the foundry files which does something like this:

    library mylib
    section NN
    parameter corner=1
    include "foundry.scs" section=NN
    endsection NN

    section FF
    parameter corner=2
    include "foundry.scs" section=FF
    endsection FF

    endlibrary mylib

    Something like that... then you can include your wrapper around the foundry models and don't have to touch the foundry models in any way. 

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SoniaMK
    SoniaMK over 7 years ago
    Understand. Thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • HoWei
    HoWei over 7 years ago in reply to Andrew Beckett

    The correct Syntax would be "parameters"  - in Andrews example the "s" is missing.

    It took me quit a while to figure out why it was not working.

    Here is the correct Syntax (that is working in my modelfiles at least):

    library mylib
    section NN
    parameters corner=1
    include "foundry.scs" section=NN
    endsection NN

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago in reply to HoWei

    HoWei said:

    The correct Syntax would be "parameters"  - in Andrews example the "s" is missing.

    Apologies - I just typed it in (probably on my phone) and didn't check it...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ElZorro
    ElZorro over 7 years ago

    Thank you, I am following this thread because I need to implement the same and I have a question.

    I have created a file called "wrapper.scs" which looks exaclty like this:

    library wrapper
    section NN
    parameters corner=1
    include "gpdk.scs" section=NN
    endsection NN

    section FF
    parameters corner=2
    include "gpdk.scs" section=FF
    endsection FF

    endlibrary wrapper

    In ADE-L I select Setup/Model-Libraries/
    then I select the path to the model file "wrapper.scs" and I can select between the two sections "NN" and "FF" (the original file gpdk.scs has more sections). So this part is working fine.

    My question is how to read the value of the parameter "corner" into the veriloga model. I am lost here.

    Thank you very much!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Saloni Chhabra
    Saloni Chhabra over 7 years ago in reply to ElZorro

    You can create a parameter in your veriloga model e.g. parameter real getcorner = 1; .  Based on the value of of 'getcorner', you can code the functionality in verilogA model using if/else.

    Then when you instantiate the model, you can pass it the value of 'corner' (coming from models) as:

     I0 (x y z) cellA getcorner=corner

    ahdl_include "/path/to/cellA.va"

    Regards,

    Saloni

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ElZorro
    ElZorro over 7 years ago in reply to Saloni Chhabra

    Hi Saloni,

    thank you for your reply.

    Implementing the functionality in the verilogA model using the value of the parameter and if/else is clear.

    My question is how to pass the value from the "wrapper.scs" to the verilogA model?

    This is my file "wrapper.scs":

    library wrapper
    section NN
    parameters corner=1
    include "gpdk.scs" section=NN
    endsection NN

    section FF
    parameters corner=2
    include "gpdk.scs" section=FF
    endsection FF

    endlibrary wrapper

    This is my model "veriloga.va":

    `include "discipline.h"
    `include "constants.h"
    module inv(A, Y);
    input A;
    output Y;
    electrical A, Y;
    parameter real getcorner=1; // how to pass "corner" from "gpdk.scs" to "getcorner" of "veriloga.va" ???

    endmodule

    When I instantiate the verilogA model (cellview name is "veriloga_read_corner") in the schematic testbench I press Q (properties) and set:

    CDF Parameter of view      veriloga_read_corner

    getcorner                            corner

    But I get following error:

    nchelp ncelab CUBSPA
    ncelab/CUBSPA =
    Assigning a string value to a parameter which is declared to be either
    real or integer is illegal.

    In summary, what I am missing is how to pass the parameter value "corner" defined in "wrapper.scs" to the parameter "getcorner" inside the "veriloga.va" model.

    Thank you very much for your help.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Saloni Chhabra
    Saloni Chhabra over 7 years ago in reply to ElZorro

    I just tried this on a small testcase and here's what I had to do. When you run netlisting from ADE, do you get a design variable called 'corner' added to the state? You can give the default value to 'corner' in ADE state e.g. 1, and then run the simulation. Spectre will then see variable corner being defined more than once, so depending upon your setup, you might get an error for the same parameter being defined twice. To get past that error, you can set Simulation option redefinedparams=warning. The value coming from models will override the value set in ADE. Hope this helps.

    Regards,
    Saloni

    • 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