how to get wallclock time between any two events (not simulation time) in vhdl

K

kevs

The problem is that i want to know how much real time has elapsed
between two events that have occured .
for eg;
if an assignment a<= 0 occurs at simulation time =0s and real time =
0s
and the assignment a<= 1fs occurs at simulation time = 1s and real
time = 1 day (just say the processor is very slow)

so i want to get the answer 1 day and not 1fs
one option that i thought was of writing a file at both the points and
thereby getting 2 files with different time stamp but it is very
crude method and would consume lot of space if i want to do
recursively

I am using modelsim so any such construct in model sim or any package
that is available online ?

thanks in advance
 
K

kevs

The problem is that i want to know how much real time has elapsed
between two events that have occured .
for eg;
if an assignment a<= 0 occurs at simulation time =0s and real time =
0s
and the assignment a<= 1fs occurs at simulation time = 1s and real
time = 1 day (just say the processor is very slow)

so i want to get the answer 1 day and not 1fs
one option that i thought was of writing a file at both the points and
thereby getting 2 files with different time stamp but it is very
crude method and would consume lot of space if i want to do
recursively

I am using modelsim so any such construct in model sim or any package
that is available online ?

thanks in advance

sorry abt the line
and the assignment a<= 1fs occurs at simulation time = 1s and real
time = 1 day (just say the processor is very slow)

i actually meant
nd the assignment a<= 1 occurs at simulation time = 1fs and real
time = 1 day (just say the processor is very slow)
 
N

NigelE

sorry abt the line
and the assignment a<= 1fs occurs at simulation time = 1s and real
 time = 1 day (just say the processor is very slow)

i actually meant
nd the assignment a<= 1 occurs at simulation time = 1fs and real
 time = 1 day (just say the processor is very slow)- Hide quoted text -

- Show quoted text -

I expect this will be simulator specific.

In ModelSim, you can call the mti_Command() FLI command to execute a
simulator or TCL command from within your VHDL, with any results
echoed in the transcript.

The simstats command gives various info about a simulation run,
including wall clock time, so a combination of these two should get
you what you're after.

Cheers

- Nigel
 
K

kevs

I expect this will be simulator specific.

In ModelSim, you can call the mti_Command() FLI command to execute a
simulator or TCL command from within your VHDL, with any results
echoed in the transcript.

The simstats command gives various info about a simulation run,
including wall clock time, so a combination of these two should get
you what you're after.

Cheers

- Nigel

hey buddy thanks a lot i was able to get it but i wanted time in
nanoseconds
so i used date +%N of linux to get the time in nanosecods
but the good news is that i learnt FLI nd got my problem solved
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top