• 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 SKILL
  3. Use terminal net name as value for an instance's CDF pa...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 2601
  • 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

Use terminal net name as value for an instance's CDF parameter

dontpanic
dontpanic over 10 years ago

Hi all! I am trying to find a way to use the name of the net that is connected to an instance's terminal, as a string value for one of the instance's CDF parameters. 

In particular, I have a verilog-A component "sample2disk(vIN)" which when instantiated in an schematic samples and dumps to a text file the voltage "vIN" at its input port. This cell has a string parameter "signal_name" which I use to generate the output file name. The component works fine, but currently I need to hard-code the "signal_name" parameter for every instance of this component that I use in an schematic. For example, if I have 2 instances of this component connected to the signals "stage1_vout" and "stage2_vout" in my schematic, then I would need to hard-code these names as values for the corresponding "signal_name" parameters. Instead, I would like to use a skill function that returns automatically these signal names so that they don't not remain hardcoded, allowing for a correct operation when reusing this cell multiple times in an schematic or when copying and pasting across schematics.

I would be really grateful if someone could please help me to figure out how to achieve this behavior (if possible at all).

Thanks in advance for any help!

Cheers,

Jorge.

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

    Hi Jorge,

    This can be done with a custom netlisting procedure. For example, if you have the following VerilogA code:

    // VerilogA for mylib, sample2disk, veriloga

    `include "constants.vams"
    `include "disciplines.vams"

    module sample2disk(vin);
    input vin;
    electrical vin;
    parameter string netname="dummy";
    integer handle;

    analog begin
        @(initial_step) handle=$fopen(netname,"w");
        $fdisplay(handle,$abstime,V(vin));
        @(final_step) $fclose(handle);
    end

    endmodule

    Then you can use this netlist procedure (instructions in the comments as to how to set up the CDF to reference it; because VerilogA normally uses view-specific CDF, you have to use SKILL to change it as there's no UI for it on the Edit CDF form). Then make sure the code is loaded (e.g. from your .cdsinit).

    /* abNetlistSampleToDisk.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 10, 2014 
    Modified   
    By         
    
    Assuming that the veriloga model has a parameter called netname, and a single pin
    
    Do this to set up the view-specific CDF
    
    lib="mylib"
    cell="sample2disk"
    view="veriloga"
    paramName='netname
    almSetParameterList(lib cell remove(paramName almGetParameterList(lib cell ?view view)) ?view view)
    almSetNetlistProcedure(lib cell 'abNetlistSampleToDisk ?view view)
    
    ***************************************************
    
    SCCS Info: @(#) abNetlistSampleToDisk.il 11/10/14.17:16:24 1.1
    
    */
    
    procedure(abNetlistSampleToDisk(inst)
        let((signals )
            nlPrintInst(formatter inst)
            signals=nlGetSignalList(inst)
            nlPrintString(nlGetNetlister(inst) " netname=\"" car(signals) "\"")
        )
    )

    This will netlist ensure that you end up with a lines in the netlist such as:

    I15 (net9) sample2disk netname="net9"
    I14 (out) sample2disk netname="out"

    Hope that helps!

    Kind Regards,

    Andrew.

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

    Hi Jorge,

    This can be done with a custom netlisting procedure. For example, if you have the following VerilogA code:

    // VerilogA for mylib, sample2disk, veriloga

    `include "constants.vams"
    `include "disciplines.vams"

    module sample2disk(vin);
    input vin;
    electrical vin;
    parameter string netname="dummy";
    integer handle;

    analog begin
        @(initial_step) handle=$fopen(netname,"w");
        $fdisplay(handle,$abstime,V(vin));
        @(final_step) $fclose(handle);
    end

    endmodule

    Then you can use this netlist procedure (instructions in the comments as to how to set up the CDF to reference it; because VerilogA normally uses view-specific CDF, you have to use SKILL to change it as there's no UI for it on the Edit CDF form). Then make sure the code is loaded (e.g. from your .cdsinit).

    /* abNetlistSampleToDisk.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 10, 2014 
    Modified   
    By         
    
    Assuming that the veriloga model has a parameter called netname, and a single pin
    
    Do this to set up the view-specific CDF
    
    lib="mylib"
    cell="sample2disk"
    view="veriloga"
    paramName='netname
    almSetParameterList(lib cell remove(paramName almGetParameterList(lib cell ?view view)) ?view view)
    almSetNetlistProcedure(lib cell 'abNetlistSampleToDisk ?view view)
    
    ***************************************************
    
    SCCS Info: @(#) abNetlistSampleToDisk.il 11/10/14.17:16:24 1.1
    
    */
    
    procedure(abNetlistSampleToDisk(inst)
        let((signals )
            nlPrintInst(formatter inst)
            signals=nlGetSignalList(inst)
            nlPrintString(nlGetNetlister(inst) " netname=\"" car(signals) "\"")
        )
    )

    This will netlist ensure that you end up with a lines in the netlist such as:

    I15 (net9) sample2disk netname="net9"
    I14 (out) sample2disk netname="out"

    Hope that helps!

    Kind 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