• 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. Set AMS options automatically

Stats

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

Set AMS options automatically

tyanata
tyanata over 10 years ago

Hello,

I want to realize automatic setting of following settings of AMS ADE GUI:

ADE->Simulation->Options->AMS Simulator->INCLUDE OPTIONS

 ADE->Simulation->Options->AMS Simulator->DISCIPLINE OPTIONS

The loaded ConnectRules used in the current session with skill.

But the those settings have not to be done globally ( using envSetVal expressions which is possible), but for a certain ADE only, I already asked cadence support but it seems there are not public options, active session based setting to be achieved.

So I am trying to overcome that obstacle automatically opening the dedicated option forms and setting them, but the problem is that the forms are blocking and the code execution stops, I am bypassing that using hiRegTimer expressions. See my code bellow:

procedure(AMS_config()
    let((local_session_id)

        local_session_id = hiGetCurrentWindow()->sevSession
        hiRegTimer("connect_rules_form_set(local_session_id) ams_options_form_set(local_session_id)" 10)
        sevSetConnectModules(local_session_id)
        sevSetEngineOptions(local_session_id 'simOptions)
    );let
);procedure

procedure(ams_options_form_set(loc_sess)
    let((local_sim_ams_opts_form)

        local_sim_ams_opts_form = hiGetCurrentForm()
       
        local_sim_ams_opts_form->dresolution->value = t
        local_sim_ams_opts_form->optsFile->value = "./somefile.inc"

        hiFormDone(local_sim_ams_opts_form)

    );let
);procedure


procedure(connect_rules_form_set(loc_sess)
    let((local_connect_rules_form form_sym_str)

        local_connect_rules_form = hiGetCurrentForm()

        local_connect_rules_form->rule->value="connectLib.ConnRules_ss_full"
        _amsaConnRulesFormCB('addBButton)
        hiReportSelectItems(local_connect_rules_form->rulesInfoList list( 0) t)
        _amsaConnRulesFormCB('deleteButton)

        hiFormDone(local_connect_rules_form)

    );let
);procedure

That code generally has to work but some thing is not stable, let's say if you execute AMS_config() 10 times, in 2-3 times it will finish OK and 7-8 times it will stop on first GUI opening. The reason is that somehow hiGetCurrentForm is not giving expected results.

Can you give me some ideas, how to accomplish the task!

Best regards,

tyanata

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    First of all I would suggest you ask customer support to file an enhancement for a proper public procedural interface for this.

    The second issue you have is that you're opening two forms, and then having the hiRegTimer callback try to interact with both forms, each assuming hiGetCurrentForm.

    However, even if you rewrite it so that it launches one form, deals with that in an hiRegTimer() callback, and then launches the second form and another hiRegTimer to deal with that - the second form doesn't set the current form for some reason, so it still doesn't work (for me) unless I happen to move my cursor within the focus of the second form during the time it arrives on the screen.

    So I used a different approach. This is pretty horrible though... and so I would certainly be pushing for a public procedural interface.

    procedure(AMS_config()
        let((local_session_id)

            local_session_id = hiGetCurrentWindow()->sevSession
            hiRegTimer(sprintf(nil "connect_rules_form_set('%s)" local_session_id) 0)
            sevSetConnectModules(local_session_id)
        );let
    );procedure

    procedure(ams_options_form_set(loc_sess)
        let((local_sim_ams_opts_form asiSession theForm)

            ;----------------------------------------------------------------
            ; Convoluted way of finding the form, because hiGetCurrentForm()
            ; is not returning the correct form for this second form.
            ; So instead, look at all forms that exist, and find one which is
            ; displayed, has the right session associated with it, and has
            ; the right title
            ;----------------------------------------------------------------
            asiSession=sevEnvironment(loc_sess)
            local_sim_ams_opts_form =
                car(exists(form hiFormList()
                    {
                        theForm=symeval(form)
                        hiIsFormDisplayed(theForm) && theForm->asiSession==asiSession && theForm->_formName=="AMS Options"
                    }))
           
            when(local_sim_ams_opts_form
                local_sim_ams_opts_form=symeval(local_sim_ams_opts_form)
                local_sim_ams_opts_form->dresolution->value = t
                local_sim_ams_opts_form->optsFile->value = "./somefile.inc"
                hiSetCurrentForm(local_sim_ams_opts_form)
                hiFormDone(local_sim_ams_opts_form)
            )

        );let
    );procedure

    procedure(connect_rules_form_set(loc_sess)
        let((local_connect_rules_form form_sym_str)

            local_connect_rules_form = hiGetCurrentForm()

            local_connect_rules_form->rule->value="connectLib.ConnRules_ss_full"
            _amsaConnRulesFormCB('addBButton)
            hiReportSelectItems(local_connect_rules_form->rulesInfoList list( 0) t)
            _amsaConnRulesFormCB('deleteButton)

            hiFormDone(local_connect_rules_form)
            ;----------------------------------------------------------------
            ; Having done with the connect rules, set the options
            ;----------------------------------------------------------------
            hiRegTimer(sprintf(nil "ams_options_form_set('%s)" loc_sess) 0)
            sevSetEngineOptions(loc_sess 'simOptions)

        );let
    );procedure

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 10 years ago

    Hello Andrew,

    Thanks for the very useful response. I tried the script as you modified it and is working but again once per 3-4 runs (never first run ) it is failing on the first form. I think somehow when the scripts is executed quickly several times hiGerCurrentForm is finding somehow already closed AMS options form from the previous execution. So I modified the Connect rule procedure also reusing the approach proposed by you for finding proper form instead of hiGetCurrentForm.

    So finally my script looks as follows:

    procedure(AMS_config()
        let((local_session_id)
            local_session_id = hiGetCurrentWindow()->sevSession
            hiRegTimer(sprintf(nil "connect_rules_form_set('%s)" local_session_id) 0)
            sevSetConnectModules(local_session_id)
        );let
    );procedure


    procedure(ams_options_form_set(loc_sess)
        let((local_sim_ams_opts_form local_sim_ams_opts_form_ asiSession theForm gui_form)

            ;----------------------------------------------------------------
            ; Convoluted way of finding the form, because hiGetCurrentForm()
            ; is not returning the correct form for this second form.
            ; So instead, look at all forms that exist, and find one which is
            ; displayed, has the right session associated with it, and has
            ; the right title
            ;----------------------------------------------------------------
            asiSession=sevEnvironment(loc_sess)

            local_sim_ams_opts_form_ =
                car(exists(gui_form hiFormList()
                    {
                        theForm = symeval(gui_form)
                        hiIsFormDisplayed(theForm) && theForm->asiSession == asiSession && theForm->_formName == "AMS Options"
                    }
                )
            )

            if(hiiSetCurrentForm(local_sim_ams_opts_form_) == nil then
                hiSetCurrentForm(local_sim_ams_opts_form_)
            )

            when(local_sim_ams_opts_form_
                local_sim_ams_opts_form = symeval(local_sim_ams_opts_form_)
                local_sim_ams_opts_form->dresolution->value = t
                local_sim_ams_opts_form->optsFile->value = "$T_DIR/dig_libs_for_sscm/include_sscm_diglibs.inc"
                hiFormDone(local_sim_ams_opts_form)
            );when

        );let
    );procedure

    procedure(connect_rules_form_set(loc_sess)
        let((local_connect_rules_form gui_form local_connect_rules_form_ asiSession)

            asiSession=sevEnvironment(loc_sess)

            local_connect_rules_form_ =
                car(exists(gui_form hiFormList()
                    {
                        theForm=symeval(gui_form)
                        hiIsFormDisplayed(theForm) && theForm->asiSession == nil && theForm->_formName == "Select Connect Rules"
                    }
                )
            )

            if(hiiSetCurrentForm(local_connect_rules_form_) == nil then
                hiSetCurrentForm(local_connect_rules_form_)
            )

            when(local_connect_rules_form_
                local_connect_rules_form = symeval(local_connect_rules_form_)
                hiReportSelectItems(local_connect_rules_form->rulesInfoList list( 0) t)
                _amsaConnRulesFormCB('deleteButton)
                local_connect_rules_form->rule->value = "connectLib.ConnRules_ss_full"
                _amsaConnRulesFormCB('addBButton)

                hiFormDone(local_connect_rules_form)

            );if

            ;----------------------------------------------------------------
            ; Having done with the connect rules, set the options
            ;----------------------------------------------------------------
            hiRegTimer(sprintf(nil "ams_options_form_set('%s)" loc_sess) 0)
            sevSetEngineOptions(loc_sess 'simOptions)

        );let
    );procedure

    Thanks and best regards,

    tyanata

    • 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