The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 29th, 2024, 12:05am
Pages: 1
Send Topic Print
Detecting "end of simulation" (Read 2447 times)
nthoangga
New Member
*
Offline



Posts: 4

Detecting "end of simulation"
Oct 07th, 2016, 3:50pm
 
I have a block of code that monitor a signal in VerilogAMS. Right now, I'm trying to do $fdisplay to output the maximum value of that signal, but I only want to output it once for the whole simulation.

So the question is: "Is there anyway to detect end of simulation, so that I can trigger the $fdisplay event at end of simulation?"

Right now, I have a quick hack of triggering $fdisplay at arSimTime, and I specify arSimTime on my ADE state. But this won't work if I kill my simulation or my simulation crash in the middle.

Thanks,
Hoang
Back to top
 
 
View Profile   IP Logged
kemiyun
New Member
*
Offline



Posts: 6

Re: Detecting "end of simulation"
Reply #1 - Oct 7th, 2016, 10:29pm
 
To get rid of time parameter in ADE you can do
Code:
@(final_step)
   $fdisplay 


I haven't checked if final_step event occurs if the sim is killed or crashed graciously but it is very likely that it does.

Checking an unexpected crash (power outage or something) is very hard I think. Easiest way I can think of is opening a file and updating the value you want to report whenever it is changed.
Back to top
 
 
View Profile   IP Logged
nthoangga
New Member
*
Offline



Posts: 4

Re: Detecting "end of simulation"
Reply #2 - Oct 14th, 2016, 8:07am
 
Hi,

Thanks for your reply. "final_step" does work when the sim runs untill finished.

Because I have to submit the sim through lsf, "final_step" doesn't catch it when I kill the sim (which is equivalent to power outage?).

I haven't try to stop the sim through ADE and see if "final_step" will work in that case though.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.