Internals: Upgrade to clang-format-18 (#6333)
This commit is contained in:
parent
703f0d8c5d
commit
ac2859bf24
|
|
@ -11,11 +11,11 @@ permissions:
|
|||
contents: write
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Ubuntu 22.04 | format
|
||||
runs-on: ubuntu-24.04
|
||||
name: Ubuntu 24.04 | format
|
||||
env:
|
||||
CI_OS_NAME: linux
|
||||
CI_RUNS_ON: ubuntu-22.04
|
||||
CI_RUNS_ON: ubuntu-24.04
|
||||
CI_COMMIT: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
|
@ -27,7 +27,7 @@ jobs:
|
|||
CI_BUILD_STAGE_NAME: build
|
||||
run: |
|
||||
bash ci/ci-install.bash &&
|
||||
sudo apt-get install clang-format-14 yapf3 &&
|
||||
sudo apt-get install clang-format-18 yapf3 &&
|
||||
sudo pip3 install gersemi mbake &&
|
||||
git config --global user.email "action@example.com" &&
|
||||
git config --global user.name "github action"
|
||||
|
|
@ -35,7 +35,7 @@ jobs:
|
|||
run: |
|
||||
autoconf &&
|
||||
./configure &&
|
||||
make -j 2 format CLANGFORMAT=clang-format-14 &&
|
||||
make -j 2 format CLANGFORMAT=clang-format-18 &&
|
||||
git status
|
||||
- name: Push
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -462,14 +462,14 @@ analyzer-include:
|
|||
format:
|
||||
$(MAKE) -j 5 format-c format-cmake format-exec format-py
|
||||
|
||||
CLANGFORMAT = clang-format-14
|
||||
CLANGFORMAT = clang-format-18
|
||||
CLANGFORMAT_FLAGS = -i
|
||||
CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h
|
||||
|
||||
format-c clang-format:
|
||||
$(CLANGFORMAT) --version
|
||||
@$(CLANGFORMAT) --version | egrep 14.0 > /dev/null \
|
||||
|| echo "*** You are not using clang-format-14, indents may differ from master's ***"
|
||||
@$(CLANGFORMAT) --version | fgrep 'version 18' > /dev/null \
|
||||
|| echo "*** You are not using clang-format-18, indents may differ from master's ***"
|
||||
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES)
|
||||
|
||||
YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=130 YAMLFIX_preserve_quotes=true yamlfix
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ AC_PROG_INSTALL
|
|||
|
||||
AC_LANG_PUSH(C++)
|
||||
CFG_CXX_VERSION=`$CXX --version | head -1`
|
||||
AC_MSG_RESULT([compiler $CXX --version = $CFG_CXX_VERSION])
|
||||
AC_MSG_RESULT([compiler version... $CXX --version = $CFG_CXX_VERSION])
|
||||
AC_SUBST(CFG_CXX_VERSION)
|
||||
|
||||
AC_MSG_CHECKING([that C++ compiler can compile simple program])
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ Those developing Verilator itself also need these (see internals.rst):
|
|||
|
||||
.. code-block:: shell
|
||||
|
||||
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
|
||||
sudo apt-get install clang clang-format-18 cmake gdb gprof graphviz lcov
|
||||
sudo apt-get install python3-clang python3-distro yapf3 bear jq
|
||||
sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe gersemi mbake ruff sarif-tools
|
||||
sudo pip3 install git+https://github.com/antmicro/astsee.git
|
||||
|
|
|
|||
|
|
@ -1131,7 +1131,7 @@ Indentation and Naming Style
|
|||
----------------------------
|
||||
|
||||
We will work with contributors to fix up indentation style issues, but it
|
||||
is appreciated if you could match our style:
|
||||
is appreciated if you could match our style for C/C++:
|
||||
|
||||
- Use "mixedCapsSymbols" instead of "underlined_symbols".
|
||||
|
||||
|
|
@ -1143,9 +1143,8 @@ is appreciated if you could match our style:
|
|||
calls. (This convention has not been applied retroactively.)
|
||||
|
||||
C and Python indentation is automatically maintained with "make format"
|
||||
using clang-format version 14.0.0, and yapf for Python, and is
|
||||
automatically corrected in the CI actions. For those manually formatting C
|
||||
code:
|
||||
using clang-format version 18, and yapf for Python, and is automatically
|
||||
corrected in the CI actions. For those manually formatting C code:
|
||||
|
||||
- Use four spaces per level, and no tabs.
|
||||
|
||||
|
|
@ -1157,12 +1156,20 @@ code:
|
|||
- No spaces before semicolons, nor between a function's name and open
|
||||
parenthesis (only applies to functions; if/else has a following space).
|
||||
|
||||
Verilog indentation is not yet automatically maintained, but:
|
||||
|
||||
- Use two spaces per level, and no tabs.
|
||||
|
||||
- Place `begin` on the same line as the earlier starting statement
|
||||
e.g. `if`, and place the `end` on a separate line indented the same as
|
||||
the starting statement.
|
||||
|
||||
|
||||
Commit messages
|
||||
---------------
|
||||
|
||||
Pull requests do not typically edit ``Changes`` in order to reduce
|
||||
potential merge conflicts. Instead, contibutors should use an appropriate
|
||||
potential merge conflicts. Instead, contributors should use an appropriate
|
||||
first line of the git commit message. Maintainers periodically run
|
||||
``nodist/log_changes`` which analyzes the commit messages to suggest edits
|
||||
to the ``Changes`` file.
|
||||
|
|
@ -1199,7 +1206,7 @@ The line's grammar should match the phrasing used in the Changes file.
|
|||
If the change does not affect user-visible function, also add "No
|
||||
functional change." if it's 99% certain not to change behavior, or "No
|
||||
functional change expected." if no change was expected but there may be
|
||||
uncertanty.
|
||||
uncertainty.
|
||||
|
||||
|
||||
The ``astgen`` Script
|
||||
|
|
@ -1208,7 +1215,7 @@ The ``astgen`` Script
|
|||
The ``astgen`` script is used to generate some of the repetitive C++ code
|
||||
related to the ``AstNode`` type hierarchy. An example is the abstract ``visit``
|
||||
methods in ``VNVisitor``. There are other uses; please see the ``*__gen*``
|
||||
files in the bulid directories and the ``astgen`` script for details. A
|
||||
files in the build directories and the ``astgen`` script for details. A
|
||||
description of the more advanced features of ``astgen`` are provided here.
|
||||
|
||||
|
||||
|
|
@ -1617,7 +1624,7 @@ Benchmarking
|
|||
------------
|
||||
|
||||
For benchmarking the effects of changes (simulation speed, memory consumption,
|
||||
verilation time, etc.), you can use `RTLMeter
|
||||
Verilation time, etc.), you can use `RTLMeter
|
||||
<https://github.com/verilator/rtlmeter>`__, a benchmark suite designed for this
|
||||
purpose. The scripts provided with RTLMeter have many capabilities. For full
|
||||
details, see the `documentation of RTLMeter
|
||||
|
|
@ -2039,10 +2046,8 @@ Generally, what would you do to add a new feature?
|
|||
|
||||
2. Make a testcase in the test_regress/t/t_EXAMPLE format, see `Testing`.
|
||||
|
||||
3. If grammar changes are needed, look at the git version of VerilogPerl's
|
||||
src/VParseGrammar.y, as this grammar supports the full SystemVerilog
|
||||
language and has a lot of back-and-forth with Verilator's grammar. Copy
|
||||
the appropriate rules to src/verilog.y and modify the productions.
|
||||
3. If grammar changes are needed, look at the IEEE 1800-2023 Appendix A, as
|
||||
src/verilog.y generally follows the same rule layout.
|
||||
|
||||
4. If a new Ast type is needed, add it to the appropriate V3AstNode*.h.
|
||||
Follow the convention described above about the AstNode type hierarchy.
|
||||
|
|
|
|||
|
|
@ -279,11 +279,11 @@ static inline IData VL_RTOI_I_D(double lhs) VL_PURE { return static_cast<int32_t
|
|||
|
||||
// Sign extend such that if MSB set, we get ffff_ffff, else 0s
|
||||
// (Requires clean input)
|
||||
#define VL_SIGN_I(nbits, lhs) ((lhs) >> VL_BITBIT_I((nbits)-VL_UL(1)))
|
||||
#define VL_SIGN_Q(nbits, lhs) ((lhs) >> VL_BITBIT_Q((nbits)-1ULL))
|
||||
#define VL_SIGN_E(nbits, lhs) ((lhs) >> VL_BITBIT_E((nbits)-VL_EUL(1)))
|
||||
#define VL_SIGN_I(nbits, lhs) ((lhs) >> VL_BITBIT_I((nbits) - VL_UL(1)))
|
||||
#define VL_SIGN_Q(nbits, lhs) ((lhs) >> VL_BITBIT_Q((nbits) - 1ULL))
|
||||
#define VL_SIGN_E(nbits, lhs) ((lhs) >> VL_BITBIT_E((nbits) - VL_EUL(1)))
|
||||
#define VL_SIGN_W(nbits, rwp) \
|
||||
((rwp)[VL_BITWORD_E((nbits)-VL_EUL(1))] >> VL_BITBIT_E((nbits)-VL_EUL(1)))
|
||||
((rwp)[VL_BITWORD_E((nbits) - VL_EUL(1))] >> VL_BITBIT_E((nbits) - VL_EUL(1)))
|
||||
#define VL_SIGNONES_E(nbits, lhs) (-(VL_SIGN_E(nbits, lhs)))
|
||||
|
||||
// Sign bit extended up to MSB, doesn't include unsigned portion
|
||||
|
|
@ -558,8 +558,8 @@ static inline void VL_ASSIGNBIT_WO(int bit, WDataOutP owp) VL_MT_SAFE {
|
|||
lsb += BITS_PER_DIGIT; \
|
||||
} \
|
||||
if (lsb < (obits)) { \
|
||||
const uint32_t msb_data = VL_SEL_IWII((obits) + 1, (rwp).data(), lsb, (obits)-lsb); \
|
||||
*chunkp = msb_data & VL_MASK_E((obits)-lsb); \
|
||||
const uint32_t msb_data = VL_SEL_IWII((obits) + 1, (rwp).data(), lsb, (obits) - lsb); \
|
||||
*chunkp = msb_data & VL_MASK_E((obits) - lsb); \
|
||||
} \
|
||||
_butemp.set(0, *(rwp).data() & 1); /* force update the sign */ \
|
||||
(svar).write(_butemp); \
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class VerilatedScTraceBase VL_NOT_FINAL : private sc_core::sc_object,
|
|||
private sc_core::sc_trace_file {
|
||||
bool m_enableDeltaCycles = false;
|
||||
bool m_traceFileAdded = false;
|
||||
static void stubReportHandler(const sc_core::sc_report&, const sc_core::sc_actions&){};
|
||||
static void stubReportHandler(const sc_core::sc_report&, const sc_core::sc_actions&) {};
|
||||
|
||||
public:
|
||||
void enableDeltaCycles(bool flag = true) {
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ protected:
|
|||
void commitTraceBuffer(Buffer*) override;
|
||||
|
||||
// Configure sub-class
|
||||
void configure(const VerilatedTraceConfig&) override{};
|
||||
void configure(const VerilatedTraceConfig&) override {};
|
||||
|
||||
public:
|
||||
//=========================================================================
|
||||
|
|
|
|||
|
|
@ -1394,8 +1394,8 @@ void AstNode::dumpTreeFile(const string& filename, bool doDump) {
|
|||
static void drawChildren(std::ostream& os, const AstNode* thisp, const AstNode* childp,
|
||||
const std::string& childName) {
|
||||
if (childp) {
|
||||
os << "\tn" << cvtToHex(thisp) << " -> n" << cvtToHex(childp) << " ["
|
||||
<< "label=\"" << childName << "\" color=red];\n";
|
||||
os << "\tn" << cvtToHex(thisp) << " -> n" << cvtToHex(childp) << " [" << "label=\""
|
||||
<< childName << "\" color=red];\n";
|
||||
for (const AstNode* nodep = childp; nodep; nodep = nodep->nextp()) {
|
||||
nodep->dumpTreeDot(os);
|
||||
if (nodep->nextp()) {
|
||||
|
|
@ -1409,8 +1409,7 @@ static void drawChildren(std::ostream& os, const AstNode* thisp, const AstNode*
|
|||
}
|
||||
|
||||
void AstNode::dumpTreeDot(std::ostream& os) const {
|
||||
os << "\tn" << cvtToHex(this) << "\t["
|
||||
<< "label=\"" << typeName() << "\\n"
|
||||
os << "\tn" << cvtToHex(this) << "\t[" << "label=\"" << typeName() << "\\n"
|
||||
<< name() << "\"];\n";
|
||||
drawChildren(os, this, m_op1p, "op1");
|
||||
drawChildren(os, this, m_op2p, "op2");
|
||||
|
|
@ -1447,8 +1446,7 @@ void AstNode::dumpTreeDotFile(const string& filename, bool doDump) {
|
|||
const std::unique_ptr<std::ofstream> treedotp{V3File::new_ofstream(filename)};
|
||||
if (treedotp->fail()) v3fatal("Can't write file: " << filename);
|
||||
*treedotp << "digraph vTree{\n";
|
||||
*treedotp << "\tgraph\t[label=\"" << filename + ".dot"
|
||||
<< "\",\n";
|
||||
*treedotp << "\tgraph\t[label=\"" << filename + ".dot" << "\",\n";
|
||||
*treedotp << "\t\t labelloc=t, labeljust=l,\n";
|
||||
*treedotp << "\t\t //size=\"7.5,10\",\n"
|
||||
<< "];\n";
|
||||
|
|
|
|||
|
|
@ -2135,7 +2135,7 @@ protected:
|
|||
AstNode(VNType t, FileLine* fl);
|
||||
virtual AstNode* clone() = 0; // Generally, cloneTree is what you want instead
|
||||
virtual void cloneRelink() { cloneRelinkGen(); }
|
||||
virtual void cloneRelinkGen(){}; // Overrides generated by 'astgen'
|
||||
virtual void cloneRelinkGen() {}; // Overrides generated by 'astgen'
|
||||
void cloneRelinkTree();
|
||||
|
||||
// METHODS
|
||||
|
|
@ -2174,7 +2174,8 @@ protected:
|
|||
virtual bool sameNode(const AstNode*) const { return true; }
|
||||
// Generated by 'astgen'. If do an oldp->replaceNode(newp), would cause a broken()
|
||||
virtual bool wouldBreakGen(const AstNode* const oldp,
|
||||
const AstNode* const newp) const = 0; // Generated by 'astgen'
|
||||
const AstNode* const newp) const
|
||||
= 0; // Generated by 'astgen'
|
||||
|
||||
public:
|
||||
// ACCESSORS
|
||||
|
|
|
|||
|
|
@ -479,8 +479,7 @@ class V3ControlScopeTraceResolver final {
|
|||
|
||||
public:
|
||||
void addScopeTraceOn(bool on, const string& scope, int levels) {
|
||||
UINFO(9, "addScopeTraceOn " << on << " '" << scope << "' "
|
||||
<< " levels=" << levels);
|
||||
UINFO(9, "addScopeTraceOn " << on << " '" << scope << "' " << " levels=" << levels);
|
||||
m_entries.emplace_back(V3ControlScopeTraceEntry{scope, on, levels});
|
||||
m_matchCache.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,18 +387,18 @@ class DelayedVisitor final : public VNVisitor {
|
|||
if (bIt != blkRefs.end() && nIt != nbaRefs.end()) {
|
||||
const Ref& blkRef = *bIt;
|
||||
const Ref& nbaRef = *nIt;
|
||||
vscp->v3warn(BLKANDNBLK,
|
||||
"Unsupported: Blocking and non-blocking assignments to "
|
||||
"potentially overlapping bits of same packed variable: "
|
||||
<< vscp->varp()->prettyNameQ() << '\n'
|
||||
<< vscp->warnContextPrimary() << '\n'
|
||||
<< blkRef.m_refp->warnOther() << "... Location of blocking assignment"
|
||||
<< " (bits [" << blkRef.m_msb << ":" << blkRef.m_lsb << "])\n"
|
||||
<< blkRef.m_refp->warnContextSecondary() << '\n'
|
||||
<< nbaRef.m_refp->warnOther()
|
||||
<< "... Location of nonblocking assignment"
|
||||
<< " (bits [" << nbaRef.m_msb << ":" << nbaRef.m_lsb << "])\n"
|
||||
<< nbaRef.m_refp->warnContextSecondary());
|
||||
vscp->v3warn(BLKANDNBLK, "Unsupported: Blocking and non-blocking assignments to "
|
||||
"potentially overlapping bits of same packed variable: "
|
||||
<< vscp->varp()->prettyNameQ() << '\n'
|
||||
<< vscp->warnContextPrimary() << '\n'
|
||||
<< blkRef.m_refp->warnOther()
|
||||
<< "... Location of blocking assignment" << " (bits ["
|
||||
<< blkRef.m_msb << ":" << blkRef.m_lsb << "])\n"
|
||||
<< blkRef.m_refp->warnContextSecondary() << '\n'
|
||||
<< nbaRef.m_refp->warnOther()
|
||||
<< "... Location of nonblocking assignment" << " (bits ["
|
||||
<< nbaRef.m_msb << ":" << nbaRef.m_lsb << "])\n"
|
||||
<< nbaRef.m_refp->warnContextSecondary());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -384,9 +384,8 @@ class HierCellsXmlVisitor final : public VNVisitorConst {
|
|||
&& nodep->level() <= 2) { // ==2 because we don't add wrapper when in XML mode
|
||||
m_os << "<cells>\n";
|
||||
m_os << "<cell " << nodep->fileline()->xmlDetailedLocation() //
|
||||
<< " name=\"" << nodep->prettyName() << "\""
|
||||
<< " submodname=\"" << nodep->prettyName() << "\""
|
||||
<< " hier=\"" << nodep->prettyName() << "\"";
|
||||
<< " name=\"" << nodep->prettyName() << "\"" << " submodname=\""
|
||||
<< nodep->prettyName() << "\"" << " hier=\"" << nodep->prettyName() << "\"";
|
||||
m_hier = nodep->prettyName() + ".";
|
||||
m_hasChildren = false;
|
||||
iterateChildrenConst(nodep);
|
||||
|
|
@ -402,9 +401,8 @@ class HierCellsXmlVisitor final : public VNVisitorConst {
|
|||
if (nodep->modp() && nodep->modp()->dead()) return;
|
||||
if (!m_hasChildren) m_os << ">\n";
|
||||
m_os << "<cell " << nodep->fileline()->xmlDetailedLocation() << " name=\"" << nodep->name()
|
||||
<< "\""
|
||||
<< " submodname=\"" << nodep->modName() << "\""
|
||||
<< " hier=\"" << m_hier + nodep->name() << "\"";
|
||||
<< "\"" << " submodname=\"" << nodep->modName() << "\"" << " hier=\""
|
||||
<< m_hier + nodep->name() << "\"";
|
||||
const std::string hier = m_hier;
|
||||
m_hier += nodep->name() + ".";
|
||||
m_hasChildren = false;
|
||||
|
|
|
|||
|
|
@ -432,8 +432,8 @@ void FileLine::v3errorEnd(std::ostringstream& sstr, const string& extra)
|
|||
wsstr << '\n';
|
||||
std::ostringstream extrass; // extra spaced out for prefix
|
||||
if (!extra.empty()) {
|
||||
extrass << V3Error::warnContextBegin() << std::setw(ascii().length()) << " "
|
||||
<< ": " << V3Error::warnContextEnd() << extra;
|
||||
extrass << V3Error::warnContextBegin() << std::setw(ascii().length()) << " " << ": "
|
||||
<< V3Error::warnContextEnd() << extra;
|
||||
}
|
||||
if (warnIsOff(V3Error::s().errorCode())) {
|
||||
V3Error::s().suppressThisWarning();
|
||||
|
|
|
|||
|
|
@ -330,8 +330,8 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
|
|||
}
|
||||
}
|
||||
if (subgr != "") *logp << "\t";
|
||||
*logp << "\tn" << vertexp->dotName() << (n++) << "\t[fontsize=8 "
|
||||
<< "label=\"" << (vertexp->name() != "" ? vertexp->name() : "\\N");
|
||||
*logp << "\tn" << vertexp->dotName() << (n++) << "\t[fontsize=8 " << "label=\""
|
||||
<< (vertexp->name() != "" ? vertexp->name() : "\\N");
|
||||
if (vertexp->rank()) *logp << " r" << vertexp->rank();
|
||||
if (vertexp->fanout() != 0.0) *logp << " f" << vertexp->fanout();
|
||||
if (vertexp->color()) *logp << "\\n c" << vertexp->color();
|
||||
|
|
@ -354,8 +354,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
|
|||
<< " ["
|
||||
// <<"fontsize=8 label=\""<<(edge.name()!="" ? edge.name() : "\\E")<<"\""
|
||||
<< "fontsize=8 label=\"" << (edge.dotLabel() != "" ? edge.dotLabel() : "")
|
||||
<< "\""
|
||||
<< " weight=" << edge.weight() << " color=" << edge.dotColor();
|
||||
<< "\"" << " weight=" << edge.weight() << " color=" << edge.dotColor();
|
||||
if (edge.dotStyle() != "") *logp << " style=" << edge.dotStyle();
|
||||
// if (edge.cutable()) *logp << ",constraint=false"; // to rank without
|
||||
// following edges
|
||||
|
|
|
|||
|
|
@ -3697,9 +3697,9 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
|||
if (foundp) {
|
||||
nodep->v3error("Found definition of '"
|
||||
<< m_ds.m_dotText << (m_ds.m_dotText == "" ? "" : ".")
|
||||
<< nodep->prettyName() << "'"
|
||||
<< " as a " << foundp->nodep()->typeName()
|
||||
<< " but expected a " << expectWhat);
|
||||
<< nodep->prettyName() << "'" << " as a "
|
||||
<< foundp->nodep()->typeName() << " but expected a "
|
||||
<< expectWhat);
|
||||
} else if (m_ds.m_dotText == "") {
|
||||
UINFO(1, " ErrParseRef curSymp=se" << cvtToHex(m_curSymp)
|
||||
<< " ds=" << m_ds.ascii());
|
||||
|
|
@ -3710,15 +3710,16 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
|||
<< expectWhat << ": " << nodep->prettyNameQ() << '\n'
|
||||
<< (suggest.empty() ? "" : nodep->warnMore() + suggest));
|
||||
} else {
|
||||
nodep->v3error("Can't find definition of "
|
||||
<< (!baddot.empty() ? AstNode::prettyNameQ(baddot)
|
||||
: nodep->prettyNameQ())
|
||||
<< " in dotted " << expectWhat << ": '"
|
||||
<< m_ds.m_dotText + "." + nodep->prettyName() << "'\n"
|
||||
<< nodep->warnContextPrimary()
|
||||
<< (okSymp ? okSymp->cellErrorScopes(
|
||||
nodep, AstNode::prettyName(m_ds.m_dotText))
|
||||
: ""));
|
||||
nodep->v3error(
|
||||
"Can't find definition of "
|
||||
<< (!baddot.empty() ? AstNode::prettyNameQ(baddot)
|
||||
: nodep->prettyNameQ())
|
||||
<< " in dotted " << expectWhat << ": '"
|
||||
<< m_ds.m_dotText + "." + nodep->prettyName() << "'\n"
|
||||
<< nodep->warnContextPrimary()
|
||||
<< (okSymp ? okSymp->cellErrorScopes(
|
||||
nodep, AstNode::prettyName(m_ds.m_dotText))
|
||||
: ""));
|
||||
}
|
||||
m_ds.m_dotErr = true;
|
||||
}
|
||||
|
|
@ -4233,8 +4234,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
|
|||
} else {
|
||||
nodep->v3error("Found definition of '"
|
||||
<< m_ds.m_dotText << (m_ds.m_dotText == "" ? "" : ".")
|
||||
<< nodep->prettyName() << "'"
|
||||
<< " as a " << foundp->nodep()->typeName()
|
||||
<< nodep->prettyName() << "'" << " as a "
|
||||
<< foundp->nodep()->typeName()
|
||||
<< " but expected a task/function");
|
||||
}
|
||||
} else if (VN_IS(nodep, New) && m_statep->forPrearray()) {
|
||||
|
|
|
|||
|
|
@ -1399,9 +1399,8 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
|
|||
m_hierBlocks.emplace(opt.mangledName(), opt);
|
||||
});
|
||||
DECL_OPTION("-hierarchical-child", Set, &m_hierChild);
|
||||
DECL_OPTION("-hierarchical-params-file", CbVal, [this](const char* optp) {
|
||||
m_hierParamsFile.push_back({optp, work()});
|
||||
});
|
||||
DECL_OPTION("-hierarchical-params-file", CbVal,
|
||||
[this](const char* optp) { m_hierParamsFile.push_back({optp, work()}); });
|
||||
|
||||
DECL_OPTION("-I", CbPartialMatch,
|
||||
[this, &optdir](const char* optp) { addIncDirUser(parseFileArg(optdir, optp)); });
|
||||
|
|
|
|||
|
|
@ -740,8 +740,8 @@ void V3PreLex::dumpStack() { // LCOV_EXCL_START
|
|||
std::stack<VPreStream*> tmpstack = LEXP->m_streampStack;
|
||||
while (!tmpstack.empty()) {
|
||||
const VPreStream* const streamp = tmpstack.top();
|
||||
cout << "- bufferStack[" << cvtToHex(streamp) << "]: "
|
||||
<< " at=" << streamp->m_curFilelinep << " nBuf=" << streamp->m_buffers.size()
|
||||
cout << "- bufferStack[" << cvtToHex(streamp)
|
||||
<< "]: " << " at=" << streamp->m_curFilelinep << " nBuf=" << streamp->m_buffers.size()
|
||||
<< " size0=" << (streamp->m_buffers.empty() ? 0 : streamp->m_buffers.front().length())
|
||||
<< (streamp->m_eof ? " [EOF]" : "") << (streamp->m_file ? " [FILE]" : "") << endl;
|
||||
tmpstack.pop();
|
||||
|
|
|
|||
|
|
@ -149,9 +149,8 @@ private:
|
|||
AstNodeExpr* const senp = senItemp->sensp();
|
||||
|
||||
const auto currp = [this, senp]() { return getCurr(senp); };
|
||||
const auto prevp = [this, flp, senp]() {
|
||||
return new AstVarRef{flp, getPrev(senp), VAccess::READ};
|
||||
};
|
||||
const auto prevp
|
||||
= [this, flp, senp]() { return new AstVarRef{flp, getPrev(senp), VAccess::READ}; };
|
||||
const auto lsb = [=](AstNodeExpr* opp) { return new AstSel{flp, opp, 0, 1}; };
|
||||
|
||||
// All event signals should be 1-bit at this point
|
||||
|
|
|
|||
|
|
@ -234,8 +234,7 @@ private:
|
|||
<< chkvis.instrCount() << " Data=" << chkvis.dataCount()
|
||||
<< " in width (bits)=" << m_inWidthBits << " out width (bytes)="
|
||||
<< m_outWidthBytes << " Spacetime=" << (space / time) << "("
|
||||
<< space << "/" << time << ")"
|
||||
<< ": " << nodep);
|
||||
<< space << "/" << time << ")" << ": " << nodep);
|
||||
if (chkvis.optimizable()) {
|
||||
UINFO(3, " Table Optimize spacetime=" << (space / time) << " " << nodep);
|
||||
m_totalBytes += space;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ enum ForkType : uint8_t {
|
|||
|
||||
enum PropagationType : uint8_t {
|
||||
P_CALL = 1, // Propagation through call to a function/task/method
|
||||
P_FORK = 2, // Propagation due to fork's behaviour
|
||||
P_FORK = 2, // Propagation due to fork's behavior
|
||||
P_SIGNATURE = 3, // Propagation required to maintain C++ function's signature requirements
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -685,7 +685,7 @@ public:
|
|||
// Now that we have everything ready, remove redundant pushPrefix/popPrefix
|
||||
// pairs. While functionally this is not really necessary (the trace files
|
||||
// might have some empty scope declarations), we do it to preserve previous
|
||||
// behaviour. Note: unfortunately generating these without the redundant
|
||||
// behavior. Note: unfortunately generating these without the redundant
|
||||
// push/pop pairs is a bit hard. It is cleaner to remove them.
|
||||
removeRedundantPrefixPushPop();
|
||||
|
||||
|
|
|
|||
|
|
@ -129,9 +129,9 @@ class UnknownVisitor final : public VNVisitor {
|
|||
fl, condp,
|
||||
(needDly
|
||||
? static_cast<AstNode*>(new AstAssignDly{
|
||||
fl, prep, new AstVarRef{fl, varp, VAccess::READ}, m_timingControlp})
|
||||
fl, prep, new AstVarRef{fl, varp, VAccess::READ}, m_timingControlp})
|
||||
: static_cast<AstNode*>(new AstAssign{
|
||||
fl, prep, new AstVarRef{fl, varp, VAccess::READ}, m_timingControlp}))};
|
||||
fl, prep, new AstVarRef{fl, varp, VAccess::READ}, m_timingControlp}))};
|
||||
newp->branchPred(VBranchPred::BP_LIKELY);
|
||||
newp->isBoundsCheck(true);
|
||||
UINFOTREE(9, newp, "", "_new");
|
||||
|
|
|
|||
|
|
@ -4561,11 +4561,12 @@ class WidthVisitor final : public VNVisitor {
|
|||
refp = m_vup ? VN_CAST(m_vup->dtypeNullSkipRefp(), ClassRefDType) : nullptr;
|
||||
}
|
||||
if (!refp) { // e.g. int a = new;
|
||||
nodep->v3error("new() assignment not legal to non-class "
|
||||
+ (VN_IS(warnp, NodeDType) ? (
|
||||
"data type "s + VN_AS(warnp, NodeDType)->prettyDTypeNameQ())
|
||||
: warnp ? warnp->prettyNameQ()
|
||||
: ""));
|
||||
nodep->v3error(
|
||||
"new() assignment not legal to non-class "
|
||||
+ (VN_IS(warnp, NodeDType)
|
||||
? ("data type "s + VN_AS(warnp, NodeDType)->prettyDTypeNameQ())
|
||||
: warnp ? warnp->prettyNameQ()
|
||||
: ""));
|
||||
nodep->dtypep(m_vup->dtypep());
|
||||
return;
|
||||
}
|
||||
|
|
@ -5981,8 +5982,8 @@ class WidthVisitor final : public VNVisitor {
|
|||
// Must be a error according to spec
|
||||
// (Because we need to know if to connect to one or all instants)
|
||||
nodep->v3error(ucfirst(nodep->prettyOperatorName())
|
||||
<< " as part of a module instance array"
|
||||
<< " requires " << modwidth << " or " << modwidth * numInsts
|
||||
<< " as part of a module instance array" << " requires "
|
||||
<< modwidth << " or " << modwidth * numInsts
|
||||
<< " bits, but connection's "
|
||||
<< nodep->exprp()->prettyTypeName() << " generates " << conwidth
|
||||
<< " bits. (IEEE 1800-2023 23.3.3)");
|
||||
|
|
@ -5993,8 +5994,8 @@ class WidthVisitor final : public VNVisitor {
|
|||
if (nodep->modVarp()->direction() == VDirection::REF) {
|
||||
nodep->v3error("Ref connection "
|
||||
<< nodep->modVarp()->prettyNameQ()
|
||||
<< " requires matching types;"
|
||||
<< " ref requires " << modDTypep->prettyDTypeNameQ()
|
||||
<< " requires matching types;" << " ref requires "
|
||||
<< modDTypep->prettyDTypeNameQ()
|
||||
<< " data type but connection is "
|
||||
<< conDTypep->prettyDTypeNameQ() << " data type.");
|
||||
} else if (nodep->modVarp()->isTristate()) {
|
||||
|
|
@ -6023,8 +6024,7 @@ class WidthVisitor final : public VNVisitor {
|
|||
nodep->v3error("Illegal " << nodep->prettyOperatorName() << ","
|
||||
<< " mismatch between port which is"
|
||||
<< (VN_CAST(modDTypep, IfaceRefDType) ? "" : " not")
|
||||
<< " an interface,"
|
||||
<< " and expression which is"
|
||||
<< " an interface," << " and expression which is"
|
||||
<< (VN_CAST(conDTypep, IfaceRefDType) ? "" : " not")
|
||||
<< " an interface.");
|
||||
}
|
||||
|
|
@ -6045,12 +6045,11 @@ class WidthVisitor final : public VNVisitor {
|
|||
UINFO(1, " Related lo: " << modDTypep);
|
||||
UINFO(1, " Related hi: " << conDTypep);
|
||||
} else if ((exprArrayp && !modArrayp) || (!exprArrayp && modArrayp)) {
|
||||
nodep->v3error("Illegal " << nodep->prettyOperatorName() << ","
|
||||
<< " mismatch between port which is"
|
||||
<< (modArrayp ? "" : " not") << " an array,"
|
||||
<< " and expression which is"
|
||||
<< (exprArrayp ? "" : " not")
|
||||
<< " an array. (IEEE 1800-2023 7.6)");
|
||||
nodep->v3error(
|
||||
"Illegal "
|
||||
<< nodep->prettyOperatorName() << "," << " mismatch between port which is"
|
||||
<< (modArrayp ? "" : " not") << " an array," << " and expression which is"
|
||||
<< (exprArrayp ? "" : " not") << " an array. (IEEE 1800-2023 7.6)");
|
||||
UINFO(1, " Related lo: " << modDTypep);
|
||||
UINFO(1, " Related hi: " << conDTypep);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void compareWls(int obits, WDataInP const lwp, WDataInP const rwp) {
|
|||
sc_biguint<(obits)> _butemp; \
|
||||
for (int i = 0; i < VL_WORDS_I(obits); ++i) { \
|
||||
int msb = ((i + 1) * VL_IDATASIZE) - 1; \
|
||||
msb = (msb >= (obits)) ? ((obits)-1) : msb; \
|
||||
msb = (msb >= (obits)) ? ((obits) - 1) : msb; \
|
||||
_butemp.range(msb, i* VL_IDATASIZE) = (rwp)[i]; \
|
||||
} \
|
||||
(svar).write(_butemp); \
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ int main(int argc, char** argv) {
|
|||
} else if (pid == 0) {
|
||||
printf("child: here we go\n");
|
||||
} else {
|
||||
while (wait(nullptr) > 0)
|
||||
;
|
||||
while (wait(nullptr) > 0);
|
||||
printf("parent: here we go\n");
|
||||
topp->is_parent = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue