• 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 Design
  3. order of output evaluation in maestro results pane

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 124
  • Views 6504
  • 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

order of output evaluation in maestro results pane

sergeiGorbikov
sergeiGorbikov over 4 years ago

can I set the order in which maestro outputs are evaluated (executed) after simulation finish?

Currently outputs seem to be evaluated in parallel (simultaneously) as simulation ends, while I need them to be evaluated one after another (in a specific order).

Below is a principal description of my situation

there are two outputs in a maestro test

pic 1

1) the first output, “run_python”, executes a python script in Linux. During execution the python script saves some data to the text file “my_file.txt”. When finished, the script returns 0 (success).

2) the second output, “my_metric” reads data from the file “my_file.txt”. It uses skill procedures “lineread” and “nth” to return a number.

When the simultion finishes Results pane looks like following:

pic 2

After the button “re-evaluate results” has been pressed Results pane looks like following:

pic 3

What I need is that pic 3 is generated at simulation finish, not pic 2.

I tried skill interprocess communication functions like ipcSleep without success. Probably the problem can be solved using a Run Plan, however, this is not what is wanted. It should work in a standalone test without using the re-evaluation button.

I use virtuoso IC6.1.8-64b.500.16

Please help

sincerely, sergei

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

    Hi Sergei,

    ADE figures out the dependencies between output expressions and ensures they are evaluated in order based on that dependency. So you could just make your my_metric expression:

    run_python && read_file("my_file.txt" 1)

    I think that should work. run_python will be true (0 is true in SKILL) and the overall result of the expression will be the read_file result. 

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • sergeiGorbikov
    sergeiGorbikov over 4 years ago in reply to Andrew Beckett

    Dear Andrew

    I am genuinely surprised how promptly you have responded.

    this is a good idea, I will try it.

    The complication is that in my real setup I read the same file three times (read the first line of the file to the output py_gain -> read the second line of the file to the output py_offset -> read the third line of the file to the output py_rms_error):

    pic 1 (this is the real setup)

    the contents of py_data.txt are

    $ cat py_data.txt
    0.8626197392827424
    0.0003209694507691382
    0.0008287802591069362

    So, if I use the solution proposed by you, I need to execute the same python script three times (while currently this is accomplished by running the script once).

    Can this be circumvented somehow (so that the python script is executed only once)?

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

    Hi Sergei,

    The solution I proposed doesn't require the python script to be executed three times. Each of py_gain, py_offset and py_rms_error would use the result of run_python (which would be 0) to compute the result - but it would only be evaluated once. There's then a dependency between the expressions so that ADE knows that run_python must be evaluated first because the other three expressions are dependent upon it.

    Andrew

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

    Dear Andrew

    You are right, your solution doesn’t seem to require multiple executions of run_python.

    The solution you proposed solves my problem. Thank you very much. You are my savior.

    The final solution which I picked (for possible reference by the community):

    The arrows on the pic above show that an output name is used as an input in the next chain member.

    where

    procedure(
    return_true(any_arg)
    t
    )

    Several comments

    1) run_python occasiaonally returned values other than zero. So, return_true function was introduced.

    alternatively instead of “return_true(run_python)”, “ run_python != 256” could have been used as Linux exit codes are between 0 and 255 as I know.

    2) my real code was more complicated that described above. There were more steps, in particular, there was an operation where a waveform was saved to the disk. Occasionally it was executed after run_python which produced an error.

    So, finally this way a desired chain of executions was achieved.

    3) I’m not sure that “0” and “t” can be used interchangeably in SKILL (you said “0 is true in SKILL”).

    In both of the statements ‘0 && (b=3)’ and ‘1 && (b=3)’, the second command is executed (3 is assigned to b).

    So, it seems using ‘t’ and ‘nil’ is a more reliable way to control wheter the second statement is executed or not (rather than 0 and not 0).

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

    Dear Andrew

    You are right, your solution doesn’t seem to require multiple executions of run_python.

    The solution you proposed solves my problem. Thank you very much. You are my savior.

    The final solution which I picked (for possible reference by the community):

    The arrows on the pic above show that an output name is used as an input in the next chain member.

    where

    procedure(
    return_true(any_arg)
    t
    )

    Several comments

    1) run_python occasiaonally returned values other than zero. So, return_true function was introduced.

    alternatively instead of “return_true(run_python)”, “ run_python != 256” could have been used as Linux exit codes are between 0 and 255 as I know.

    2) my real code was more complicated that described above. There were more steps, in particular, there was an operation where a waveform was saved to the disk. Occasionally it was executed after run_python which produced an error.

    So, finally this way a desired chain of executions was achieved.

    3) I’m not sure that “0” and “t” can be used interchangeably in SKILL (you said “0 is true in SKILL”).

    In both of the statements ‘0 && (b=3)’ and ‘1 && (b=3)’, the second command is executed (3 is assigned to b).

    So, it seems using ‘t’ and ‘nil’ is a more reliable way to control wheter the second statement is executed or not (rather than 0 and not 0).

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

    In SKILL, nil means false, and anything else means true (so t, "hello", 1, 0, 256 are all true). So not really sure that you really need your return_true() function - unless there is some reason for the dependent result to return nil and still be treated as "success"?

    Andrew

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

    I agree, probably instead of

    return_true(previous_chain_element) && do_something()

    just

    previous_chain_element && do_something()

    can be used and it should work.

    At that, if previous_chain_element by coincidence is evaluated to nil, do_something() will not be executed, what is not expected behavior.

    So, using return_true ensures that both

    1) the second command (after &&) is always executed

    and

    2) the proper order of command execution is communicated to ADE.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to sergeiGorbikov
    sergeiGorbikov said:
    At that, if previous_chain_element by coincidence is evaluated to nil, do_something() will not be executed, what is not expected behavior.

    That said, I would expect that if your previous output returned nil, that might reasonably indicate an error condition, and so it probably doesn't make a great deal of sense for the subsequent expression to be evaluated. Of course, this rather depends on previous_chain_element returning something useful (which I just assumed it would, and wouldn't just return some random value which might accidentally be nil). Anyway, this all depends on your setup - your mileage may vary!

    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