Misc internal coverage cleanups

This commit is contained in:
Wilson Snyder 2020-05-16 07:43:22 -04:00
parent ffd461dcf8
commit 57a937df03
6 changed files with 22 additions and 12 deletions

View File

@ -123,8 +123,8 @@ void VerilatedSave::open(const char* filenamep) VL_MT_UNSAFE_ONE {
if (isOpen()) return;
VL_DEBUG_IF(VL_DBG_MSGF("- save: opening save file %s\n", filenamep););
if (filenamep[0] == '|') {
assert(0); // Not supported yet.
if (VL_UNCOVERABLE(filenamep[0] == '|')) {
assert(0); // LCOV_EXCL_LINE // Not supported yet.
} else {
// cppcheck-suppress duplicateExpression
m_fd = ::open(filenamep,
@ -146,8 +146,8 @@ void VerilatedRestore::open(const char* filenamep) VL_MT_UNSAFE_ONE {
if (isOpen()) return;
VL_DEBUG_IF(VL_DBG_MSGF("- restore: opening restore file %s\n", filenamep););
if (filenamep[0] == '|') {
assert(0); // Not supported yet.
if (VL_UNCOVERABLE(filenamep[0] == '|')) {
assert(0); // LCOV_EXCL_LINE // Not supported yet.
} else {
// cppcheck-suppress duplicateExpression
m_fd = ::open(filenamep, O_CREAT | O_RDONLY | O_LARGEFILE | O_CLOEXEC, 0666);

View File

@ -203,8 +203,8 @@ void VerilatedVcd::openNext(bool incFilename) {
}
m_filename = name;
}
if (m_filename[0] == '|') {
assert(0); // Not supported yet.
if (VL_UNCOVERABLE(m_filename[0] == '|')) {
assert(0); // LCOV_EXCL_LINE // Not supported yet.
} else {
// cppcheck-suppress duplicateExpression
if (!m_filep->open(m_filename)) {
@ -904,9 +904,9 @@ void vcdInit(void*, VerilatedVcd* vcdp, vluint32_t) {
/**/ // Note need to add 6 for next code.
/**/ vcdp->declDouble(0x1c, "doub", -1, 0);
/**/ // Note need to add 2 for next code.
/**/ vcdp->declDouble(0x1e, "flo", -1, 0);
/**/ vcdp->declFloat(0x1e, "flo", -1, 0);
/**/ vcdp->declArray(0x20, "q2", -1, 0, 95, 0);
// Note need to add 4 for next code.
/**/ // Note need to add 4 for next code.
}
void vcdFull(void*, VerilatedVcd* vcdp) {
@ -948,6 +948,7 @@ void vcdTestMain(const char* filenamep) {
doub = 0;
{
VerilatedVcdC* vcdp = new VerilatedVcdC;
vcdp->evcd(true);
vcdp->spTrace()->addInitCb(&vcdInit, 0);
vcdp->spTrace()->addFullCb(&vcdFull, 0);
vcdp->spTrace()->addChgCb(&vcdChange, 0);

View File

@ -336,8 +336,8 @@ public:
}
}
protected:
// METHODS
// Old/standalone API only
void evcd(bool flag) { m_evcd = flag; }
#endif // VL_TRACE_VCD_OLD_API
};
@ -405,6 +405,15 @@ public:
/// Internal class access
inline VerilatedVcd* spTrace() { return &m_sptrace; }
#ifdef VL_TRACE_VCD_OLD_API
//=========================================================================
// Note: These are only for testing for backward compatibility with foreign
// code and is not used by Verilator. Do not use these as there is no
// guarantee of functionality.
/// Use evcd format
void evcd(bool flag) VL_MT_UNSAFE_ONE { m_sptrace.evcd(flag); }
#endif
};
#endif // guard

View File

@ -178,7 +178,7 @@ sub test {
if ($Opt_Stage <= 9) {
travis_fold_start("upload");
print "Stage 9: Upload\n";
my $cmd = 'bash <(curl -s https://codecov.io/bash) -f $cc_dir/app_total.info';
my $cmd = "bash <(curl -s https://codecov.io/bash) -f $cc_dir/app_total.info";
print "print: Not running: $cmd\n";
travis_fold_end();
}

View File

@ -42,6 +42,6 @@ remove_source("*examples/*");
# Would just be removed with remove_source in later step
remove_gcda_regexp(qr!test_regress/.*/(Vt_|Vtop_).*\.gcda!);
exclude_line_regexp(qr/(\bv3fatalSrc\b|\bVL_UNCOVERABLE\b|\bVL_FATAL)/);
exclude_line_regexp(qr/(\bv3fatalSrc\b|\bVL_UNCOVERABLE\b|\bVL_FATAL|\bUASSERT\bERROR_RSVD_WORD)/);
1;

View File

@ -125,7 +125,7 @@ public:
// No more values but it's not defined to decrement an
// iterator past the beginning.
v3fatalSrc("Decremented iterator past beginning");
return;
return; // LCOV_EXCL_LINE
}
--m_valIt;
// Should find a value here, as Every value bucket is supposed