Home > Community > Forums > Custom IC SKILL > Re: Failure in updating values for CDF with access operator

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

 Re: Failure in updating values for CDF with access operator 

Last post Thu, May 15 2014 10:21 AM by skillUser. 3 replies.
Started by slim5 13 May 2014 01:28 PM. Topic has 3 replies and 199 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, May 13 2014 1:28 PM

    • slim5
    • Not Ranked
    • Joined on Thu, Sep 23 2010
    • Posts 16
    • Points 305
    Re: Failure in updating values for CDF with access operator Reply

     Hi,

    While trying to create a general procedure to modify the various parameters (e.g., w and numfinger) of a FET in schematic view, I encountered a problem that puzzle me. w and numfingers are the string listed under the Name column of Edit CDF. After opening the schematic view, I use the dBFindAnyInstByName to find the instance (N0) that I want to modify and executed the following code:
      dutInst=dbFindAnyInstByName(CV "N0")
      dutInst~>w="2.4u"
    and this piece of code seems to work when I execute the following code:
      cdfFindParamByName(cdfGetInstCDF(dutInst) "w" )~>value

    However, the value for Width did not get updated if I try to execute the following code:
      FETParam="w"
      dutInst~>FETParam="2.4u"

    Did I do something incorrect or the access operator was written such that I must explicit use the name and not a variable?

    Regards,

    Su Lim

    • Post Points: 20
  • Wed, May 14 2014 10:25 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,570
    • Points 15,605
    Re: Failure in updating values for CDF with access operator Reply

    Hi Su,

    The access operator (~>) treats the right-hand side as a literal and does not evaluate.  This operator maps to the function getq which implicitly quotes the second argument, so your code currently translates to getq(dutInst FETParam). You need the get operator which evaluates both of its arguments; so now write your code as get(dutInst FETParam) and it should work as expected.  Don't forget that changing CDF parameters through SKILL does not cause any related callbacks to be invoked - if this is necessary (most likely it will be), then you should take a look at Solution Article 11018344.

    Hopefully this will help you.

    Regards,

    Lawrence.

    • Post Points: 20
  • Thu, May 15 2014 8:27 AM

    • slim5
    • Not Ranked
    • Joined on Thu, Sep 23 2010
    • Posts 16
    • Points 305
    Re: Failure in updating values for CDF with access operator Reply

     Hi Lawrence,

    Thank you for the suggestion on using get and figure that I could use the putprop function to update the values for the properties of a symbol. While speaking to another coworker, he suggested that I could also use dbReplaceProp. Which of these two commands is the prefer method with respect to being more efficient?

      putprop(dutInst ParamValue FETParam) or dbReplaceProp(dutInst ParamName 'string ParamValue)

    With respect to the related callbacks, I had looked at that solution you mentioned and implemented it in my code.

     

    Regards,

    Su Lim

     

    • Post Points: 20
  • Thu, May 15 2014 10:21 AM

    • skillUser
    • Top 10 Contributor
    • Joined on Fri, Sep 19 2008
    • Austin, TX
    • Posts 2,570
    • Points 15,605
    Re: Failure in updating values for CDF with access operator Reply

    Hi Su Lim,

    the dbReplaceProp() function is probably the best choice, but if the other methods (get/set or putprop) work they are reasonable choices (i.e. they are not "wrong"). I doubt you would be able to measure any differences in efficiency in this case; though generally speaking it is best to use the built-in specific API over another method (for example, dbFindNetByName() is probably more efficient than car(setof(obj cv~>nets obj~>name=="searched_for_net"))  ).  In this case, using dbReplaceProp indicates to anyone reading the code that you are replacing a property in the database - the function name actually helps clarify what the intention is. 

    It sounds like you have this working now, good work!

    regards,

    Lawrence.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by slim5 at 13 May 2014 01:28 PM. Topic has 3 replies.