• 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. Generate netlist with subckt statement for top level

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 127
  • Views 18992
  • 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

Generate netlist with subckt statement for top level

Octavian
Octavian over 11 years ago

I'm generating a netlist from CIW using:

simulator('spectre)
design("libName" "cellName" "viewName")
createNetlist()

This works fine but I would like to enclose the top level cell in .subckt/ends statements, similar to other cells in the hierarchy. Is that possible using the skill/ocean interface?

 

Thanks,

--Tavi

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 11 years ago

    Tavi,

    envOption(
            'setTopLevelAsSubckt  t
    )

    Is now available from IC616 ISR3 onwards.

    Regards,

    Andrew.

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

    Thanks for the prompt reply.

    Is there a similar solution for IC514?

     

    Thanks,

    --Tavi

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

    Hi Tavi,

    How about the code below. Note that if you want to switch it back in the same session, you'd have to do:

    asiSetNetlistFormatterClass(asiGetTool('spectre) 'spectreFormatter)

    Look at the comments at the top to see the function to initialize the alternative formatter which includes the header for the subckt. The IC616 solution that I mentioned below also incorporates the changes needed (with a recent enough MMSIM version) so that the netlist can still be simulated, using a new switch for spectre to tell it the top subckt to simulate, which the solution below doesn't implement. But if you only want it to produce a netlist, this solution should be sufficient.

    Regards,

    Andrew.

    /* abSpectreTopSubckt.ils
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       May 16, 2006 
    Modified   
    By         
    
    Defines a new formatter, which adds subckt definition around
    top level circuit.
    
    Does this by extending the spectreFormatter. Note we could directly
    define methods for the spectreFormatter, since it doesn't define
    them itself, but then there is the risk that a future release
    might define methods for spectreFormatter - so better to extend
    rather than make that assumption.
    
    To install, call (abRegisterSpectreTopCVFormatter)
    
    ***************************************************
    
    SCCS Info: @(#) abSpectreTopSubckt.ils 05/16/06.18:06:00 1.1
    
    */
    
    ;------------------------------------------------------------------------
    ; Need to have these contexts loaded - in the right order - so
    ; that the spectreFormatter class can be extended
    ;------------------------------------------------------------------------
    (foreach context '("oasis" "asimenv" "analog" "spectrei" "spectreinl")
      (unless (isContextLoaded context)
              (loadContext 
               (prependInstallPath (strcat "etc/context/" context ".cxt")))
              (callInitProc context)
              )
      )
    
    ;------------------------------------------------------------------------
    ; Define the class for the formatter. 
    ;------------------------------------------------------------------------
    (defclass abSpectreTopCVFormatter (spectreFormatter)
      ()
      )
    
    /***************************************************************
    *                                                              *
    *              (abRegisterSpectreTopCVFormatter)               *
    *                                                              *
    *              Register the formatter with Artist              *
    *                                                              *
    ***************************************************************/
    
    (defun abRegisterSpectreTopCVFormatter ()
      (let (tool)
           (setq tool (asiGetTool 'spectre))
           (asiSetNetlistFormatterClass tool 'abSpectreTopCVFormatter)
           )
      )
    
    
    /***********************************************************************
    *                                                                      *
    * (nlPrintTopCellHeader ((formatter abSpectreTopCVFormatter) cellView) *
    *                                                                      *
    *    Method for top level header - call the standard subckt header     *
    *                                                                      *
    ***********************************************************************/
    
    (defmethod nlPrintTopCellHeader ((formatter abSpectreTopCVFormatter) cellView)
      (nlPrintSubcktHeader formatter cellView)
      ;----------------------------------------------------------------------
      ; don't want comments twice, so don't call the standard formatter?
      ;----------------------------------------------------------------------
      ; (when (nextMethodp) (callNextMethod))
      )
    
    /***********************************************************************
    *                                                                      *
    * (nlPrintTopCellFooter ((formatter abSpectreTopCVFormatter) cellView) *
    *                                                                      *
    *    Method for top level footer - call the standard subckt footer     *
    *                                                                      *
    ***********************************************************************/
    
    (defmethod nlPrintTopCellFooter ((formatter abSpectreTopCVFormatter) cellView)
      (nlPrintSubcktFooter formatter cellView)
      (when (nextMethodp) (callNextMethod))
      )
    

     

     

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

     It works!

     Thank you.

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

    Hi, Andrew. I placed your code, followed by Tavi's code, inside a procedure, but I got some problems.

    If I call the procedure from within CIW, I don't get any errors and the netlist is generated as it should be.

    But if I placed it as a sub menu item,

     procedure( AddItemSubHier( _args )

    let( ( fileMenu slider MenuItemSubCktNetlist )

    fileMenu = car( setof( menu hiGetBannerMenus( hiGetCurrentWindow() ) rexMatchp("^schFileMenu" menu ) ) )

    if( fileMenu 

    slider = eval( car( setof( item eval( fileMenu )->? rexMatchp( "^schHierSlider" item ) ) ) ) 

    )

    MenuItemSubCktNetlist = hiCreateMenuItem( ?name 'menu1 ?itemText "Netlist - Subcircuito" ?callback "Netlist_TopLevel_SubCkt()" )

    when( !slider->menu1 hiInsertMenuItem( slider MenuItemSubCktNetlist length( slider->? ) ) )

    ) ;let

    ) ;procedure

    deRegUserTriggers( "schematic" nil nil 'AddItemSubHier )

    and load it in the cdsinit.il file, I get the following error:

    *Error* _iliGetSlotSpecs: not a class object or class name - spectreFormatter

     

    What have I done wrong?

     

    Thanks in advance.

     

    Best regards,

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

    I think you'll have to show what Netlist_TopLevel_SubCkt looks like. I'm not sure what you mean by placing my code followed by Tavi's in a procedure. My code relies on pre-loading some context files before defining some classes - so I'm guessing something got screwed up somewhere as it doesn't know what spectreFormatter is. So please share the code so that I can check it - you've only shown the menu definition, which is not the interesting part...

    Regards,

    Andrew.

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

    Hi, Andrew.

     

    No problem. Here it is:

     

    procedure( AddItemSubHier( _args )

    let( ( fileMenu slider MenuItemNetlist )

    fileMenu = car( setof( menu hiGetBannerMenus( hiGetCurrentWindow() ) rexMatchp("^schFileMenu" menu ) ) )

    if( fileMenu 

    slider = eval( car( setof( item eval( fileMenu )->? rexMatchp( "^schHierSlider" item ) ) ) ) 

    )

    MenuItemNetlist = hiCreateMenuItem( ?name 'menu1 ?itemText "Netlist - Subckt" ?callback "Netlist_TopLevel_SubCkt()" )

    when( !slider->menu1 hiInsertMenuItem( slider MenuItemNetlist length( slider->? ) ) )

    ) ;let

    ) ;procedure


    procedure( Netlist_TopLevel_SubCkt()

    let( ( sch design )


    (foreach context '("oasis" "asimenv" "analog" "spectrei" "spectreinl")

    (unless (isContextLoaded context)

    (loadContext 

    (prependInstallPath (strcat "etc/context/" context ".cxt")))

    (callInitProc context)

    )

    )


    (defclass abSpectreTopCVFormatter (spectreFormatter)

    ()

    )


    (defun abRegisterSpectreTopCVFormatter ()

    (let (tool)

    (setq tool (asiGetTool 'spectre))

    (asiSetNetlistFormatterClass tool 'abSpectreTopCVFormatter)

    )

    )


    (defmethod nlPrintTopCellHeader ((formatter abSpectreTopCVFormatter) cellView)

    (nlPrintSubcktHeader formatter cellView)

    )


    (defmethod nlPrintTopCellFooter ((formatter abSpectreTopCVFormatter) cellView)

    (nlPrintSubcktFooter formatter cellView)

    (when (nextMethodp) (callNextMethod))

    )


    (abRegisterSpectreTopCVFormatter)


    simulator( 'spectre )


    sch = geGetEditCellView()

    design( sch~>libName sch~>cellName sch~>viewName )


    createNetlist()

    ) ; let

    ) ; procedure

     

    Best regards,

     

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

    Don't nest all the code inside Netlist_TopLevel_SubCkt(). The procedures won't be local (unless you're using SKILL++ and have a .ils suffix), and even then some of it will be evaluated at the wrong time. There's no need to do it that way. Load the code I gave you, and define your function like this:

    procedure( Netlist_TopLevel_SubCkt()
    let( ( sch )
        abRegisterSpectreTopCVFormatter()
        sch=geGetEditCellView()
        design( sch~>libName sch~>cellName sch~>viewName )
        createNetlist()
        asiSetNetlistFormatterClass(asiGetTool('spectre) 'spectreFormatter)
    ))

    (Note, I didn't test the above code).

    Regards,

    Andrew.

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

    Hi, Andrew.

     

    Thanks very much. It worked just fine (I just had to add the line for the simulator!).

     

    Best regards, 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Matt Lanahan
    Matt Lanahan over 10 years ago

    Hi Andrew,

    The setTopLevelAsSubckt option doesn't appear to work in ICADV121_110.  Is that feature only available in IC616?

    I was able to get running using your abSpectreTopSubckt.ils, so thank you for that.

    • 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