Home > Community > Forums > Custom IC SKILL > Retrieving variable value from variable handle (axl.*)

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

 Retrieving variable value from variable handle (axl.*) 

Last post Thu, Nov 22 2012 4:09 AM by GaneshShamnur. 7 replies.
Started by skillprogramme 15 Jun 2012 02:59 AM. Topic has 7 replies and 1805 views
Page 1 of 1 (8 items)
Sort Posts:
  • Fri, Jun 15 2012 2:59 AM

    Retrieving variable value from variable handle (axl.*) Reply

    Hi!

    I am having problems retrieving the value of a variable handle with the axl-functions.

    Example:

     

    data_session = ( axlCreateSession "data_session" )

    data_sdb = axlSetMainSetupDB( data_session "data.sdb" )

    foreach( param cadr( axlGetVars( data_sdb ) )

    varHandle = axlGetVar( data_sdb param )

    )

    So, when you have the variable handle (varHandle in this case), how to retrieve its value? I can't find any axl-function that does it. When you use the axlPutVar you are allowed to give the value of the variable along with it, but I can't find any way to actually read the value. I am relatively new to SKILL, so please excuse me if there's a very simple solution to this. 

    Thanks in advance
    Max 

     

    • Post Points: 20
  • Mon, Jun 18 2012 3:56 AM

    Re: Retrieving variable value from variable handle (axl.*) Reply

    Max,

    session=axlCreateSession("data_session")
    sdb=axlSetMainSetupDBLCV(session "opamp090" "full_diff_opamp_AC" "adegxl")
    foreach(param cadr(axlGetVars(sdb))
      varHandle=axlGetVar(sdb param)
      printf("var %L has value %L\n" param axlGetVarValue(varHandle))
    )

    Note that the axlGetVarValue() function is currently not documented, but CCR 957111 has been filed to fix that.

    Andrew,.

     

     

    • Post Points: 35
  • Mon, Jun 18 2012 4:04 AM

    Re: Retrieving variable value from variable handle (axl.*) Reply

    Thanks a lot Andrew, that did the trick! But, I can't find that function in the result from

    listFunctions("axl")

    (which I tried when searching for that function). 

    Does listFunctions only list functions in the documentation?

    Max 

    • Post Points: 20
  • Mon, Jun 18 2012 4:34 AM

    Re: Retrieving variable value from variable handle (axl.*) Reply

    Max,

    Yes, it only lists public functions - which have documentation (it utilizes the presence in cdsFinder, which in turn originates from the documentation).

    Andrew.

    • Post Points: 20
  • Mon, Jun 18 2012 7:38 AM

    Re: Retrieving variable value from variable handle (axl.*) Reply

    Ok, thanks again. I think I recall reading somewhere in here that the axl-functions are not so well documented and maintained. Would you recommend using them for modifying adexl-views at all, or should I maybe look into parsing the .sdb-files in another way (XML-parsing with Python or PERL fex.)? I also need to change the configviews corresponding to the ADEXL views. Is there some built-in functions for this?

    Max 

    • Post Points: 20
  • Mon, Jun 18 2012 7:43 AM

    Re: Retrieving variable value from variable handle (axl.*) Reply

    Max,

    The functions are well maintained, but the documentation needs some polish (I have a CCR on that). 

    You should definitely not parse the .sdb because the schema is not documented and may be changed to suit the needs of the tools - but the public API will be maintained to ensure that the data is consistent. The tool itself goes throught the same underlying API, so that is the right approach.

    If you need to change the config views, there's an API for that - the "hdb" API.

    Andrew.

    • Post Points: 5
  • Thu, Nov 22 2012 4:06 AM

    • GaneshShamnur
    • Not Ranked
    • Joined on Sun, Oct 9 2011
    • BANGALORE, Karnataka
    • Posts 11
    • Points 145
    Re: Retrieving variable value from variable handle (axl.*) Reply

    Hi Andrew,

    Below is the error I obtain after executing

    ----------------

    data_session = ( axlCreateSession "data_session" )

    sdb=axlSetMainSetupDBLCV(data_session "ALL_PRIMITIVES" "ALL_PRIMITIVES_TB_TB" "schematic")

    *Error* ddGetObjWritePath: argument #1 should be a ddUserType (type template = "b") - nil

    ----------------

    I then checked if argument #1(data_session) is nil. But it is not as you can see below

    ----------------

    data_session
    "data_session" 

    ----------------

    Any ideas on what could be wrong ?  

    Regards,

    Ganesh

    • Post Points: 5
  • Thu, Nov 22 2012 4:09 AM

    • GaneshShamnur
    • Not Ranked
    • Joined on Sun, Oct 9 2011
    • BANGALORE, Karnataka
    • Posts 11
    • Points 145
    Re: Retrieving variable value from variable handle (axl.*) Reply

    Sorry Andrew,

    I immediately realized that the view being opened was "schematic" whereas it should be "adexl".

    Regards,
    Ganesh

    • Post Points: 5
Page 1 of 1 (8 items)
Sort Posts:
Started by skillprogramme at 15 Jun 2012 02:59 AM. Topic has 7 replies.