Fix FST trace initial time stamp. (#2264)

If the first dump was not at time zero, then the FST trace used
to contain the initial values as if they were set at time zero. Now
they only appear at the time the first dump call is actually made,
and hence match the VCD trace exactly.
This commit is contained in:
Geza Lore 2020-04-18 23:54:02 +01:00 committed by GitHub
parent 39d7cbf412
commit 74e16d85c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 11 deletions

View File

@ -230,6 +230,7 @@ void VerilatedFst::dump(vluint64_t timeui) {
return; return;
} }
m_minNextDumpTime = timeui + 1; m_minNextDumpTime = timeui + 1;
fstWriterEmitTimeChange(m_fst, timeui);
if (VL_UNLIKELY(m_fullDump)) { if (VL_UNLIKELY(m_fullDump)) {
m_fullDump = false; // No more need for next dump to be full m_fullDump = false; // No more need for next dump to be full
for (vluint32_t ent = 0; ent < m_callbacks.size(); ++ent) { for (vluint32_t ent = 0; ent < m_callbacks.size(); ++ent) {
@ -238,7 +239,6 @@ void VerilatedFst::dump(vluint64_t timeui) {
} }
return; return;
} }
fstWriterEmitTimeChange(m_fst, timeui);
for (vluint32_t ent = 0; ent < m_callbacks.size(); ++ent) { for (vluint32_t ent = 0; ent < m_callbacks.size(); ++ent) {
VerilatedFstCallInfo* cip = m_callbacks[ent]; VerilatedFstCallInfo* cip = m_callbacks[ent];
(cip->m_changecb)(this, cip->m_userthis, cip->m_code); (cip->m_changecb)(this, cip->m_userthis, cip->m_code);

View File

@ -1,5 +1,5 @@
$date $date
Mon Apr 6 08:10:23 2020 Sat Apr 18 22:18:21 2020
$end $end
$version $version
@ -21,10 +21,11 @@ $upscope $end
$upscope $end $upscope $end
$enddefinitions $end $enddefinitions $end
$dumpvars $dumpvars
1! #10
b00000000000000000000000000000001 "
b00000000000000000000000000000000 #
b00000000000000000000000000000001 $ b00000000000000000000000000000001 $
b00000000000000000000000000000000 #
b00000000000000000000000000000001 "
1!
#15 #15
0! 0!
#20 #20
@ -83,5 +84,5 @@ b00000000000000000000000000001010 "
0! 0!
#110 #110
1! 1!
b00000000000000000000000000001011 "
b00000000000000000000000000001100 # b00000000000000000000000000001100 #
b00000000000000000000000000001011 "

View File

@ -1,5 +1,5 @@
$date $date
Mon Apr 6 08:24:52 2020 Sat Apr 18 22:19:21 2020
$end $end
$version $version
@ -21,10 +21,11 @@ $upscope $end
$upscope $end $upscope $end
$enddefinitions $end $enddefinitions $end
$dumpvars $dumpvars
1! #10
b00000000000000000000000000000001 "
b00000000000000000000000000000000 #
b00000000000000000000000000000001 $ b00000000000000000000000000000001 $
b00000000000000000000000000000000 #
b00000000000000000000000000000001 "
1!
#15 #15
0! 0!
#20 #20
@ -83,5 +84,5 @@ b00000000000000000000000000001010 "
0! 0!
#110 #110
1! 1!
b00000000000000000000000000001011 "
b00000000000000000000000000001100 # b00000000000000000000000000001100 #
b00000000000000000000000000001011 "