Home > Community > Forums > Custom IC SKILL > Skill code to add instance

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: *

 Skill code to add instance 

Last post Mon, Nov 5 2012 11:41 PM by jazzmatazz. 7 replies.
Started by Yassin 10 Aug 2009 02:19 AM. Topic has 7 replies and 2361 views
Page 1 of 1 (8 items)
Sort Posts:
  • Mon, Aug 10 2009 2:19 AM

    • Yassin
    • Not Ranked
    • Joined on Mon, Aug 10 2009
    • Posts 1
    • Points 20
    Skill code to add instance Reply

    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

    • Post Points: 20
  • Mon, Aug 10 2009 7:35 AM

    • dmay
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Allen, TX
    • Posts 386
    • Points 7,290
    Re: Skill code to add instance Reply

    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

    • Post Points: 20
  • Mon, Nov 5 2012 12:57 PM

    Re: Skill code to add instance Reply

    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 

    • Post Points: 20
  • Mon, Nov 5 2012 1:59 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,538
    • Points 15,030
    Re: Skill code to add instance Reply

    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.

    • Post Points: 35
  • Mon, Nov 5 2012 2:29 PM

    Re: Skill code to add instance Reply
    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
    • Post Points: 5
  • Mon, Nov 5 2012 2:30 PM

    Re: Skill code to add instance Reply

    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

    • Post Points: 20
  • Mon, Nov 5 2012 7:37 PM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,538
    • Points 15,030
    Re: Skill code to add instance Reply

    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.

    • Post Points: 20
  • Mon, Nov 5 2012 11:41 PM

    Re: Skill code to add instance Reply

    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 

             

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by Yassin at 10 Aug 2009 02:19 AM. Topic has 7 replies.