• 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. Allegro X Scripting - Skill
  3. Pass data/values between two skill codes/allegro instan...

Stats

  • State Not Answered
  • Replies 12
  • Subscribers 19
  • Views 6102
  • Members are here 0
More Content

Pass data/values between two skill codes/allegro instances

mir0mik
mir0mik over 2 years ago

Hi,

I'm working on a skill code that will in him self run another instance of allegro through batch call axlRunBatchDBProgram() and I would like to pass some variable/valuest to the batch instance as an input and vice versa.

Is this possible? Is there some way how to create/share variables between two programs?

Thanks!

Miro

  • Cancel
  • Sign in to reply
  • TCHA
    0 TCHA over 2 years ago

    There can be a couple of ways.

    If you want to call another database, then yes for example
    sh("allegro <board-name")
    invokes another allegro as shown in the image below

    The command line arguments of allegro are limited
    allegro -product Allegro_performance board.brd -s script.scr -nograph

    If you want to pass some other arguments, then you can do by writing a batch script, example test.scr
    writing a bat file to call that script ex: myrun.bat file to call (allegro -s test.scr -product Allegro_performance -nographic unnamed.dra)
    and calling bat file using sh("myrun.bat")

    You can refer to the article provided in the below link for more information on scripts and how to run the script in a batch mode.

    support.cadence.com/.../ArticleAttachmentPortal

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mir0mik
    0 mir0mik over 2 years ago in reply to TCHA

    Hi, thanks for the reply, but this is not the issue... I can run the another alegro but let say in the first SKill code I have a variable x = list( "A" "B" C")

    I will run the new instance of allegro with -s parameter that will run a script that will lunch a skill scrit an in than new one if I have print( x) it will be unbound variable error... The question is how to pass the x variable value from one skill to another (like share or at least copy the value)

    Thanks,

    Miro

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • B Bruekers
    0 B Bruekers over 2 years ago in reply to mir0mik

    There is a mechanism for this using mps.

    Some code to help you going with this.

    Skill code on the host side:  (after loading code call mps_startHost() )


    /* HOST SIDE */
    defun( mps_startHost ()
        defvar(_mpsExp nil)
      _mpsExp = mpsExport("Host123" "remoteSkill" "v1" list('mps_HostFunction1 'mps_HostFunction2))
      ;mpsClose(_mpsExp)
    );defun

    defun( mps_closeHost ()
        mpsClose(_mpsExp)
    )

    defun( mps_HostFunction1 (data)
        axlMsgPut( "mps_HostFunction1 %L " data)
        "return 1"
    )

    defun( mps_HostFunction2 (data)
        axlMsgPut( "mps_HostFunction2 %L " data)
        "return 2"
    )

    client side skill code:   (after loading call mps_startClient() )

    /* CLIENT SIDE */
    defun( mps_startClient ()
        let( ()
        _mpsImp = mpsImport("Host123" "remoteSkill" "v1" )
        ;_mpsImp->??
     
    ));defun

    Now at the client side you can call the host function like this:
    _mpsImp->mps_HostFunction1("test1")

    This call will result in "return1".  This is the value returned by the function on the HOST.
    On the host side you will see "test1", this is the value send from the CLIENT

    Look at the 'Distributed SKILL' for more information about these functions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mir0mik
    0 mir0mik over 2 years ago in reply to B Bruekers

    Hi B Bruekers,

    Thanks a lot. I'm looking into the Distributed SKILL but the documentation is relatively "sparse"... however, I have been able to run/modify your code, but I have a few questions.

    The example you shared:

    - first code creates "server"

    - define two functions that can be executed remotely from the second code but they will be executed in the first code

    My question is - how I can transfer some "data/values" from the first code to the second code?

    the first code will create a list of let's say jedec_names and I want to send them to the second code (this I don't understand how to do)

    the second code once received will check some stuff and then send it back (this part is in your example - I mean I can pass them to some function in the first code as input)

    Thanks!

    Miro

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mir0mik
    0 mir0mik over 2 years ago in reply to mir0mik

    Hi, I'm stupid :) the "return1" will be the data I need to get. I need to test it but I think it will be OK (it was 00:15 am) when I waited the previous reply :D

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
Cadence Guidelines

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