mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Codacy/Cppcheck cleanups and badge.
This commit is contained in:
parent
9f977ed419
commit
0cbfd29ac5
@ -1,3 +1,4 @@
|
|||||||
---
|
---
|
||||||
exclude_paths:
|
exclude_paths:
|
||||||
|
- 'ci/build_verilator.sh'
|
||||||
- 'include/vltstd/**'
|
- 'include/vltstd/**'
|
||||||
|
12
README.pod
12
README.pod
@ -3,10 +3,14 @@
|
|||||||
|
|
||||||
=pod
|
=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>
|
=begin html
|
||||||
=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>
|
<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://travis-ci.com/verilator/verilator"><img src="https://travis-ci.com/verilator/verilator.svg?branch=master"></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
|
=head1 NAME
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ echo "Found Verilator rev ${VERILATOR_REV}"
|
|||||||
|
|
||||||
CACHED_REV_FILE=${VERILATOR_CACHE}/.rev.txt
|
CACHED_REV_FILE=${VERILATOR_CACHE}/.rev.txt
|
||||||
|
|
||||||
if [[ ! -f ${CACHED_REV_FILE} || \
|
if [[ ! -f "${CACHED_REV_FILE}" || \
|
||||||
$(< ${CACHED_REV_FILE}) != ${VERILATOR_REV} ]]; then
|
$(< "${CACHED_REV_FILE}") != "${VERILATOR_REV}" ]]; then
|
||||||
echo "Building Verilator"
|
echo "Building Verilator"
|
||||||
|
|
||||||
# Unsure why Travis monkies with the capitalization of the stage name, but it does
|
# 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}"
|
echo "WARNING: Building Verilator in Travis build stage other than \"Build verilator\": ${TRAVIS_BUILD_STAGE_NAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ${VERILATOR_ROOT}
|
cd "${VERILATOR_ROOT}"
|
||||||
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS} && make -j ${VERILATOR_NUM_JOBS}
|
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS} && make -j ${VERILATOR_NUM_JOBS}
|
||||||
# Copy the Verilator build artifacts
|
# Copy the Verilator build artifacts
|
||||||
mkdir -p "${VERILATOR_CACHE}"
|
mkdir -p "${VERILATOR_CACHE}"
|
||||||
rm -rf "${VERILATOR_CACHE}/*"
|
rm -rf ${VERILATOR_CACHE}/*
|
||||||
cp bin/*bin* "${VERILATOR_CACHE}"
|
cp bin/*bin* "${VERILATOR_CACHE}"
|
||||||
# Remember the Git revision
|
# Remember the Git revision
|
||||||
echo ${VERILATOR_REV} > ${CACHED_REV_FILE}
|
echo "${VERILATOR_REV}" > "${CACHED_REV_FILE}"
|
||||||
else
|
else
|
||||||
echo "Using cached Verilator"
|
echo "Using cached Verilator"
|
||||||
cd "${VERILATOR_ROOT}"
|
cd "${VERILATOR_ROOT}"
|
||||||
# Create include/verilated_config.h and maybe other things
|
# Create include/verilated_config.h and maybe other things
|
||||||
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS}
|
autoconf && ./configure ${VERILATOR_CONFIG_FLAGS}
|
||||||
cp "${VERILATOR_CACHE}/*" bin
|
cp ${VERILATOR_CACHE}/* bin
|
||||||
fi
|
fi
|
||||||
|
@ -377,14 +377,13 @@ private:
|
|||||||
m_lifep = condLifep;
|
m_lifep = condLifep;
|
||||||
iterateAndNextNull(nodep->precondsp());
|
iterateAndNextNull(nodep->precondsp());
|
||||||
iterateAndNextNull(nodep->condp());
|
iterateAndNextNull(nodep->condp());
|
||||||
m_lifep = prevLifep;
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
m_lifep = bodyLifep;
|
m_lifep = bodyLifep;
|
||||||
iterateAndNextNull(nodep->bodysp());
|
iterateAndNextNull(nodep->bodysp());
|
||||||
iterateAndNextNull(nodep->incsp());
|
iterateAndNextNull(nodep->incsp());
|
||||||
m_lifep = prevLifep;
|
|
||||||
}
|
}
|
||||||
|
m_lifep = prevLifep;
|
||||||
UINFO(4," joinfor"<<endl);
|
UINFO(4," joinfor"<<endl);
|
||||||
// For the next assignments, clear any variables that were read or written in the block
|
// For the next assignments, clear any variables that were read or written in the block
|
||||||
condLifep->lifeToAbove();
|
condLifep->lifeToAbove();
|
||||||
|
@ -394,7 +394,6 @@ class ProtectVisitor : public AstNVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void handleInput(AstVar* varp) {
|
void handleInput(AstVar* varp) {
|
||||||
FileLine* fl = varp->fileline();
|
|
||||||
m_modPortsp->addNodep(varp->cloneTree(false));
|
m_modPortsp->addNodep(varp->cloneTree(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +432,9 @@ class ProtectVisitor : public AstNVisitor {
|
|||||||
explicit ProtectVisitor(AstNode* nodep):
|
explicit ProtectVisitor(AstNode* nodep):
|
||||||
m_vfilep(NULL), m_cfilep(NULL), m_modPortsp(NULL),
|
m_vfilep(NULL), m_cfilep(NULL), m_modPortsp(NULL),
|
||||||
m_comboPortsp(NULL), m_seqPortsp(NULL), m_comboIgnorePortsp(NULL), m_comboDeclsp(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_comboIgnoreParamsp(NULL), m_seqParamsp(NULL), m_nbAssignsp(NULL), m_seqAssignsp(NULL),
|
||||||
m_comboAssignsp(NULL), m_cHashValuep(NULL), m_cComboParamsp(NULL), m_cComboInsp(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),
|
m_cComboOutsp(NULL), m_cSeqParamsp(NULL), m_cSeqClksp(NULL), m_cSeqOutsp(NULL),
|
||||||
|
@ -23,7 +23,7 @@ void clockit(int clk1, int clk0) {
|
|||||||
topp->c0 = clk0;
|
topp->c0 = clk0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef TEST_VERBOSE
|
#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
|
#endif
|
||||||
topp->eval();
|
topp->eval();
|
||||||
main_time++;
|
main_time++;
|
||||||
|
@ -99,7 +99,7 @@ int dpic_save(int value) {
|
|||||||
int i;
|
int i;
|
||||||
} vp;
|
} vp;
|
||||||
|
|
||||||
vp.i = value;
|
vp.i = value; if (vp.i) { }
|
||||||
if (svPutUserData(scope, &Dpic_Unique, vp.ptr)) {
|
if (svPutUserData(scope, &Dpic_Unique, vp.ptr)) {
|
||||||
printf("%%Warning: svPutUserData failed\n");
|
printf("%%Warning: svPutUserData failed\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -76,6 +76,7 @@ extern "C" {
|
|||||||
printf("%%Error: %s:%d:", __FILE__,__LINE__); \
|
printf("%%Error: %s:%d:", __FILE__,__LINE__); \
|
||||||
union { type a; long long l; } u; \
|
union { type a; long long l; } u; \
|
||||||
u.l = 0; u.a = got; \
|
u.l = 0; u.a = got; \
|
||||||
|
if (u.a) { } /*not unused*/ \
|
||||||
printf(" GOT = %" T_PRI64 "x", u.l); \
|
printf(" GOT = %" T_PRI64 "x", u.l); \
|
||||||
u.l = 0; u.a = exp; \
|
u.l = 0; u.a = exp; \
|
||||||
printf(" EXP = %" T_PRI64 "x\n", u.l); \
|
printf(" EXP = %" T_PRI64 "x\n", u.l); \
|
||||||
|
@ -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) {
|
unsigned int StepSim(Vt_mem_slot *sim, unsigned int slot, unsigned int bit, unsigned int val, unsigned int rslot) {
|
||||||
#ifdef TEST_VERBOSE
|
#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
|
#endif
|
||||||
|
|
||||||
sim->SlotIdx = slot;
|
sim->SlotIdx = slot;
|
||||||
|
Loading…
Reference in New Issue
Block a user