• 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. verilog-a model help

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 126
  • Views 16801
  • 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

verilog-a model help

SatendraMaurya
SatendraMaurya over 7 years ago

Hi,

I am new to verilogA. I am looking for veriloga code that generates a text output whenever gate of any transistor pmos or nmos rises to a file.

Satendra

  • Cancel
  • Dimitra Papazoglou
    Dimitra Papazoglou over 7 years ago

    Hi Satendra,

     You can use the $fstrobe, $fdisplay, $fwrite function to write to a file. You'll need to use the $fopen function first to create the file. For more details look at the 'Writing to a File' section in module 9 in the 'Cadence Verilog-A Language Reference'. There is also a simple example there. I'm posting the link from the support site below:

    https://support.cadence.com/apex/techpubDocViewerPage?xmlName=veriaref.xml&title=Cadence%20Verilog-A%20Language%20Reference%20--%209%20-%20Writing%20to%20a%20File&hash=1038148&c_version=18.1&sq=005d0000002mxbiAAA_2018823143047383&path=veriaref/veriaref18.1/chap9.html#1038148

    Regards,

    Dimitra

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SatendraMaurya
    SatendraMaurya over 6 years ago in reply to Dimitra Papazoglou

    Hi Dimitra,

    How to get the gate voltage for a transistor. In spice v2(xi0.xi2.xileft.mn6) works but veriloga does not understand v2. So how can I get the gate voltage of a transistor in the hierarchy.

    Satendra

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to SatendraMaurya

    Your question is rather open-ended and lacking in context. I'm guessing you want to use the $cds_get_analog_value (which can be abbreviated to $cgav). See the documentation for more details.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SatendraMaurya
    SatendraMaurya over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    I have this in the veriloga code

    @(cross(V(sig)-(ref_vdd/2), +1)) begin
    $fstrobe(fptr, "%s: at t = %E s.\n",signal_name, $abstime );
    end

    where sig is passed as: I0.IBANK\<3\>.ICTRL.I12.MNA1

    which is a transistor instance. Now the function should evaluate based on the voltage of this transistor. In hspice v2(I0.IBANK\<3\>.ICTRL.I12.MNA1) gives the gate voltage but verilogA only has v(sig).

    Not sure how to use $cgav to get this done.

    Satendra

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to SatendraMaurya

    Hi Satendra,

    Which simulator are you using, by the way? You refer to HSPICE, so if you are, the $cgav function is probably not going to help you anyway. If using spectre, you'd give the hierarchical path to the node connected to the gate of the transistor, rather than just the name of the transistor itself and having a function look at the voltage on the second pin.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • drdanmc
    drdanmc over 6 years ago in reply to SatendraMaurya

    Just as a note, the @(cross()) event is important because it will influence the simulator timestep near the crossing but the value you get for $abstime will be slightly past the actual crossing.  It is better to last_crossing() to get the actual (well, interpolated) crossing time (but keep the @(cross()) event which helps the simulator know that you have an interest in an event near there and helps with timestep control.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SatendraMaurya
    SatendraMaurya over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    I am using Spectre so the node name works. I am able to probe. Just wondering there is not way to get the trasistor gate node name in verilogA. Reason being we may switch simulator later and then will have to rework this all over again. I am surprised how is v2() able to give me info. Is there a way to debug the code that runs v2(). I am sure v2() is calling v() along with some more param that enable it to measure the gate voltage.

    Satendra

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SatendraMaurya
    SatendraMaurya over 6 years ago in reply to drdanmc

    Hi drdanmc,

    I am confused. You suggested to use both cross() and last_cross(). But I only have one usage in my code. Do you mind correcting the code and send it back.

    Satendra

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to SatendraMaurya

    There is no equivalent of v2() in VerilogA (regardless of the simulator). The v2() you are thinking of is an HSPICE netlist construct. You can do the same thing in Spectre using (for example):

    simulator lang=spice
    .probe v2(MP1)

    However, as I said, there's no v2 in the VerilogA language. You are mixing up the V() access function in VerilogA with the V function in the SPICE netlist language - they are not the same thing.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • SatendraMaurya
    SatendraMaurya over 6 years ago in reply to Andrew Beckett

    Thanks for the clarification Andrew. Will talk to the pdk guys about the terminal naming?

    Satendra

    • 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