Codacy/Cppcheck cleanups and badge.

This commit is contained in:
Wilson Snyder 2019-10-24 22:19:46 -04:00
parent 9f977ed419
commit 0cbfd29ac5
9 changed files with 23 additions and 17 deletions

View File

@ -1,3 +1,4 @@
---
exclude_paths:
- 'ci/build_verilator.sh'
- 'include/vltstd/**'

View File

@ -3,10 +3,14 @@
=pod
=for html <a href="https://www.gnu.org/licenses/lgpl-3.0"><img src="https://img.shields.io/badge/License-LGPL%20v3-blue.svg"></a>
=for html <a href="https://opensource.org/licenses/Artistic-2.0"><img src="https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg"></a>
=for html <a href="https://www.codacy.com/manual/wsnyder/verilator"><img src="https://api.codacy.com/project/badge/Grade/ff998fdaa6f64b9a95eb5f342ee6bf4d"></a>
=for html <a href="https://travis-ci.com/verilator/verilator"><img src="https://travis-ci.com/verilator/verilator.svg?branch=master"></a>
=begin html
<a href="https://www.gnu.org/licenses/lgpl-3.0"><img src="https://img.shields.io/badge/License-LGPL%20v3-blue.svg"></a>
<a href="https://opensource.org/licenses/Artistic-2.0"><img src="https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg"></a>
<a href="https://www.codacy.com/manual/wsnyder/verilator"><img src="https://api.codacy.com/project/badge/Grade/ff998fdaa6f64b9a95eb5f342ee6bf4d"></a>
<a href="https://travis-ci.com/verilator/verilator"><img src="https://travis-ci.com/verilator/verilator.svg?branch=master"></a>
=end html
=head1 NAME

View File

@ -37,8 +37,8 @@ echo "Found Verilator rev ${VERILATOR_REV}"
CACHED_REV_FILE=${VERILATOR_CACHE}/.rev.txt
if [[ ! -f ${CACHED_REV_FILE} || \
$(< ${CACHED_REV_FILE}) != ${VERILATOR_REV} ]]; then
if [[ ! -f "${CACHED_REV_FILE}" || \
$(< "${CACHED_REV_FILE}") != "${VERILATOR_REV}" ]]; then
echo "Building Verilator"
# Unsure why Travis monkies with the capitalization of the stage name, but it does
@ -47,18 +47,18 @@ if [[ ! -f ${CACHED_REV_FILE} || \
echo "WARNING: Building Verilator in Travis build stage other than \"Build verilator\": ${TRAVIS_BUILD_STAGE_NAME}"
fi
cd ${VERILATOR_ROOT}
cd "${VERILATOR_ROOT}"
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS} && make -j ${VERILATOR_NUM_JOBS}
# Copy the Verilator build artifacts
mkdir -p "${VERILATOR_CACHE}"
rm -rf "${VERILATOR_CACHE}/*"
rm -rf ${VERILATOR_CACHE}/*
cp bin/*bin* "${VERILATOR_CACHE}"
# Remember the Git revision
echo ${VERILATOR_REV} > ${CACHED_REV_FILE}
echo "${VERILATOR_REV}" > "${CACHED_REV_FILE}"
else
echo "Using cached Verilator"
cd "${VERILATOR_ROOT}"
# Create include/verilated_config.h and maybe other things
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS}
cp "${VERILATOR_CACHE}/*" bin
cp ${VERILATOR_CACHE}/* bin
fi

View File

@ -377,14 +377,13 @@ private:
m_lifep = condLifep;
iterateAndNextNull(nodep->precondsp());
iterateAndNextNull(nodep->condp());
m_lifep = prevLifep;
}
{
m_lifep = bodyLifep;
iterateAndNextNull(nodep->bodysp());
iterateAndNextNull(nodep->incsp());
m_lifep = prevLifep;
}
m_lifep = prevLifep;
UINFO(4," joinfor"<<endl);
// For the next assignments, clear any variables that were read or written in the block
condLifep->lifeToAbove();

View File

@ -394,7 +394,6 @@ class ProtectVisitor : public AstNVisitor {
}
void handleInput(AstVar* varp) {
FileLine* fl = varp->fileline();
m_modPortsp->addNodep(varp->cloneTree(false));
}
@ -433,7 +432,9 @@ class ProtectVisitor : public AstNVisitor {
explicit ProtectVisitor(AstNode* nodep):
m_vfilep(NULL), m_cfilep(NULL), m_modPortsp(NULL),
m_comboPortsp(NULL), m_seqPortsp(NULL), m_comboIgnorePortsp(NULL), m_comboDeclsp(NULL),
m_seqDeclsp(NULL), m_tmpDeclsp(NULL), m_hashValuep(NULL), m_clkSensp(NULL),
m_seqDeclsp(NULL), m_tmpDeclsp(NULL), m_hashValuep(NULL),
m_comboParamsp(NULL),
m_clkSensp(NULL),
m_comboIgnoreParamsp(NULL), m_seqParamsp(NULL), m_nbAssignsp(NULL), m_seqAssignsp(NULL),
m_comboAssignsp(NULL), m_cHashValuep(NULL), m_cComboParamsp(NULL), m_cComboInsp(NULL),
m_cComboOutsp(NULL), m_cSeqParamsp(NULL), m_cSeqClksp(NULL), m_cSeqOutsp(NULL),

View File

@ -23,7 +23,7 @@ void clockit(int clk1, int clk0) {
topp->c0 = clk0;
#endif
#ifdef TEST_VERBOSE
printf("[%d] c1=%u c0=%u\n", main_time, clk1, clk0);
printf("[%u] c1=%d c0=%d\n", main_time, clk1, clk0);
#endif
topp->eval();
main_time++;

View File

@ -99,7 +99,7 @@ int dpic_save(int value) {
int i;
} vp;
vp.i = value;
vp.i = value; if (vp.i) { }
if (svPutUserData(scope, &Dpic_Unique, vp.ptr)) {
printf("%%Warning: svPutUserData failed\n");
return 0;

View File

@ -76,6 +76,7 @@ extern "C" {
printf("%%Error: %s:%d:", __FILE__,__LINE__); \
union { type a; long long l; } u; \
u.l = 0; u.a = got; \
if (u.a) { } /*not unused*/ \
printf(" GOT = %" T_PRI64 "x", u.l); \
u.l = 0; u.a = exp; \
printf(" EXP = %" T_PRI64 "x\n", u.l); \

View File

@ -8,7 +8,7 @@ unsigned int Array[3];
unsigned int StepSim(Vt_mem_slot *sim, unsigned int slot, unsigned int bit, unsigned int val, unsigned int rslot) {
#ifdef TEST_VERBOSE
printf("StepSim: slot=%d bit=%d val=%d rslot=%d\n", slot, bit, val, rslot);
printf("StepSim: slot=%u bit=%u val=%u rslot=%u\n", slot, bit, val, rslot);
#endif
sim->SlotIdx = slot;