• 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. Skill code to add instance

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 22504
  • 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

Skill code to add instance

Yassin
Yassin over 16 years ago

Hi,

I want a skill code to add an instance in a schematic sheet.

I tried the following code but it hasn't worked

procedure(
abc(component)
schHiCreateInst("tsmcN90" component "symbol" "I0" 1 1)
mouseAddPt()
0:0
)

then i call this function using:
abc("nch")

I am new to skill so i expect that there are much better ways to do that.

by the way, what does Hi stands for in the word schHiCreateInst??

Regards,
Yassin

  • Cancel
  • dmay
    dmay over 16 years ago

    The "hi" refers to "Human Interface". These are the commands you find when you are interactively working in Composer or Virtuoso. For doing the same thing in Skill code, you want to look for commands without the "hi".

    You should be able to use schCreateInst or dbCreateInst. To be honest, I'm not sure what the difference is between the two.

    procedure(abc(component)
        ;First you need to get the master id of the cell you want to place
        mstr=dbOpenCellViewByType("tsmcN90" component "symbol"  "schematicSymbol" "r")
        schCreateInst(geGetEditCellView() mstr "I0" 0:0 "R0" 1)
    )

    Note the following usage info for schCreateInst. If you set the instance name to be nil instead of I0, then Cadence will automatically name the instance uniquely.

    schCreateInst(
    d_cvId
    d_masterId
    t_instanceName
    l_origin
    t_orient
    [ n_magnification ]
    )
    => d_inst | nil

    Creates an instance of the given master cellview in the specified cellview at the given location with the given orientation. You can specify the magnification to set for the instance. Although not fully supported, you can use this property to scale the appearance of an instance.

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jazzmatazz
    jazzmatazz over 12 years ago

    Hello everyones,

       My question is the same but is related to the layout.

       How can I place an instance in specific coordinates and aslo to change its parameter like W and L. Is there some function with argument the [postitions] and [parameters] ?

       For example I want to place an instance with W=3.18u and L=2.22u to coordinates 0.25:5.35  

       Regards,

            Nikolay 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 12 years ago

    Hi Nikolay,

    In this case, since it is a parameterized cell (PCell), you can use something like the following approach - you could create a procedure wrapper around these statements so that your inputs are just the cell to be placed, parameter values and the location of the instance.

    dbCreateParamInstByMasterName(
      geGetEditCellView()         ;; the current cellview's dbId
      "instLibName"               ;; the library where the instance comes from
      "instCellName"              ;; the name of the cell to be instantiated
      "instViewName"              ;; the viewname of the cell to be instantiated
      symbolToString(gensym("I")) ;; hopefully a unique instance name
      0.25:5.35                   ;; origin
      "R0"                        ;; orientation
      1                           ;; number of instances
      list(list("l" "float" "2.22u") list("w" "float" "3.18u")) ;; the parameters, types and values
    )
    

    I've put "hopefully" a unique instance name since the code does nothing to check if that instance name already exists in the cellview or not.

    There is another similar function dbCreateParamInst which you pass the dbId of the master cell to be placed also - this would be more efficient if you had many instances to be placed since you obtain the master cellview dbId one time before using the function, thus saving looking it up for every instance placement.  The above suggestion is generally simpler and should meet your requirements.

    Best regards,

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jazzmatazz
    jazzmatazz over 12 years ago
    Hey Lawrence, Should l and w values to be in quotes? "2.22u" "3.18u" Because there is some error "invalid float "2.25u"" . And if no there is some other error : Datatype for input parameter "l" do not match the definition. How can I see the exact names of the W and L parameters ? Regards, Nikolay
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jazzmatazz
    jazzmatazz over 12 years ago

    Hey Lawrence,

    Should l and w values to be in quotes? "2.22u" "3.18u" ?

    Because there is some error "invalid float "2.25u"" . And if no there is some other error : Datatype for input parameter "l" do not match the definition. How can I see the exact names of the W and L parameters ?

    Regards,

        Nikolay

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • skillUser
    skillUser over 12 years ago

    Hi Nikolay,

    I apologise, this was an example that I could not test directly.  However, it will be dependent on your devices - there is a good chance that "l" and "w" are defined as string parameters and then manipulated into floats either as CDF callbacks or within the PCell code.  Look at the device CDF for the cell that you are trying to instantiate (Tools -> CDF -> Edit) and look for the parameters, then see if you can work out those that are actually passed on to the PCell (it may not be "w", for example, but, say, "totalW" and likewise for "l").  The call to dbCreateParamInst or dbCreateParamInstByMasterName is at a low level - if you have the pcDefinePCell code definition, this is what you would match up against.

    I hope that this helps.

    Lawrence.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jazzmatazz
    jazzmatazz over 12 years ago

    Hi Lawrence,

       Thanks for the reminding for the CDF tool, I forgot for it.

       Like you mantioned these parameters are string type not float, and  dbCreateParamInst  now works.

        Regards,

               Nikolay 

             

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Nhumai
    Nhumai over 7 years ago in reply to dmay

    Hi Derek,

    what if I would like to create a master schematic which contain all other instance of all the cells in 1 lib. 

    how can I modify your code ? I am a beginner to skill 

    thanks 

    Nhumai 

    • 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