• 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. Functional Verification
  3. Reading simulation time to a variable

Stats

  • Locked Locked
  • Replies 17
  • Subscribers 65
  • Views 18910
  • 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

Reading simulation time to a variable

Pedro Cardoso
Pedro Cardoso over 3 years ago

Hello,

Does anyone know if it is possible to read the running time and, then store it into a variable using TCL? 

Imagine that a simulation is running. Every time it is simulating the time moves, when it's not the time doesn't. With this, I would like to retrieve the real simulation time.

Thanks in advance.

Kind regards,

Pedro

  • Cancel
  • Pedro Cardoso
    Pedro Cardoso over 3 years ago in reply to StephenH

    Hi Stephen,
    But how do I tell xrun where to stop and measure the time?

    Please note that I am entering my commands in the console.

    Cheers,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Pedro Cardoso
    Pedro Cardoso over 3 years ago in reply to StephenH

    Hi Stephen

    I cannot make this work.

    So, do I have to call xrun as "xrun -status -status3" or as "xrun -status -status 3" ?
    Am I missing something?

    Best regards,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 3 years ago in reply to Pedro Cardoso

    Hi Pedro.

    It's the first one: "xrun -status -status3".

    The "-status" tells it to dump a CPU/memory summary at exit, and "-status3" tells it to dump the more verbose version of the summary, with a break-down for the individual tool components.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Pedro Cardoso
    Pedro Cardoso over 3 years ago in reply to StephenH

    Hi,

    Thanks for the answer.

    But how does the simulator know when to dump the summary ? I should have to write some command to tell the simulator that I want to generate the report at that point of the code.

    Otherwise, how xrun would know that the program had ended?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Pedro Cardoso
    Pedro Cardoso over 3 years ago in reply to StephenH

    Hi Stephen,

    Can you please give me your inputs on my last question? I would really appreciate it.

    Best regards,

    Pedro

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • StephenH
    StephenH over 3 years ago in reply to Pedro Cardoso

    The summary is dumped when you exit the simulator.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Pedro Cardoso
    Pedro Cardoso over 3 years ago in reply to StephenH

    This is the output I have 

    Aggregate audit (2:30:10 PM, Fri Dec 10, 2021):
    Time used: CPU = 47.9 ks (13h 18m 36s), elapsed = 13 ks (3h 36m 17s), util. = 369%.
    Time spent in licensing: elapsed = 20.6 s.
    Peak memory used = 2.33 Gbytes.
    Simulation started at: 10:53:53 AM, Fri Dec 10, 2021, ended at: 2:30:10 PM, Fri Dec 10, 2021, with elapsed time (wall clock): 13 ks (3h 36m 17s).
    spectre completes with 0 errors, 89 warnings, and 22 notices.
    xmsim: Memory Usage - Final: 1289.0M, Peak: 1345.3M, Peak virtual: 1734.9M
    xmsim: CPU Usage - 3314.5s system + 46984.3s user = 50298.8s total (14821.7s, 100.0% cpu) (myhost)
    xrun: Time - 15071.8s
    TOOL: xrun(64) 20.05-t004-20201018: Exiting on Dec 10, 2021 at 14:43:02 CET (total: 04:11:12)

    Do I have to divide the time, returned by the simulator, by the number of cpus I've used? Otherwise, the result doesn't make sense.

    15071 seconds is 4.18h, which is more than the "wall clock" value.

    • 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