• 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. How to export netlist for lib cell

Stats

  • Locked Locked
  • Replies 11
  • Subscribers 143
  • Views 17109
  • 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 export netlist for lib cell

saurabh96
saurabh96 over 4 years ago

Hello Guys,

Can anyone explain ..how we can export a netlist for a cell in virtuoso 6.18..

I have made a lib and cell string box with browse button..i want that when user selects any cell from lib..it automatically exports the netlist of that cell selected.

How can we do that?

Thanks in advance.

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

    Please do not post multiple posts asking the same question in two forums. The forum guidelines explicitly ask you not to do this.

    "export a netlist" is rather vague. What kind of netlist? Spectre? Verilog? CDL? AMS? SystemVerilog? VHDL? The answer is likely to be different depending on what you are trying to export.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Oh, sorry, Andrew..is there a way to delete from another... I didn't see an option.
    And it's CDL netlist.
    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    You typically need to create an si.env file the same as would be produced via the File->Export->CDL form and then run the "si" executable. Here's a couple of relevant articles:

    • How to create spectre, hspice netlist from command line or in batch mode using OSS translator "si" and which licenses are required? Other OSS based netlisters auCdl, verilog, vhdl, systemVerilog
    • How to generate the same si.env file using the SKILL function simInitEnvWithArgs as generated using the File > Export > CDL menu

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    You typically need to create an si.env file the same as would be produced via the File->Export->CDL form and then run the "si" executable. Here's a couple of relevant articles:

    • How to create spectre, hspice netlist from command line or in batch mode using OSS translator "si" and which licenses are required? Other OSS based netlisters auCdl, verilog, vhdl, systemVerilog
    • How to generate the same si.env file using the SKILL function simInitEnvWithArgs as generated using the File > Export > CDL menu

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Thanks Andrew,

    Andrew is their any example code..from where i can refer to understand-

    regards,

    sid

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    The link in the "Related Thread" which appears at the bottom of the page below this post has a link to an article with such code, in fact.  export CDL netlist for ALL cells in a library 

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hello andrew- 

    below code when am running it is creating si.env file and after when am trying to si executable its is promting error-

    ERROR (OSSHNL-202): Cell 'nld5', view 'schematic' could not be found in all cell table. It seems to be an
    internal error. Report the problem to Cadence Customer Support if it
    persists.
    ERROR (OSSHNL-514): Netlist generation failed because of the errors reported above. The netlist might not have been generated at all, or the generated netlist could be corrupt. Fix the reported errors and regenerate the netlist.

    below code a trying-

    procedure(CCSRunNetlisterCell(libName cellName viewName runDir simulatorName)
    let( ( op runDirPath singleFile mvFile )

    runDirPath=strcat(runDir "/" cellName)
    simInitEnvWithArgs(runDirPath libName cellName viewName simulatorName nil)

    op=outfile(strcat(runDirPath "/si.env") "a")
    fprintf(op "incFILE=\"\" \n")
    fprintf(op "setEQUIV=\"\" \n")
    close(op)

    netlist()

    mvFile=sprintf(nil "mv -f ./%s/netlist ./%s/%s.cdl" runDirPath runDirPath cellName)
    singleFile=sprintf(nil "cat ./%s/%s.cdl >> ./%s/netlist.cdl" runDirPath cellName runDir)
    system(mvFile)
    system(singleFile)
    printf("Netlisting the cell:%L from Library:%L in the path:%L\n" cellName libName runDirPath)

    ) ; let
    ) ;procedure

    CCSRunNetlisterCell("smos10_testcases" "chk1" "schematic" "CDL" "auCdl")

    although when am generating cdl via virtuoso  export option its is working fine and smooth-

    what the error and how to correct it?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    You didn't share how you are running "si", which is probably rather important to know. I tried the code above myself with a cell "fourinvglob" as follows:

    CCSRunNetlisterCell("mylib" "fourinvglob" "schematic" "CDL" "auCdl")

    and then from the same working directory I ran virtuoso from, I ran:

    si CDL/fourinvglob -batch -command netlist

    it worked fine. Are you running from the same working directory? Are you giving the path to the run directory?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hello Andrew,

    Greetings!

     i have few doubts..mentioned below...

    for above gui,

    Now when user selects cell view then it should export the  cdl netlist for the cell select from libraray manager-       ;;;;;;;;;;;;;;;;;;cell view is lib name and topcell is cell name

    cell_view_Label=hiCreateLabel(
    ?name 'cell_view_Label
    ?labelText "Cell View*"
    ?justification 'left
    )
    cell_view_Entry=hiCreateStringField(
    ?name 'cell_view_Entry ?callback "(ddsUpdateSyncWithForm)" "CCSRunNetlisterCell(hiGetCurrentForm())"
    ?enabled nil
    )

    procedure(CCSRunNetlisterCell(cell_check cell_top viewName runDir simulatorName form)
    let( ( op runDirPath singleFile mvFile )

    cell_check = form->cell_view_Entry->value
    cell_top = form->Topcell->value

    runDirPath=strcat(runDir "/" cell_top)
    simInitEnvWithArgs(runDirPath cell_check cell_top viewName simulatorName nil)

    op=outfile(strcat(runDirPath "/si.env") "a")
    fprintf(op "incFILE=\"\" \n")
    fprintf(op "setEQUIV=\"\" \n")
    close(op)

    netlist()

    mvFile=sprintf(nil "mv -f ./%s/netlist ./%s/%s.cdl" runDirPath runDirPath cell_top)
    singleFile=sprintf(nil "cat ./%s/%s.cdl >> ./%s/netlist.cdl" runDirPath cell_top runDir)
    system(mvFile)
    system(singleFile)
    printf("Netlisting the cell:%L from Library:%L in the path:%L\n" cell_top cell_check runDirPath)

    ) ; let
    ) ;procedure
    cell_check = form->cell_view_Entry->value
    cell_top = form->Topcell->value
    CCSRunNetlisterCell("%s" "%s" "schematic" "CDL" "auCdl" cell_check cell_top)

    netlist = simplifyFilename(strcat(runDirPath "/" celltop ".cdl")

     

    1)How to call CCSRunNetlisterCell in cell view entry as their is pre-existing procedure "(ddsUpdateSyncWithForm)" ..HOW to use callback for both.

    2)In  CCSRunNetlisterCell max argument can be called 5 ...............in this how can i call arguments as it may keep changing as per user

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to saurabh96

    There are so many things wrong here, it's difficult to know where to start. I don't mean to be rude, but you don't seem to have much idea as to how to program - this is nothing to do with SKILL per se, but basics of any programming language. You'd realise then that you can define a function with a certain number of arguments and then pass the wrong number to them. Have you taken the free SKILL online training class on support.cadence.com that I've suggested before? Or read any books on programming? (any language would do to learn how to program).

    Let me try to direct what's wrong (my comments in red):

    cell_view_Label=hiCreateLabel(
    ?name 'cell_view_Label
    ?labelText "Cell View*"
    ?justification 'left
    )
    cell_view_Entry=hiCreateStringField(
    ?name 'cell_view_Entry ?callback "(ddsUpdateSyncWithForm)" "CCSRunNetlisterCell(hiGetCurrentForm())"
    ?enabled nil
    )

    ; why is the first argument called cell_check when it's a library name?
    ; you're now passing in 6 arguments - including the form.

    procedure(CCSRunNetlisterCell(cell_check cell_top viewName runDir simulatorName form)
    let( ( op runDirPath singleFile mvFile )

    ; it's a bit pointless passing in the first two arguments to the function, and then setting them in here
    cell_check = form->cell_view_Entry->value

    cell_top = form->Topcell->value

    runDirPath=strcat(runDir "/" cell_top)
    simInitEnvWithArgs(runDirPath cell_check cell_top viewName simulatorName nil)

    op=outfile(strcat(runDirPath "/si.env") "a")
    fprintf(op "incFILE=\"\" \n")
    fprintf(op "setEQUIV=\"\" \n")
    close(op)

    netlist()

    mvFile=sprintf(nil "mv -f ./%s/netlist ./%s/%s.cdl" runDirPath runDirPath cell_top)
    singleFile=sprintf(nil "cat ./%s/%s.cdl >> ./%s/netlist.cdl" runDirPath cell_top runDir)
    system(mvFile)
    system(singleFile)
    printf("Netlisting the cell:%L from Library:%L in the path:%L\n" cell_top cell_check runDirPath)

    ) ; let
    ) ;procedure
    cell_check = form->cell_view_Entry->value
    cell_top = form->Topcell->value

    ; here you're calling with 7 arguments - the first two being "%s". What's that supposed to do? I'm assuming you think this will magically behave like sprintf - it won't. I've no idea why you'd think that.
    CCSRunNetlisterCell("%s" "%s" "schematic" "CDL" "auCdl" cell_check cell_top)

    netlist = simplifyFilename(strcat(runDirPath "/" celltop ".cdl")

    Why don't you do the following?

    1. Remove the form argument from your function definition
    2. Remove the two lines within the function which retrieve the values from the form
    3. I'd also suggest you rename the cell_view/cell_view_Entry fields to be more like libName as you'll only confuse yourself - variable names should express their meaning, otherwise it just confuses anyone reading the code
    4. Create a wrapper function CCSRunNetlisterCellCB(form) like this:
      procedure(CCSRunNetlisterCB(form)
        CCSRunNetlister(form->cell_view_Entry->value form->Topcell->value "schematic" "CDL" "auCdl")
      )
    5. Change the callback to the wrapper function CCSRunNetlisterCellCB(hiGetCurrentForm())

    It's always a good idea to separate the procedural part of code from the code that interacts with the form. This allows you to reuse the function separately from the form - so can set up batch operations - and to do this you might then need an extra function to interface from the UI to the procedural interface.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 4 years ago in reply to Andrew Beckett

    Hello Andrew,

    Thanks for quick reply/suggestions.

    yes..am newbie to scripting/programming languages..and am working on it.

    after correction its running fine and creating si.env file but the netlist file that is creating is null.am not sure what the issue here?

    below changes i have implemented-

    lib_view_Label=hiCreateLabel(
    ?name 'lib_view_Label
    ?labelText "Cell View*"
    ?justification 'left
    )
    lib_view_Entry=hiCreateStringField(
    ?name 'lib_view_Entry
    ?callback list("CCSRunNetlisterCellCB(hiGetCurrentForm())")
    ?enabled nil
    )

    cellLabel=hiCreateLabel(
    ?name 'cellLabel ?labelText "Top Cell*"
    ?justification 'left
    )
    Topcell=hiCreateStringField(
    ?name 'Topcell ?callback "(ddsUpdateSyncWithForm)"

    )

    procedure(CCSRunNetlisterCB(form)
    let( op runDirPath singleFile mvFile )

    runDirPath=strcat(runDir "/" form->Topcell->value)
    simInitEnvWithArgs(runDirPath form->lib_view_Entry->value form->Topcell->value viewName simulatorName nil)

    op=outfile(strcat(runDirPath "/si.env") "a")
    fprintf(op "incFILE=\"\" \n")
    fprintf(op "setEQUIV=\"\" \n")
    close(op)

    netlist()

    mvFile=sprintf(nil "mv -f ./%s/netlist ./%s/%s.cdl" runDirPath runDirPath form->Topcell->value)
    singleFile=sprintf(nil "cat ./%s/%s.cdl >> ./%s/netlist.cdl" runDirPath form->Topcell->value runDir)
    system(mvFile)
    system(singleFile)
    printf("Netlisting the cell:%L from Library:%L in the path:%L\n" form->Topcell->value form->lib_view_Entry->value runDirPath)

    CCSRunNetlister(form->lib_view_Entry->value form->Topcell->value "schematic" "CDL" "auCdl")
    simplifyFilename(strcat(runDirPath "/" cell_top ".cdl")
    )
    )

    • 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