timeformat unit

V

valtih1978

Guest
The reference http://www.asic-world.com/verilog/vqref1.html simply says
that $timeformat(unit#, prec#, "unit", minwidth)

I tried $timeformat(-3, 0, "ms", 0) and got seconds printed with suffix
'ms' instead milliseconds. IMO, seconds should have unit# = 0. I read
the newsgroup suggestion to use $timeformat ("-9, 0, " ns", 5)
http://groups.google.com/d/msg/comp.lang.verilog/wvb3pH61XR8/xOwC4JAOcpsJ So,
it tells that -9 corresponds to nanoseconds, so -3 must be ms. Why does
Modelsim violate the common sense and comp.lang.verilog understanding of
Verilog specification?
 
On 21/02/13 12:07, valtih1978 wrote:
The reference http://www.asic-world.com/verilog/vqref1.html simply says
that $timeformat(unit#, prec#, "unit", minwidth)

I tried $timeformat(-3, 0, "ms", 0) and got seconds printed with suffix
'ms' instead milliseconds. IMO, seconds should have unit# = 0. I read
the newsgroup suggestion to use $timeformat ("-9, 0, " ns", 5)
http://groups.google.com/d/msg/comp.lang.verilog/wvb3pH61XR8/xOwC4JAOcpsJ So,
it tells that -9 corresponds to nanoseconds, so -3 must be ms. Why does
Modelsim violate the common sense and comp.lang.verilog understanding of
Verilog specification?
I'm not sure what you're saying. The third parameter is an arbitrary
string. You may write

$timeformat(-9, 0, "ms", 0)

and you will get time in ns, zero decimal places, suffix "ms", no
minimum field width.

Of course you must use this together with %t, and you must use $realtime
if you set the precision to something other than zero.

Did you use %t?

regards
Alan

--
Alan Fitch
 
$timeformat(-9, 0, "ms", 0)

and you will get time in ns, zero decimal places, suffix "ms", no
minimum field width.
Might be I am just missing something. I expected that $realtime will
show my wall clock time. Just surprisingly it matched 1/1000 of real
second.
 
On 24/02/13 13:51, valtih1978 wrote:
$timeformat(-9, 0, "ms", 0)

and you will get time in ns, zero decimal places, suffix "ms", no
minimum field width.

Might be I am just missing something. I expected that $realtime will
show my wall clock time. Just surprisingly it matched 1/1000 of real
second.

No, $realtime shows time as a float, $time shows it as an integer (which
of course gets rounded or truncated, I can't remember which),

regards
Alan

--
Alan Fitch
 

Welcome to EDABoard.com

Sponsor

Back
Top