Commit Graph

72 Commits

Author SHA1 Message Date
Geza Lore a0edd4e907
Internals: Improve cppcheck flow and fix up issues (#6311)
Added cppcheck-suppressions.txt in the repo root. You can add new
patterns in there instead of having to parse the XML output.

Also configure to add the -D__GNUC__ preprocessor macro, which makes it
understand UASSERT (it understands the 'noreturn' function attribute).

Added some case by case specific suppressions and fixed up other code,
especially in V3Ast*h and V3Dfg*.h, including code generated by astgen
that had some no-ops that irks cppcheck.

One thing it does not seem to like is `const` class members with default
initializers in the class. It will assume that's always the value, even
if overridden in the constructor. We had few so removed them.

With that a lot of files in `src/` are now clean or only have a handful
of issues. Therefore, I have also deleted cppcheck_filtered, and made it
produce human readable output straight to the terminal.

Regarding cleaning up the reported nits, I kind of got bored after
V3[A-E] so pausing here. Apologies for the merge conflicts.

Tested with cppcheck 2.13.0
2025-08-19 22:02:10 +01:00
Ryszard Rozak 7d2b6bd921
Internals: Optimize updates of Vtogcov signals. No functional change intended. (#6110) 2025-08-04 13:29:56 +01:00
github action 2fc12d951e Apply 'make format' 2025-07-11 17:11:31 +00:00
Petr Nohavica 0982260d3b
Fix constructor parameters in inheritance hierarchies (#6036) (#6070) 2025-07-11 13:10:36 -04:00
Wilson Snyder 916a89761e Add `--work` library-selection option (#5891 partial). 2025-06-29 20:17:27 -04:00
Wilson Snyder 46c7b69c64 Internals: UINFO now includes newline itself. No functional change. 2025-05-22 20:29:32 -04:00
Wilson Snyder 51616ecf2f Internals: Rename to instances, and other minor cleanups 2025-05-04 14:57:10 -04:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Wilson Snyder 7efa0fc82a Internals: Rewrite skipRefp to avoid recursion and fix const-ness. No functional change intended. 2024-11-29 08:10:51 -05:00
Wilson Snyder a68da7e220 Internals: Style cleanup. Ignore whitespace if diff. No functional change. 2024-11-10 10:59:18 -05:00
Wilson Snyder 28b9216f8a Fix tracing class parameters (#5014). 2024-03-27 20:07:46 -04:00
Wilson Snyder 0ff77fc352 Internals: Remove extra single-line {}. No functional change. 2024-03-27 17:57:49 -04:00
Kefa Chen 5f1dc73a1b
Support public packed struct / union (#860) (#4878) 2024-03-03 10:23:04 -05:00
Wilson Snyder 21e85f87bc Fix compilation error on multi-inherited interface class usage (#4819). 2024-01-23 19:36:11 -05:00
Szymon Gizler 5f52c066e5
Internals: Add serializeOnly() and dumpTreeEitherLevel() (#4815) (#4715). No functional change intended. 2024-01-09 10:35:13 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder 9fd5634778 Internals: Remove unneeded private's. No functional change 2023-11-13 21:37:45 -05:00
Ryszard Rozak a764c70b4a
Fix handling of static keyword in methods (#4649) 2023-10-31 08:15:54 -04:00
Geza Lore 30318a6654 C++11 cleanup 2023-10-28 11:26:48 +01:00
Wilson Snyder b5828a7ce9 Fix header order botched by clang-format in recent commit. 2023-10-18 06:37:46 -04:00
github action 770cd24f27 Apply 'make format' 2023-10-18 02:50:27 +00:00
Wilson Snyder 431bb1ed16
Support compiling Verilator with gcc/clang precompiled headers (#4579) 2023-10-17 22:49:28 -04:00
Mariusz Glebocki 28bd7e5b19
Rework multithreading handling to separate by code units that use/never use it. (#4228) 2023-09-24 22:12:23 -04:00
Wilson Snyder f94c1b32e5 Internals: Make V3MemberMap to remove member cache (#4350) 2023-07-08 12:40:27 -04:00
Krzysztof Bieganski 5788bc8048
Propagate class timescale to class package (#4348)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2023-07-07 17:27:33 +02:00
Aleksander Kiryk c248318958
Fix struct redefinition (#4276) 2023-06-06 18:28:35 -04:00
Wilson Snyder 0606a29f13 Fix arrays of unpacked structs (#4173). 2023-05-06 21:41:17 -04:00
Wilson Snyder add68130b8 Internals: Rename to dumpLevel(), to avoid confusion with make-a-dump() 2023-05-03 18:04:10 -04:00
Wilson Snyder 0307d59c1f Fix unpacked structs under classes (#4102). 2023-04-10 19:40:34 -04:00
Wilson Snyder ab502c5196 Fix coverage of class methods (#3998). 2023-03-03 19:26:15 -05:00
Wilson Snyder 93517b8378 Support unpacked unions. 2023-01-27 22:41:12 -05:00
Wilson Snyder b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Aleksander Kiryk c2b09e35f8
Support unpacked structs (#3802) 2022-12-20 19:22:42 -05:00
Larry Doolittle f27cf4c804
Commentary: Fix spelling in C++ comments (#3797) (#3798) 2022-12-02 18:46:38 -05:00
Geza Lore 65e08f4dbf Make all expressions derive from AstNodeExpr (#3721).
Apart from the representational changes below, this patch renames
AstNodeMath to AstNodeExpr, and AstCMath to AstCExpr.

Now every expression (i.e.: those AstNodes that represent a [possibly
void] value, with value being interpreted in a very general sense) has
AstNodeExpr as a super class. This necessitates the introduction of an
AstStmtExpr, which represents an expression in statement position, e.g :
'foo();' would be represented as AstStmtExpr(AstCCall(foo)). In exchange
we can get rid of isStatement() in AstNodeStmt, which now really always
represent a statement

Peak memory consumption and verilation speed are not measurably changed.

Partial step towards #3420
2022-11-03 16:02:16 +00:00
Geza Lore 63c694f65f Streamline dump control options
- Rename `--dump-treei` option to `--dumpi-tree`, which itself is now a
  special case of `--dumpi-<tag>` where tag can be a magic word, or a
  filename
- Control dumping via static `dump*()` functions, analogous to `debug()`
- Make dumping independent of the value of `debug()` (so dumping always
  works even without the debug flag)
- Add separate `--dumpi-graph` for dumping V3Graphs, which is again a
  special case of `--dumpi-<tag>`
- Alias `--dump-<tag>` to `--dumpi-<tag> 3` as before
2022-09-22 17:24:41 +01:00
Geza Lore ce03293128 Generate AstNode accessors via astgen
Introduce the @astgen directives parsed by astgen, currently used for
the generation child node (operand) accessors. Please see the updated
internal documentation for details.
2022-09-21 13:56:03 +01:00
Geza Lore 0c70a0dcbf Remove redundant 'virtual' keywords from overridden methods
'virtual' is redundant when 'override' is present, so keep only
'override'.

Add t/t_dist_cppstyle.pl to check for this.
2022-09-16 15:19:38 +01:00
Geza Lore 96a4b3e5a5 Update clang-format config and apply
- Regroup and sort #include directives (like we used to, but automatic)
- Set AlwaysBreakTemplateDeclarations to true
2022-08-05 12:00:24 +01:00
Wilson Snyder b9d7819faa Internals: Fix some cppcheck issues. Some dump functions fixed. 2022-07-30 10:01:39 -04:00
Krzysztof Bieganski e018eb7bac
Support AstClass::repairCache() after V3Class (#3431)
This is a pre-PR to #3363.

Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
2022-05-17 09:22:43 -04:00
Geza Lore 9abab2c366 Add separate AstInitialStatic node for static initializers
Static variable initializers run before initial blocks, so use an
explicitly different procedure type for them. This also enables us to
now raise errors for assignments to const variables in initial blocks.
2022-04-23 15:12:49 +01:00
github action 88d7ca01b0 Apply 'make format' 2022-01-02 20:13:16 +00:00
Wilson Snyder 2e2b82c052 Support class static members (#2233). 2022-01-02 15:09:07 -05:00
Wilson Snyder f1bb0544be Internals: Cleanups towards static class members. No functional change intended. 2022-01-02 15:03:57 -05:00
Wilson Snyder e6857df5c6 Internals: Rename Ast on non-node classes (#3262). No functional change.
This commit has the following replacements applied:

	s/\bAstUserInUseBase\b/VNUserInUseBase/g;
        s/\bAstAttrType\b/VAttrType/g;
        s/\bAstBasicDTypeKwd\b/VBasicDTypeKwd/g;
        s/\bAstDisplayType\b/VDisplayType/g;
        s/\bAstNDeleter\b/VNDeleter/g;
        s/\bAstNRelinker\b/VNRelinker/g;
        s/\bAstNVisitor\b/VNVisitor/g;
        s/\bAstPragmaType\b/VPragmaType/g;
        s/\bAstType\b/VNType/g;
        s/\bAstUser1InUse\b/VNUser1InUse/g;
        s/\bAstUser2InUse\b/VNUser2InUse/g;
        s/\bAstUser3InUse\b/VNUser3InUse/g;
        s/\bAstUser4InUse\b/VNUser4InUse/g;
        s/\bAstUser5InUse\b/VNUser5InUse/g;
        s/\bAstVarType\b/VVarType/g;
2022-01-02 14:03:20 -05:00
github action 340efe3a3a Apply 'make format' 2022-01-02 14:46:15 +00:00
Wilson Snyder 2342549caf Internals: V3Class cleanup. No functional change. 2022-01-02 09:43:37 -05:00
Wilson Snyder ca42be982c Copyright year update. 2022-01-01 08:26:40 -05:00
Wilson Snyder cd737065f2 Internals: More const. No functional change intended. 2021-11-26 17:55:36 -05:00