• 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. Detection of dependent variable

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 143
  • Views 12483
  • 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

Detection of dependent variable

dragank
dragank over 4 years ago

Hi all.

In current environment I have variable that depends on other variables as formula:

Is there a way to loop over variables and print them as formulas instead of calculated values?

Thank You in advance.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    I assume this code does what you want?

    /* abGetVarsAndValues.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Jun 17, 2021 
    Modified   
    By         
    
    Return a list of variables and values - either global vars
    or design variables for a given test:
    
    abGetVarsAndValues()
    abGetVarsAndValues(?test "TRAN")
    abGetVarsAndValues(?session maeSessId ?test "AC_ONLY")
    
    ***************************************************
    
    SCCS Info: @(#) abGetVarsAndValues.il 06/17/21.13:59:16 1.1
    
    */
    
    /*******************************************************************
    *                                                                  *
    *  abGetVarsAndValues(@key (session axlGetWindowSession()) test)   *
    *                                                                  *
    * For a given session (defaults to that in current window), return *
    *  either a list of global variable names and values or if ?test   *
    * is given, return the design variables for that test (and values) *
    *                                                                  *
    *******************************************************************/
    
    procedure(abGetVarsAndValues(@key (session axlGetWindowSession()) test)
        let((sdb testId var)
            sdb=axlGetMainSetupDB(session)
            when(test
                testId=axlGetTest(sdb test)
                when(zerop(testId)
                    error("Could not access test %L\n" test)
                )
                sdb=testId
            )
            foreach(mapcar varName cadr(axlGetVars(sdb))
                var=axlGetVar(sdb varName)
                unless(zerop(var)
                    list(varName axlGetVarValue(var))
                )
            )
        )
    )
    

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett
    axlGetVars(sdb) returns (0 nil)
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to dragank

    I can't imagine how this is failing - sdb must be valid because it would have given an error if an invalid session was provided. Your picture showed there were clearly global variables, but even if there were no global variables it would not return 0 as the first entry in the list.

    Is this ADE XL or Explorer/Assembler? Which IC sub-version are you using?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett

    It is ADE Assembler.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to dragank

    The only thing that makes any sense is if the first argument to axlGetVars() is not a handle to the root of the SDB data structure. If it's a handle to a different node in the SDB data that doesn't have a vars object, then that's the only reason you would get (0 nil). 

    Are you using my code as-is, or are you doing something else? If you do:

    sdb=axlGetMainSetupDB(axlGetWindowSession())

    what do you get?

    Then: axlGetTests(sdb) and axlGetVars(sdb)

    These APIs have been stable and reliable for years (since ADE XL existed), and I've never come across a case where they don't work, other than usage issues. So I'm sure it's not a version issue in this case (I checked in the version you're using, plus I checked to see if there were any records of similar issues - which there never have been as far as I can see).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dragank
    dragank over 4 years ago in reply to Andrew Beckett

    I tried both approaches.

    First I included your function.

    Then I used it as a guideline to make new one.

    Sequence of variable resolutions is:

    winSession = axlGetWindowSession() ; "fnxSession0"

    x_mainSDB=axlGetMainSetupDB(winSession ) ; 1001

    axlGetTests(x_mainSDB) ; (1040 ("sim_test_mos3"))

    axlGetVars(x_mainSDB) ; (0 nil) 

    Function that makes error is:

    defun( getGlobalVariableValues (sess)
      let( (output)
        output = list()
        x_mainSDB=axlGetMainSetupDB(sess)
        vars = axlGetVars(x_mainSDB)
        foreach( varName vars
          var = axlGetVar(sdb varName)
          output = append1(output var)
        )
       output
      )
    )

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to dragank

    I've just tested the four lines above with a brand new Assembler session, where I added a test but didn't yet add any global variables. In that case, I have (0 nil) returned. As soon as I add a global variable, then it starts returning something:

    (1053
      ("a")
    )

    for example.

    Your function also won't work properly (assuming axlGetVars is behaving) because your axlGetVar within the foreach loop is using a variable sdb rather than x_mainSDB.

    Other than that, I cannot see any mechanism for this to be returning (0 nil). If you genuinely have global variables, you'll need to contact customer support - I cannot see how this would fail.

    Andrew

    • 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