• 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. Is it possible to parameterize a Multi Bit wire with vector...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 125
  • Views 17786
  • 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

Is it possible to parameterize a Multi Bit wire with vector expressions?

WesZ
WesZ over 13 years ago

 Is it possible to parameterize a Multi Bit wire with vector expressions? Also can you parameterize the number of instances in a instance defines with an iterative expressiion? I'm trying to create a schematic that you can reconfigure the number of internal devices via a parameter.

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

    Here's a simpler version. Lawrence's code is creating some graphical artifacts which aren't really necessary if you only want to be able to netlist it (for example, there's no need to create the pins; terminals are enough). And  you wouldn't necessarily need a pcell symbol to go along with it.

    Your mileage may vary - just thought I'd given an alternative since I had one to hand!

    let( (CellLibrary pcellId)
      CellLibrary = "training"
      unless( ddGetObj(CellLibrary)
         error("Couldn't open library %L" CellLibrary)
      )
      
      pcellId =  pcDefinePCell(
         list( ddGetObj(CellLibrary) "rnsd" "schematic" "schematic" )
         
         /****************************************************************************
         /*
         /* Default Parameters
         /*
         /***************************************************************************/
         (
            (ns "1")
         )
         
         let(( pcCV masterCv instName instId netP netM numInsts)
           
           /*************************************************************************
           /*
           /* Get parameter values
           /*
           /************************************************************************/
           pcCV = pcCellView
           
           ;; open master cell view
           masterCv = dbOpenCellViewByType( "analogLib" "res" "symbol" nil "r" )
    
           ;; create the nets
           netP=dbMakeNet(pcCV "PLUS")
           netM=dbMakeNet(pcCV "MINUS")
    
           ;; create the terminals
           dbCreateTerm(netP "PLUS" "inputOutput")
           dbCreateTerm(netM "MINUS" "inputOutput")
    
           numInsts=atoi(ns)
           when(numInsts<1 numInsts=1)
           for(inst 1 numInsts
              if(inst==1 then
                 netP=dbMakeNet(pcCV "PLUS")
              else 
                 netP=dbMakeNet(pcCV sprintf(nil "net%d" inst-1))
              ) ; if
              if(inst==numInsts then
                 netM=dbMakeNet(pcCV "MINUS")
              else 
                 netM=dbMakeNet(pcCV sprintf(nil "net%d" inst))
              )
    
              ;; create instance
              sprintf(instName "R%d" inst)
              instId = dbCreateInst( pcCV masterCv instName (0:0) "R0" )
              dbCreateProp(instId "r" "string" "pPar(\"r\")/pPar(\"ns\")")
    
              ;; create instTerms for the instance to connect it up
              dbCreateInstTerm(netP instId dbFindTermByName(masterCv "PLUS"))
              dbCreateInstTerm(netM instId dbFindTermByName(masterCv "MINUS"))
    
           ) ; for
    
           dbClose( masterCv )
           ;; Always return true
           t
         ) ; ** let **
      )
      ; not sure if below is really necessary
      dbSave(pcellId)
      dbClose( pcellId ) 
    ) ; ** let ** 
    

     

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

    Here's a simpler version. Lawrence's code is creating some graphical artifacts which aren't really necessary if you only want to be able to netlist it (for example, there's no need to create the pins; terminals are enough). And  you wouldn't necessarily need a pcell symbol to go along with it.

    Your mileage may vary - just thought I'd given an alternative since I had one to hand!

    let( (CellLibrary pcellId)
      CellLibrary = "training"
      unless( ddGetObj(CellLibrary)
         error("Couldn't open library %L" CellLibrary)
      )
      
      pcellId =  pcDefinePCell(
         list( ddGetObj(CellLibrary) "rnsd" "schematic" "schematic" )
         
         /****************************************************************************
         /*
         /* Default Parameters
         /*
         /***************************************************************************/
         (
            (ns "1")
         )
         
         let(( pcCV masterCv instName instId netP netM numInsts)
           
           /*************************************************************************
           /*
           /* Get parameter values
           /*
           /************************************************************************/
           pcCV = pcCellView
           
           ;; open master cell view
           masterCv = dbOpenCellViewByType( "analogLib" "res" "symbol" nil "r" )
    
           ;; create the nets
           netP=dbMakeNet(pcCV "PLUS")
           netM=dbMakeNet(pcCV "MINUS")
    
           ;; create the terminals
           dbCreateTerm(netP "PLUS" "inputOutput")
           dbCreateTerm(netM "MINUS" "inputOutput")
    
           numInsts=atoi(ns)
           when(numInsts<1 numInsts=1)
           for(inst 1 numInsts
              if(inst==1 then
                 netP=dbMakeNet(pcCV "PLUS")
              else 
                 netP=dbMakeNet(pcCV sprintf(nil "net%d" inst-1))
              ) ; if
              if(inst==numInsts then
                 netM=dbMakeNet(pcCV "MINUS")
              else 
                 netM=dbMakeNet(pcCV sprintf(nil "net%d" inst))
              )
    
              ;; create instance
              sprintf(instName "R%d" inst)
              instId = dbCreateInst( pcCV masterCv instName (0:0) "R0" )
              dbCreateProp(instId "r" "string" "pPar(\"r\")/pPar(\"ns\")")
    
              ;; create instTerms for the instance to connect it up
              dbCreateInstTerm(netP instId dbFindTermByName(masterCv "PLUS"))
              dbCreateInstTerm(netM instId dbFindTermByName(masterCv "MINUS"))
    
           ) ; for
    
           dbClose( masterCv )
           ;; Always return true
           t
         ) ; ** let **
      )
      ; not sure if below is really necessary
      dbSave(pcellId)
      dbClose( pcellId ) 
    ) ; ** let ** 
    

     

    • 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