Define subcircuit in Virtuoso Schematic using SPICE

Discussion in 'Cadence' started by guan1121, May 19, 2005.

  1. guan1121

    guan1121 Guest

    Hi,
    I'm using Affirma Virtuoso Schematic Editor to design the circuit
    and later simulate using Spectre.
    The question is that I want to put a subcircuit( an OpAmp), which is
    defined in SPICE description from manufacturer. What instance should I
    use in schematic and where should I put the text description? Is there
    any other concern when using Spectre?
    I really appreciate your help.

    Lawrence
     
    guan1121, May 19, 2005
    #1
  2. Andrew Beckett once wrote on comp.cad.cadence:
    <quote>
    1. Create a symbol for the component.
    2. Copy that symbol to a view called "spectre" in the library manager
    3. Do Tools->CDF->Edit CDF in the CIW
    4. Change the form to "Base", and pick the cell.
    5. Go down to the "Simulation Information" section, and click on the
    Edit button.
    6. Change the simulator to "spectre", and then:
    Fill in the Terminal Order as the names of the symbol pins, in the
    order in which they occur in the spice macromodel subckt header.
    Either specify the component name as the name of the subckt, or
    specify the component name as "subcircuit", and add a parameter
    (further up the CDF form) called either "model" or "macro", where
    the default value is the name of the subckt.

    Then when you create a schematic, and have it wired up, and start
    Tools->Analog Design Environment, you can then include the macro
    model as a model file.
    </quote>

    The steps 3 to 6 can also be done by a SKILL file. The template is the
    result of the cdfDump() command. (see cdfuser.pdf in documentation).
    Create a textfile on disk and copy-paste the code to it. I have put some
    comments into the code on the places where changes should be done. Don't
    forget to create the symbol first. Then you load this modified code into
    composer by load("filename").

    The spice code (from .subckt to .ends) itself you put into another text
    file and include it from the ADE->Setup->Model Libraries dialogue. You
    may need to put a
    simulator lang=spice
    at the top of the spice file to avoid some warning messages.

    --- 8< ---
    /****************************************************/
    ;; Change library to a real library in your work environment
    LIBRARY = "library_name"
    ;; Change CELL to be the name of the cell view that will be
    ;; black-box'ed
    CELL = "cell_name"
    /****************************************************/

    let( ( libId cellId cdfId )
    unless( cellId = ddGetObj( LIBRARY CELL )
    error( "Could not get cell %s." CELL )
    )
    when( cdfId = cdfGetBaseCellCDF( cellId )
    cdfDeleteCDF( cdfId )
    )
    cdfId = cdfCreateBaseCellCDF( cellId )

    ;;; Simulator Information
    cdfId->simInfo = list( nil )
    cdfId->simInfo->spectre = '( nil
    ;; Change termOrder to be the pin sequence defined
    ;; by the .subckt command.
    termOrder ("PIN1" "PIN2" "PIN3")
    ;; Change componentName to be the name of the
    ;; subcircuit defined by the .subckt command
    componentName "subcircuit"
    netlistProcedure nil
    )

    ;;; Properties
    cdfId->formInitProc = ""
    cdfId->doneProc = ""
    cdfId->buttonFieldWidth = 340
    cdfId->fieldHeight = 35
    cdfId->fieldWidth = 350
    cdfId->promptWidth = 175
    cdfId->modelLabelSet = ""
    cdfId->opPointLabelSet = ""
    cdfId->paramLabelSet = ""
    cdfSaveCDF( cdfId )
    )
    --- >8 ---
     
    Svenn Are Bjerkem, May 20, 2005
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.