• 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. How to add design variables every time a new maestro view...

Stats

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

How to add design variables every time a new maestro view is created in Explorer/Assembler?

Naci
Naci over 4 years ago

Hello everyone,

I am trying to automatically add some global variables and design variables when a new maestro view is created. It was quite easy to do it with ADE L using "asimenv.designVarSetting", however I could not find a straightforward method for maestro views. 

I used a solution suggested by Andrew in another post. I used "createdTest"  trigger to add the design variables after a new test is created. Here is the SKILL code;

procedure(CCFaddTestCreatedTrigger(sessionName)
  axlSessionConnect(sessionName "createdTest" 'CCFtestCreatedTrigger)
)

procedure(CCFregCreatedTestTrigger()
  axlSessionRegisterCreationCallback('CCFaddTestCreatedTrigger)
)

procedure(CCFtestCreatedTrigger(sessionName testName)
  printf("> ADE Window Session %L is loaded\n> Test %L is created\n" sessionName list(testName))
  maeSetVar("myvar" "1" ?session sessionName) ; Add Global Variable
  maeSetVar("myvar" "1" ?session sessionName ?typeName "test" ?typeValue list(testName)) ; Add Local Variable to Created Test
)

The problem here is that the global variable is added but the design variable is not under the new created test.

I tried adding the design variable after the maestro view is created and loaded by running the following code in CIW;

sessionName=axlGetWindowSession()
openedTests = maeGetSetup(?session sessionName)
maeSetVar("myvar" "1" ?session sessionName ?typeName "test" ?typeValue openedTests)

and this method adds the design variable.

What am I missing here? Is there any better way to automatically add some global variables and/or design variables when a new maestro view is created?

Kind regards,

Naci

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    Hi Naci,

    I think you may need to use the "postCreatedTest" signal (rather than "createdTest"). This was added in IC6.1.8/ICADVM18.1 ISR9 so you need to ensure you're using at least that version...

    Andrew.

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

    Hi Andrew,

    Thank you for your fast reply. I tried "postCreatedTest" trigger, however it is only triggered when I create a new test under Assembler window. It is not triggered when I create a new test while openen Explorer window. Addiitonally, when a maestro view is created while opening in Assembler window, this code is not triggered until a test is created, hence the global variable is not added immediately after maestro view is created.

    I couldn't find a trigger that works fine with what I want. I used "postInstall" trigger and checked if variable exists before creating it. Here is the new code;

    procedure(CCFaddTestCreatedTrigger(sessionName)
      axlSessionConnect(sessionName "postInstall" 'CCFtestCreatedTrigger)
    )

    procedure(CCFregCreatedTestTrigger()
      axlSessionRegisterCreationCallback('CCFaddTestCreatedTrigger)
    )

    procedure(CCFtestCreatedTrigger(sessionName)
      printf("> ADE Window Session %s is opened\n" sessionName)
      t_varname="myvar"
      ; Add Local Design Var
      openedTests = maeGetSetup(?session sessionName)
      printf("> List of opened tests %L\n" openedTests)
      for( n 1 length(openedTests)
        if( maeGetVar(t_varname ?typeName "test" ?typeValue nthelem(n openedTests) ?session sessionName )==nil then
          printf("> ADDING Local Design Var %s in Test %s\n" t_varname nthelem(n openedTests))
          maeSetVar(t_varname "1" ?session sessionName ?typeName "test" ?typeValue list(nthelem(n openedTests))) ; Add Local Variable to All Opened Test
       else
         printf("> Local Design Var %s EXISTS in Test %s\n" t_varname nthelem(n openedTests))
        ); if
      ); for
      ; Add Global Var
      if( maeGetVar(t_varname ?typeName "test" ?typeValue "Global" ?session sessionName )==nil then
        printf("> Adding Global Var %s in Session %s\n" t_varname sessionName)
        maeSetVar(t_varname "1" ?session sessionName) ; Add Global Variable
      else
        printf("> Global Var %s EXISTS in Session %s\n" t_varname sessionName)
      ) ; if
    )

    But, I get the following warning when I check if "myvar" exists with "maeGetVar";

    WARNING (EXPLORER-10043): Cannot get the value of variable 'myvar' for test 'Test_Name_1' because the variable does not exist in the given setup. Specify a valid variable name.

    Is there another way to check if variable exists, that would not cause a warning?

    Lastly, I have the concern that this code will be run every time a new Explorer/Assembler window is opened, which does not seem to be the best method. Do you have any better suggestion?

    Thanks in advance.

    Naci

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Naci
    Naci over 4 years ago in reply to Naci

    Another strange behavior I have just realized; the code is run 6 times every time a new Explorer/Assembler window is opened.What would be the explanation for this behaviour?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Naci
    Naci over 4 years ago in reply to Naci

    Another strange behavior I have just realized; the code is run 6 times every time a new Explorer/Assembler window is opened.What would be the explanation for this behaviour?

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

    My guess is that you've loaded the code several times as you've been debugging it and re-called the function that creates the trigger. Each time it adds another call to the trigger, even if the same function. So you should quit and restart Virtuoso.

    I don't have time today to debug - best to go to customer support on this. I will however share some recent code I wrote which seems to work (although that wasn't very thoroughly tested either, to be honest). This uses axl functions and does check for the existence of the variable before adding it so might give you an answer to avoid the warning.

    /* abAddDesignVarToNewTest.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Nov 19, 2020 
    Modified   
    By         
    
    Example of adding a design variable to new and existing tests
    automatically. Adjust as needed...
    
    ***************************************************
    
    SCCS Info: @(#) abAddDesignVarToNewTest.il 11/19/20.09:17:03 1.1 (tweaked)
    
    */
    
    procedure(abAddDesignVarToNewTestCB(session testName)
        let((sdb test)
            sdb=axlGetMainSetupDB(session)
            test=axlGetTest(sdb testName)
            axlPutVar(test "MYVAR" "0")
        )
    )
    
    procedure(abAddDesignVarToExistingTestsCB(session)
        let((sdb test varHandle)
            sdb=axlGetMainSetupDB(session)
            foreach(testName cadr(axlGetTests(sdb))
                test=axlGetTest(sdb testName)
                ; the zerop means there is no handle for the variable
                ; i.e. it doesn't exist
                when(zerop(axlGetVar(test "MYVAR"))
                    axlPutVar(test "MYVAR" "0")
                )
            )
            t
        )
    )
    
    procedure(abAddDesignVarToNewTestInit(session)
        ; this handles tests added within an open ADE session
        axlSessionConnect(
            session "postCreatedTest" 'abAddDesignVarToNewTestCB
        )
        ; this fixes any existing tests at the time the session is opened
        axlSessionConnect(
            session "postInstall" 'abAddDesignVarToExistingTestsCB
        )
    )
    
    ; add the trigger for creation so that the signals above can be
    ; handled
    axlSessionRegisterCreationCallback('abAddDesignVarToNewTestInit)
    
    • Cancel
    • Vote Up +2 Vote Down
    • Cancel
  • Naci
    Naci over 4 years ago in reply to Andrew Beckett

    Dear Andrew,

    Sorry for the late response.

    You were rigth, repetitive execution of the functions was because I loaded them several times. I didn't know that behavior.

    I have just tried your functions and it works like a charm. I am new in SKILL and didn't know if axl functions would work fine with maestro views, too. Apperently, they do. Thank you very much for your help.

    Cordially,

    Naci

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ThierryB
    ThierryB over 4 years ago in reply to Naci

    Dear Andrew,

    Thanks a lot for the code and advices!!!
    Very useful for my team !!!  moving from ADE L toward ADE Explorer/Assembler

    Best regards

    Thierry

    • 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