The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Detecting "end of simulation"
https://designers-guide.org/forum/YaBB.pl?num=1475880616

Message started by nthoangga on Oct 7th, 2016, 3:50pm

Title: Detecting "end of simulation"
Post by nthoangga on Oct 7th, 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

Title: Re: Detecting "end of simulation"
Post by kemiyun on 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.

Title: Re: Detecting "end of simulation"
Post by nthoangga on 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.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.