Home > Community > Forums > Custom IC Design > Generate netlist with subckt statement for top level

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Generate netlist with subckt statement for top level 

Last post Thu, Apr 10 2014 10:07 AM by NcfC. 9 replies.
Started by Octavian 25 Mar 2014 02:59 PM. Topic has 9 replies and 503 views
Page 1 of 1 (10 items)
Sort Posts:
  • Tue, Mar 25 2014 2:59 PM

    • Octavian
    • Not Ranked
    • Joined on Fri, Nov 15 2013
    • Posts 13
    • Points 170
    Generate netlist with subckt statement for top level Reply

    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

    • Post Points: 20
  • Wed, Mar 26 2014 4:14 AM

    Re: Generate netlist with subckt statement for top level Reply

    Tavi,

    envOption(
            'setTopLevelAsSubckt  t
    )

    Is now available from IC616 ISR3 onwards.

    Regards,

    Andrew.

    • Post Points: 20
  • Wed, Mar 26 2014 6:19 AM

    • Octavian
    • Not Ranked
    • Joined on Fri, Nov 15 2013
    • Posts 13
    • Points 170
    Re: Generate netlist with subckt statement for top level Reply

    Thanks for the prompt reply.

    Is there a similar solution for IC514?

     

    Thanks,

    --Tavi

    • Post Points: 20
  • Wed, Mar 26 2014 7:13 AM

    Re: Generate netlist with subckt statement for top level Reply

    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))
      )
    

     

     

    • Post Points: 35
  • Wed, Mar 26 2014 2:01 PM

    • Octavian
    • Not Ranked
    • Joined on Fri, Nov 15 2013
    • Posts 13
    • Points 170
    Re: Generate netlist with subckt statement for top level Reply

     It works!

     Thank you.

    • Post Points: 5
  • Wed, Mar 26 2014 4:25 PM

    • NcfC
    • Top 500 Contributor
    • Joined on Mon, Feb 27 2012
    • Chandler, AZ
    • Posts 28
    • Points 440
    Re: Generate netlist with subckt statement for top level Reply

    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,

    • Post Points: 20
  • Wed, Mar 26 2014 4:59 PM

    Re: Generate netlist with subckt statement for top level Reply

    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.

    • Post Points: 20
  • Thu, Mar 27 2014 4:09 PM

    • NcfC
    • Top 500 Contributor
    • Joined on Mon, Feb 27 2012
    • Chandler, AZ
    • Posts 28
    • Points 440
    Re: Generate netlist with subckt statement for top level Reply

    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,

     

    • Post Points: 20
  • Wed, Apr 9 2014 11:39 PM

    Re: Generate netlist with subckt statement for top level Reply

    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.

    • Post Points: 20
  • Thu, Apr 10 2014 10:07 AM

    • NcfC
    • Top 500 Contributor
    • Joined on Mon, Feb 27 2012
    • Chandler, AZ
    • Posts 28
    • Points 440
    Re: Generate netlist with subckt statement for top level Reply

    Hi, Andrew.

     

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

     

    Best regards, 

    • Post Points: 5
Page 1 of 1 (10 items)
Sort Posts:
Started by Octavian at 25 Mar 2014 02:59 PM. Topic has 9 replies.