Internals: Detab and fix spacing style issues in some include files. No functional change.
This commit is contained in:
parent
f818ddc71c
commit
b23fc06388
|
|
@ -1712,7 +1712,7 @@ This is an example similar to the above, but using SystemC.
|
||||||
#include "Vour.h"
|
#include "Vour.h"
|
||||||
int sc_main(int argc, char **argv) {
|
int sc_main(int argc, char **argv) {
|
||||||
Verilated::commandArgs(argc, argv);
|
Verilated::commandArgs(argc, argv);
|
||||||
sc_clock clk ("clk",10, 0.5, 3, true);
|
sc_clock clk ("clk", 10, 0.5, 3, true);
|
||||||
Vour* top;
|
Vour* top;
|
||||||
top = new Vour("top");
|
top = new Vour("top");
|
||||||
top->clk(clk);
|
top->clk(clk);
|
||||||
|
|
@ -3894,7 +3894,7 @@ Often UNOPTFLAT is caused by logic that isn't truly circular as viewed by
|
||||||
synthesis which analyzes interconnection per-bit, but is circular to
|
synthesis which analyzes interconnection per-bit, but is circular to
|
||||||
simulation which analyzes per-bus:
|
simulation which analyzes per-bus:
|
||||||
|
|
||||||
wire [2:0] x = {x[1:0],shift_in};
|
wire [2:0] x = {x[1:0], shift_in};
|
||||||
|
|
||||||
This statement needs to be evaluated multiple times, as a change in
|
This statement needs to be evaluated multiple times, as a change in
|
||||||
"shift_in" requires "x" to be computed 3 times before it becomes stable.
|
"shift_in" requires "x" to be computed 3 times before it becomes stable.
|
||||||
|
|
@ -3903,12 +3903,12 @@ causes the warning.
|
||||||
|
|
||||||
For significantly better performance, split this into 2 separate signals:
|
For significantly better performance, split this into 2 separate signals:
|
||||||
|
|
||||||
wire [2:0] xout = {x[1:0],shift_in};
|
wire [2:0] xout = {x[1:0], shift_in};
|
||||||
|
|
||||||
and change all receiving logic to instead receive "xout". Alternatively,
|
and change all receiving logic to instead receive "xout". Alternatively,
|
||||||
change it to
|
change it to
|
||||||
|
|
||||||
wire [2:0] x = {xin[1:0],shift_in};
|
wire [2:0] x = {xin[1:0], shift_in};
|
||||||
|
|
||||||
and change all driving logic to instead drive "xin".
|
and change all driving logic to instead drive "xin".
|
||||||
|
|
||||||
|
|
@ -4024,7 +4024,7 @@ Concatenate leading zeros when doing arithmetic. In the statement
|
||||||
|
|
||||||
The best fix, which clarifies intent and will also make all tools happy is:
|
The best fix, which clarifies intent and will also make all tools happy is:
|
||||||
|
|
||||||
wire [5:0] plus_one = from[5:0] + 6'd1 + {5'd0,carry[0]};
|
wire [5:0] plus_one = from[5:0] + 6'd1 + {5'd0, carry[0]};
|
||||||
|
|
||||||
Ignoring this warning will only suppress the lint check, it will simulate
|
Ignoring this warning will only suppress the lint check, it will simulate
|
||||||
correctly.
|
correctly.
|
||||||
|
|
@ -4036,12 +4036,12 @@ has an indeterminate width. In most cases this violates the Verilog rule
|
||||||
that widths inside concatenates and replicates must be sized, and should be
|
that widths inside concatenates and replicates must be sized, and should be
|
||||||
fixed in the code.
|
fixed in the code.
|
||||||
|
|
||||||
wire [63:0] concat = {1,2};
|
wire [63:0] concat = {1, 2};
|
||||||
|
|
||||||
An example where this is technically legal (though still bad form) is:
|
An example where this is technically legal (though still bad form) is:
|
||||||
|
|
||||||
parameter PAR = 1;
|
parameter PAR = 1;
|
||||||
wire [63:0] concat = {PAR,PAR};
|
wire [63:0] concat = {PAR, PAR};
|
||||||
|
|
||||||
The correct fix is to either size the 1 ("32'h1"), or add the width to the
|
The correct fix is to either size the 1 ("32'h1"), or add the width to the
|
||||||
parameter definition ("parameter [31:0]"), or add the width to the
|
parameter definition ("parameter [31:0]"), or add the width to the
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ public: // But only local to this file
|
||||||
// Derived classes should call zero() in their constructor
|
// Derived classes should call zero() in their constructor
|
||||||
VerilatedCovImpItem() {
|
VerilatedCovImpItem() {
|
||||||
for (int i=0; i<MAX_KEYS; ++i) {
|
for (int i=0; i<MAX_KEYS; ++i) {
|
||||||
m_keys[i]=KEY_UNDEF;
|
m_keys[i] = KEY_UNDEF;
|
||||||
m_vals[i]=0;
|
m_vals[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual ~VerilatedCovImpItem() {}
|
virtual ~VerilatedCovImpItem() {}
|
||||||
|
|
@ -135,7 +135,7 @@ private:
|
||||||
std::string rtn;
|
std::string rtn;
|
||||||
for (const char* pos = text.c_str(); *pos; ++pos) {
|
for (const char* pos = text.c_str(); *pos; ++pos) {
|
||||||
if (!isprint(*pos) || *pos=='%' || *pos=='"') {
|
if (!isprint(*pos) || *pos=='%' || *pos=='"') {
|
||||||
char hex[10]; sprintf(hex,"%%%02X",pos[0]);
|
char hex[10]; sprintf(hex, "%%%02X", pos[0]);
|
||||||
rtn += hex;
|
rtn += hex;
|
||||||
} else {
|
} else {
|
||||||
rtn += *pos;
|
rtn += *pos;
|
||||||
|
|
@ -180,7 +180,7 @@ private:
|
||||||
|
|
||||||
// We used to backup and split on only .'s but it seems better to be verbose
|
// We used to backup and split on only .'s but it seems better to be verbose
|
||||||
// and not assume . is the separator
|
// and not assume . is the separator
|
||||||
std::string prefix = std::string(a,apre-a);
|
std::string prefix = std::string(a, apre-a);
|
||||||
|
|
||||||
// Scan backward to last mismatch
|
// Scan backward to last mismatch
|
||||||
const char* apost = a+strlen(a)-1;
|
const char* apost = a+strlen(a)-1;
|
||||||
|
|
@ -210,14 +210,14 @@ private:
|
||||||
}
|
}
|
||||||
static void selftest() VL_MT_SAFE {
|
static void selftest() VL_MT_SAFE {
|
||||||
// Little selftest
|
// Little selftest
|
||||||
if (combineHier ("a.b.c","a.b.c") !="a.b.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("a.b.c","a.b.c") !="a.b.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("a.b.c","a.b") !="a.b*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("a.b.c","a.b") !="a.b*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("a.x.c","a.y.c") !="a.*.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("a.x.c","a.y.c") !="a.*.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("a.z.z.z.c","a.b.c") !="a.*.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("a.z.z.z.c","a.b.c") !="a.*.c") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("z","a") !="*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("z","a") !="*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("q.a","q.b") !="q.*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("q.a","q.b") !="q.*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("q.za","q.zb") !="q.z*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("q.za","q.zb") !="q.z*") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
if (combineHier ("1.2.3.a","9.8.7.a") !="*.a") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
if (combineHier("1.2.3.a","9.8.7.a") !="*.a") VL_FATAL_MT(__FILE__,__LINE__,"","%Error: selftest\n");
|
||||||
}
|
}
|
||||||
void clearGuts() VL_REQUIRES(m_mutex) {
|
void clearGuts() VL_REQUIRES(m_mutex) {
|
||||||
for (ItemList::const_iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
for (ItemList::const_iterator it=m_items.begin(); it!=m_items.end(); ++it) {
|
||||||
|
|
@ -281,10 +281,10 @@ public:
|
||||||
ckeyps[1]="lineno"; valps[1]=linestr.c_str();
|
ckeyps[1]="lineno"; valps[1]=linestr.c_str();
|
||||||
// Default page if not specified
|
// Default page if not specified
|
||||||
const char* fnstartp = m_insertFilenamep;
|
const char* fnstartp = m_insertFilenamep;
|
||||||
while (const char* foundp = strchr(fnstartp,'/')) fnstartp=foundp+1;
|
while (const char* foundp = strchr(fnstartp,'/')) fnstartp = foundp+1;
|
||||||
const char* fnendp = fnstartp;
|
const char* fnendp = fnstartp;
|
||||||
while (*fnendp && *fnendp!='.') fnendp++;
|
while (*fnendp && *fnendp!='.') fnendp++;
|
||||||
std::string page_default = "sp_user/"+std::string(fnstartp,fnendp-fnstartp);
|
std::string page_default = "sp_user/"+std::string(fnstartp, fnendp-fnstartp);
|
||||||
ckeyps[2]="page"; valps[2]=page_default.c_str();
|
ckeyps[2]="page"; valps[2]=page_default.c_str();
|
||||||
|
|
||||||
// Keys -> strings
|
// Keys -> strings
|
||||||
|
|
@ -306,7 +306,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Insert the values
|
// Insert the values
|
||||||
int addKeynum=0;
|
int addKeynum = 0;
|
||||||
for (int i=0; i<MAX_KEYS; ++i) {
|
for (int i=0; i<MAX_KEYS; ++i) {
|
||||||
const std::string key = keys[i];
|
const std::string key = keys[i];
|
||||||
if (!keys[i].empty()) {
|
if (!keys[i].empty()) {
|
||||||
|
|
@ -317,7 +317,7 @@ public:
|
||||||
addKeynum++;
|
addKeynum++;
|
||||||
if (!legalKey(key)) {
|
if (!legalKey(key)) {
|
||||||
std::string msg = "%Error: Coverage keys of one character, or letter+digit are illegal: "+key;
|
std::string msg = "%Error: Coverage keys of one character, or letter+digit are illegal: "+key;
|
||||||
VL_FATAL_MT("",0,"",msg.c_str());
|
VL_FATAL_MT("", 0, "", msg.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -330,14 +330,14 @@ public:
|
||||||
Verilated::quiesce();
|
Verilated::quiesce();
|
||||||
VerilatedLockGuard lock(m_mutex);
|
VerilatedLockGuard lock(m_mutex);
|
||||||
#ifndef VM_COVERAGE
|
#ifndef VM_COVERAGE
|
||||||
VL_FATAL_MT("",0,"","%Error: Called VerilatedCov::write when VM_COVERAGE disabled\n");
|
VL_FATAL_MT("", 0, "", "%Error: Called VerilatedCov::write when VM_COVERAGE disabled\n");
|
||||||
#endif
|
#endif
|
||||||
selftest();
|
selftest();
|
||||||
|
|
||||||
std::ofstream os(filename);
|
std::ofstream os(filename);
|
||||||
if (os.fail()) {
|
if (os.fail()) {
|
||||||
std::string msg = std::string("%Error: Can't write '")+filename+"'";
|
std::string msg = std::string("%Error: Can't write '")+filename+"'";
|
||||||
VL_FATAL_MT("",0,"",msg.c_str());
|
VL_FATAL_MT("", 0, "", msg.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
os << "# SystemC::Coverage-3\n";
|
os << "# SystemC::Coverage-3\n";
|
||||||
|
|
@ -362,12 +362,12 @@ public:
|
||||||
hier = val;
|
hier = val;
|
||||||
} else {
|
} else {
|
||||||
// Print it
|
// Print it
|
||||||
name += keyValueFormatter(key,val);
|
name += keyValueFormatter(key, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (per_instance) { // Not collapsing hierarchies
|
if (per_instance) { // Not collapsing hierarchies
|
||||||
name += keyValueFormatter(VL_CIK_HIER,hier);
|
name += keyValueFormatter(VL_CIK_HIER, hier);
|
||||||
hier = "";
|
hier = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -383,7 +383,7 @@ public:
|
||||||
cit->second.second += itemp->count();
|
cit->second.second += itemp->count();
|
||||||
cit->second.first = combineHier(oldhier, hier);
|
cit->second.first = combineHier(oldhier, hier);
|
||||||
} else {
|
} else {
|
||||||
eventCounts.insert(std::make_pair(name, make_pair(hier,itemp->count())));
|
eventCounts.insert(std::make_pair(name, make_pair(hier, itemp->count())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,7 +391,7 @@ public:
|
||||||
for (EventMap::const_iterator it=eventCounts.begin(); it!=eventCounts.end(); ++it) {
|
for (EventMap::const_iterator it=eventCounts.begin(); it!=eventCounts.end(); ++it) {
|
||||||
os<<"C '"<<std::dec;
|
os<<"C '"<<std::dec;
|
||||||
os<<it->first;
|
os<<it->first;
|
||||||
if (!it->second.first.empty()) os<<keyValueFormatter(VL_CIK_HIER,it->second.first);
|
if (!it->second.first.empty()) os<<keyValueFormatter(VL_CIK_HIER, it->second.first);
|
||||||
os<<"' "<<it->second.second;
|
os<<"' "<<it->second.second;
|
||||||
os<<std::endl;
|
os<<std::endl;
|
||||||
}
|
}
|
||||||
|
|
@ -420,7 +420,7 @@ void VerilatedCov::_inserti(vluint64_t* itemp) VL_MT_SAFE {
|
||||||
VerilatedCovImp::imp().inserti(new VerilatedCoverItemSpec<vluint64_t>(itemp));
|
VerilatedCovImp::imp().inserti(new VerilatedCoverItemSpec<vluint64_t>(itemp));
|
||||||
}
|
}
|
||||||
void VerilatedCov::_insertf(const char* filename, int lineno) VL_MT_SAFE {
|
void VerilatedCov::_insertf(const char* filename, int lineno) VL_MT_SAFE {
|
||||||
VerilatedCovImp::imp().insertf(filename,lineno);
|
VerilatedCovImp::imp().insertf(filename, lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define K(n) const char* key ## n
|
#define K(n) const char* key ## n
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ bool VerilatedDeserialize::readDiffers(const void* __restrict datap, size_t size
|
||||||
}
|
}
|
||||||
|
|
||||||
VerilatedDeserialize& VerilatedDeserialize::readAssert(const void* __restrict datap, size_t size) VL_MT_UNSAFE_ONE {
|
VerilatedDeserialize& VerilatedDeserialize::readAssert(const void* __restrict datap, size_t size) VL_MT_UNSAFE_ONE {
|
||||||
if (VL_UNLIKELY(readDiffers(datap,size))) {
|
if (VL_UNLIKELY(readDiffers(datap, size))) {
|
||||||
std::string fn = filename();
|
std::string fn = filename();
|
||||||
std::string msg = std::string("Can't deserialize save-restore file as was made from different model");
|
std::string msg = std::string("Can't deserialize save-restore file as was made from different model");
|
||||||
VL_FATAL_MT(fn.c_str(), 0, "", msg.c_str());
|
VL_FATAL_MT(fn.c_str(), 0, "", msg.c_str());
|
||||||
|
|
@ -116,7 +116,7 @@ void VerilatedDeserialize::trailer() VL_MT_UNSAFE_ONE {
|
||||||
void VerilatedSave::open(const char* filenamep) VL_MT_UNSAFE_ONE {
|
void VerilatedSave::open(const char* filenamep) VL_MT_UNSAFE_ONE {
|
||||||
m_assertOne.check();
|
m_assertOne.check();
|
||||||
if (isOpen()) return;
|
if (isOpen()) return;
|
||||||
VL_DEBUG_IF(VL_DBG_MSGF("- save: opening save file %s\n",filenamep););
|
VL_DEBUG_IF(VL_DBG_MSGF("- save: opening save file %s\n", filenamep););
|
||||||
|
|
||||||
if (filenamep[0]=='|') {
|
if (filenamep[0]=='|') {
|
||||||
assert(0); // Not supported yet.
|
assert(0); // Not supported yet.
|
||||||
|
|
@ -139,7 +139,7 @@ void VerilatedSave::open(const char* filenamep) VL_MT_UNSAFE_ONE {
|
||||||
void VerilatedRestore::open(const char* filenamep) VL_MT_UNSAFE_ONE {
|
void VerilatedRestore::open(const char* filenamep) VL_MT_UNSAFE_ONE {
|
||||||
m_assertOne.check();
|
m_assertOne.check();
|
||||||
if (isOpen()) return;
|
if (isOpen()) return;
|
||||||
VL_DEBUG_IF(VL_DBG_MSGF("- restore: opening restore file %s\n",filenamep););
|
VL_DEBUG_IF(VL_DBG_MSGF("- restore: opening restore file %s\n", filenamep););
|
||||||
|
|
||||||
if (filenamep[0]=='|') {
|
if (filenamep[0]=='|') {
|
||||||
assert(0); // Not supported yet.
|
assert(0); // Not supported yet.
|
||||||
|
|
@ -194,7 +194,7 @@ void VerilatedSave::flush() VL_MT_UNSAFE_ONE {
|
||||||
if (errno != EAGAIN && errno != EINTR) {
|
if (errno != EAGAIN && errno != EINTR) {
|
||||||
// write failed, presume error (perhaps out of disk space)
|
// write failed, presume error (perhaps out of disk space)
|
||||||
std::string msg = std::string(__FUNCTION__)+": "+strerror(errno);
|
std::string msg = std::string(__FUNCTION__)+": "+strerror(errno);
|
||||||
VL_FATAL_MT("",0,"",msg.c_str());
|
VL_FATAL_MT("", 0, "", msg.c_str());
|
||||||
close();
|
close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +223,7 @@ void VerilatedRestore::fill() VL_MT_UNSAFE_ONE {
|
||||||
if (errno != EAGAIN && errno != EINTR) {
|
if (errno != EAGAIN && errno != EINTR) {
|
||||||
// write failed, presume error (perhaps out of disk space)
|
// write failed, presume error (perhaps out of disk space)
|
||||||
std::string msg = std::string(__FUNCTION__)+": "+strerror(errno);
|
std::string msg = std::string(__FUNCTION__)+": "+strerror(errno);
|
||||||
VL_FATAL_MT("",0,"",msg.c_str());
|
VL_FATAL_MT("", 0, "", msg.c_str());
|
||||||
close();
|
close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -238,5 +238,3 @@ void VerilatedRestore::fill() VL_MT_UNSAFE_ONE {
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// Serialization of types
|
// Serialization of types
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -237,12 +237,12 @@ inline VerilatedDeserialize& operator>>(VerilatedDeserialize& os, float& rhs) {
|
||||||
return os.read(&rhs, sizeof(rhs));
|
return os.read(&rhs, sizeof(rhs));
|
||||||
}
|
}
|
||||||
inline VerilatedSerialize& operator<<(VerilatedSerialize& os, std::string& rhs) {
|
inline VerilatedSerialize& operator<<(VerilatedSerialize& os, std::string& rhs) {
|
||||||
vluint32_t len=rhs.length();
|
vluint32_t len = rhs.length();
|
||||||
os<<len;
|
os<<len;
|
||||||
return os.write(rhs.data(), len);
|
return os.write(rhs.data(), len);
|
||||||
}
|
}
|
||||||
inline VerilatedDeserialize& operator>>(VerilatedDeserialize& os, std::string& rhs) {
|
inline VerilatedDeserialize& operator>>(VerilatedDeserialize& os, std::string& rhs) {
|
||||||
vluint32_t len=0;
|
vluint32_t len = 0;
|
||||||
os>>len;
|
os>>len;
|
||||||
rhs.resize(len);
|
rhs.resize(len);
|
||||||
return os.read((void*)rhs.data(), len);
|
return os.read((void*)rhs.data(), len);
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ bool VlcOptions::onoff(const char* sw, const char* arg, bool& flag) {
|
||||||
// if sw=="-noarg", then return true (found it), and flag=false
|
// if sw=="-noarg", then return true (found it), and flag=false
|
||||||
// else return false
|
// else return false
|
||||||
if (arg[0]!='-') v3fatalSrc("OnOff switches must have leading dash.");
|
if (arg[0]!='-') v3fatalSrc("OnOff switches must have leading dash.");
|
||||||
if (0==strcmp(sw,arg)) { flag=true; return true; }
|
if (0==strcmp(sw,arg)) { flag = true; return true; }
|
||||||
else if (0==strncmp(sw,"-no",3) && (0==strcmp(sw+3,arg+1))) { flag=false; return true; }
|
else if (0==strncmp(sw,"-no",3) && (0==strcmp(sw+3,arg+1))) { flag = false; return true; }
|
||||||
else if (0==strncmp(sw,"-no-",4) && (0==strcmp(sw+4,arg+1))) { flag=false; return true; }
|
else if (0==strncmp(sw,"-no-",4) && (0==strcmp(sw+4,arg+1))) { flag = false; return true; }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,4 +201,3 @@ int main(int argc, char** argv, char** env) {
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// compile-command: "v4make bin/verilator_coverage --debugi 9 test_regress/t/t_vlcov_data_*.dat"
|
// compile-command: "v4make bin/verilator_coverage --debugi 9 test_regress/t/t_vlcov_data_*.dat"
|
||||||
// End:
|
// End:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ private:
|
||||||
// MEMBERS
|
// MEMBERS
|
||||||
string m_name; //< Name of the point
|
string m_name; //< Name of the point
|
||||||
vluint64_t m_pointNum; //< Point number
|
vluint64_t m_pointNum; //< Point number
|
||||||
vluint64_t m_testsCovering;//< Number tests with non-zero coverage of this point
|
vluint64_t m_testsCovering; //< Number tests with non-zero coverage of this point
|
||||||
vluint64_t m_count; //< Count of hits across all tests
|
vluint64_t m_count; //< Count of hits across all tests
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -94,15 +94,15 @@ public:
|
||||||
void incCount(int lineno, int column, vluint64_t count, bool ok) {
|
void incCount(int lineno, int column, vluint64_t count, bool ok) {
|
||||||
LinenoMap::iterator lit = m_lines.find(lineno);
|
LinenoMap::iterator lit = m_lines.find(lineno);
|
||||||
if (lit == m_lines.end()) {
|
if (lit == m_lines.end()) {
|
||||||
lit = m_lines.insert(make_pair(lineno,ColumnMap())).first;
|
lit = m_lines.insert(make_pair(lineno, ColumnMap())).first;
|
||||||
}
|
}
|
||||||
ColumnMap& cmap = lit->second;
|
ColumnMap& cmap = lit->second;
|
||||||
ColumnMap::iterator cit = cmap.find(column);
|
ColumnMap::iterator cit = cmap.find(column);
|
||||||
if (cit == cmap.end()) {
|
if (cit == cmap.end()) {
|
||||||
cit = cmap.insert(make_pair(column,VlcSourceCount(lineno, column))).first;
|
cit = cmap.insert(make_pair(column, VlcSourceCount(lineno, column))).first;
|
||||||
}
|
}
|
||||||
VlcSourceCount& sc = cit->second;
|
VlcSourceCount& sc = cit->second;
|
||||||
sc.incCount(count,ok);
|
sc.incCount(count, ok);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ void VlcTop::readCoverage(const string& filename, bool nonfatal) {
|
||||||
string line = V3Os::getline(is);
|
string line = V3Os::getline(is);
|
||||||
//UINFO(9," got "<<line<<endl);
|
//UINFO(9," got "<<line<<endl);
|
||||||
if (line[0] == 'C') {
|
if (line[0] == 'C') {
|
||||||
string::size_type secspace=3;
|
string::size_type secspace = 3;
|
||||||
for (; secspace<line.length(); secspace++) {
|
for (; secspace<line.length(); secspace++) {
|
||||||
if (line[secspace]=='\'' && line[secspace+1]==' ') break;
|
if (line[secspace]=='\'' && line[secspace+1]==' ') break;
|
||||||
}
|
}
|
||||||
string point = line.substr(3,secspace-3);
|
string point = line.substr(3, secspace-3);
|
||||||
vluint64_t hits = atoll(line.c_str()+secspace+1);
|
vluint64_t hits = atoll(line.c_str()+secspace+1);
|
||||||
//UINFO(9," point '"<<point<<"'"<<" "<<hits<<endl);
|
//UINFO(9," point '"<<point<<"'"<<" "<<hits<<endl);
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ struct CmpComputrons {
|
||||||
|
|
||||||
void VlcTop::rank() {
|
void VlcTop::rank() {
|
||||||
UINFO(2,"rank...\n");
|
UINFO(2,"rank...\n");
|
||||||
vluint64_t nextrank=1;
|
vluint64_t nextrank = 1;
|
||||||
|
|
||||||
// Sort by computrons, so fast tests get selected first
|
// Sort by computrons, so fast tests get selected first
|
||||||
std::vector<VlcTest*> bytime;
|
std::vector<VlcTest*> bytime;
|
||||||
|
|
@ -237,7 +237,8 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
|
||||||
first = false;
|
first = false;
|
||||||
// Multiple columns on same line; print line just once
|
// Multiple columns on same line; print line just once
|
||||||
string indent;
|
string indent;
|
||||||
for (string::const_iterator pos=line.begin(); pos!=line.end() && isspace(*pos); ++pos) {
|
for (string::const_iterator pos=line.begin();
|
||||||
|
pos!=line.end() && isspace(*pos); ++pos) {
|
||||||
indent += *pos;
|
indent += *pos;
|
||||||
}
|
}
|
||||||
line = indent + "verilator_coverage: (next point on previous line)\n";
|
line = indent + "verilator_coverage: (next point on previous line)\n";
|
||||||
|
|
@ -258,4 +259,3 @@ void VlcTop::annotate(const string& dirname) {
|
||||||
annotateCalcNeeded();
|
annotateCalcNeeded();
|
||||||
annotateOutputFiles(dirname);
|
annotateOutputFiles(dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1420,16 +1420,16 @@ sub _make_top_v {
|
||||||
# Test
|
# Test
|
||||||
print $fh "\n";
|
print $fh "\n";
|
||||||
print $fh " initial begin\n";
|
print $fh " initial begin\n";
|
||||||
print $fh " fastclk=0;\n" if $self->{inputs}{fastclk};
|
print $fh " fastclk = 0;\n" if $self->{inputs}{fastclk};
|
||||||
print $fh " clk=0;\n" if $self->{inputs}{clk};
|
print $fh " clk = 0;\n" if $self->{inputs}{clk};
|
||||||
print $fh " #10;\n";
|
print $fh " #10;\n";
|
||||||
print $fh " fastclk=1;\n" if $self->{inputs}{fastclk};
|
print $fh " fastclk = 1;\n" if $self->{inputs}{fastclk};
|
||||||
print $fh " clk=1;\n" if $self->{inputs}{clk};
|
print $fh " clk = 1;\n" if $self->{inputs}{clk};
|
||||||
print $fh " while (\$time < $self->{sim_time}) begin\n";
|
print $fh " while (\$time < $self->{sim_time}) begin\n";
|
||||||
for (my $i=0; $i<5; $i++) {
|
for (my $i=0; $i<5; $i++) {
|
||||||
print $fh " #1;\n";
|
print $fh " #1;\n";
|
||||||
print $fh " fastclk=!fastclk;\n" if $self->{inputs}{fastclk};
|
print $fh " fastclk = !fastclk;\n" if $self->{inputs}{fastclk};
|
||||||
print $fh " clk=!clk;\n" if $i==4 && $self->{inputs}{clk};
|
print $fh " clk = !clk;\n" if $i==4 && $self->{inputs}{clk};
|
||||||
}
|
}
|
||||||
print $fh " end\n";
|
print $fh " end\n";
|
||||||
print $fh " end\n";
|
print $fh " end\n";
|
||||||
|
|
@ -1657,7 +1657,7 @@ sub vcd_identical {
|
||||||
# Also provides backup if vcddiff not installed
|
# Also provides backup if vcddiff not installed
|
||||||
my $h1 = $self->_vcd_read($fn1);
|
my $h1 = $self->_vcd_read($fn1);
|
||||||
my $h2 = $self->_vcd_read($fn2);
|
my $h2 = $self->_vcd_read($fn2);
|
||||||
$Data::Dumper::Sortkeys=1;
|
$Data::Dumper::Sortkeys = 1;
|
||||||
my $a = Dumper($h1);
|
my $a = Dumper($h1);
|
||||||
my $b = Dumper($h2);
|
my $b = Dumper($h2);
|
||||||
if ($a ne $b) {
|
if ($a ne $b) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue