Commit Graph

204 Commits

Author SHA1 Message Date
Geza Lore ffbb3229a8
Change default thread pool sizes to respect processor affinity (#6604)
Instead of using the number of processors in the host, use the number of
processors available to the process, respecting cpu affinity
assignments. Without pthreads, fall back and use the number of
processors in the host as before.

This is now applied everywhere so runing `nuamctl -C 0-3 verilator` or
`numactl -C 0-3 Vsim` should behave as if the host has 4 cores (e.g.
like in CI jobs)
2025-10-28 18:10:40 +00:00
Geza Lore 5cd8bd0356
Remove use of VL_INLINE_OPT macro (#6507) 2025-09-29 18:07:36 +01:00
Geza Lore 4ab0690428
CI: Add -DVL_LEAK_CHECKS in asan builds (#6444) 2025-09-17 00:18:58 +01:00
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
Wilson Snyder b14539569f Internals: Check and enforce member brace initialization. No functional change intended 2025-08-17 13:20:52 -04:00
Sergey Fedorov ece4469869
Fix PowerPC support (#6292) 2025-08-15 11:25:32 -07:00
Wilson Snyder db5b2669fc Add current memory usage statistic (#6192 partial) 2025-07-24 08:36:58 +02:00
Wilson Snyder 7a6775ca84 Internals: Rename memPeakUsageBytes 2025-07-17 22:16:59 -04:00
Wilson Snyder 6d1e82b908
Add numactl-like automatic assignment of processor affinity (#5911) 2025-04-02 08:27:23 -04:00
Moubarak Jeje ac659d525b
Support VPI array accessors (#5612) 2025-02-07 19:06:46 -05:00
Wilson Snyder 8fbb725f34 Copyright year update. 2025-01-01 08:30:25 -05:00
Wilson Snyder 990ccd6763 Internals: Standardize on `template<typename`. No functional change. 2024-11-29 18:01:50 -05:00
Wilson Snyder 9689a4f58a Internals: Support VL_UNREACHABLE in C++23/MSVC. No functional change intended. 2024-10-31 21:29:13 -04:00
Wilson Snyder 36888fac5d Fix long module names crashing string handling (#5546). 2024-10-22 09:25:58 -04:00
Wilson Snyder 3525484730 Commentary 2024-09-10 19:04:55 -04:00
Bartłomiej Chmiel ffe76717c6
Thread pool rewrite (#5161)
Signed-off-by: Krzysztof Bieganski <kbieganski@antmicro.com>
Signed-off-by: Bartłomiej Chmiel <bchmiel@antmicro.com>
Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
Co-authored-by: Krzysztof Bieganski <kbieganski@antmicro.com>
Co-authored-by: Arkadiusz Kozdra <akozdra@antmicro.com>
Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
2024-08-23 08:36:49 -04:00
Arkadiusz Kozdra 9a8e68928d
Internals: Move getenvStr to verilatedos. (#5118)
* Internals: Move getenvStr to verilatedos. No functional change intended.
* Fix POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument.

Signed-off-by: Arkadiusz Kozdra <akozdra@antmicro.com>
2024-05-13 10:23:51 -04:00
Wilson Snyder 840970e8f7 Internals: Add VL_MT_SAFE flags 2024-03-30 11:54:29 -04:00
Wilson Snyder 4df9e2e0e5
Add printing summary reports (#4909) (#5018) 2024-03-25 07:03:17 -04:00
Wilson Snyder 2c27f22900 Remove unused vltstd::exchange, should be using C++14 std::exchange instead 2024-03-10 22:32:51 -04:00
Geza Lore 0fed5f8b3e
Avoid creating redundant vertices in V3DfgPeephole (#4944)
Add a new data-structure V3DfgCache, which can be used to retrieve
existing vertices with some given inputs vertices. Use this in
V3DfgPeephole to eliminate the creation of redundant vertices.

Overall this is performance neutral, but is in prep for some future
work.
2024-03-06 18:01:52 +00:00
Wilson Snyder e3e5f30ba1
Check for C++14 without also accepting GNU C++11 (#4865) 2024-01-28 19:42:29 -05:00
Wilson Snyder 3a5248a919 Internals: Mark structs final/VL_NOT_FINAL. No functional change intended. 2024-01-20 15:06:46 -05:00
Wilson Snyder e76f29e5ba Copyright year update 2024-01-01 03:19:59 -05:00
Wilson Snyder 4655ee014b Fix max multiply width. (#4781) 2023-12-31 11:42:06 -05:00
Rasfunk 2d7e8b58e4
Require C++14 or newer (#4784) (#4786) 2023-12-29 10:39:00 -05:00
Geza Lore f048cff093
Add inline for VL_ATTR_ALWINLINE, even on non GNU-C platforms (#4734)
This is required to avoid multiple definition errors at link time for
functions defined in headers and marked VL_ATTR_ALWINLINE.
2023-12-02 21:51:59 +00:00
Kamil Rakoczy 8bd6d7c5b1
Internals: Add V3ThreadSafety (#4477) 2023-09-13 07:57:48 -04:00
Anthony Donlon cbdee5a804
Fix Windows filename format, etc. (#3873) (#4421)
* Ignore CLion project files and CMake outputs
* Supporting stripping file path that contains backslash
* Set /bigobj flag and increase stack size for windows platform
* Fix MSVC warnings
2023-08-16 07:34:57 -04:00
Mariusz Glebocki 85b7f828b3
Internals: Use `std::packaged_task` as a job wrapper; add and use `V3ThreadPool::ScopedExclusiveAccess` (#4310).
* Add VL_ASSERT_CAPABILITY; add assumeLocked and pretendUnlock to V3Mutex.

* Pass jobs as template-arguments and use std::packaged_task.

* Add and use V3ThreadPool::ScopedExclusiveAccess.
2023-06-23 18:25:12 -04:00
Mariusz Glebocki e7714e0902
Internals: Add additional clang's thread safety analysis annotations (#4195)
* Simplify some Clang-specific attribute defines.

* Add `VL_RETURN_CAPABILITY` and `VL_PT_GUARDED_BY`.
2023-05-12 09:06:36 -04:00
Wilson Snyder befb415f27 Fix mod/div/round argument side effects 2023-05-07 22:31:31 -04:00
Wilson Snyder dc25be536c Internals: Deprecate VL_ATTR_ALIGNED, use alignas instead. 2023-05-02 21:21:10 -04:00
Kamil Rakoczy 65a484e00b
Internal: Update clang_check_annotations conditions (#4134) 2023-04-20 07:02:31 -04:00
Kamil Rakoczy bbf53bd5af
Add VL_MT_SAFE attribute to several functions. (#3729) 2023-03-16 19:48:56 -04:00
Larry Doolittle aff3f7c4f6
Fix build on hppa (#3954)
As supplied by John David Anglin in Debian bug #1030913
2023-02-11 04:23:26 -05:00
Wilson Snyder 317fe7a787 Fix VL_CPU_RELAX on MIPS/Armel/s390/sparc (#3891) 2023-01-19 17:22:28 -05:00
Andrew Nolte e5eb7d8930
Add VL_VALUE_STRING_MAX_WORDS override (#3869)
Co-authored-by: Andrew Nolte <anolte@hudson-trading.com>
2023-01-13 15:23:15 -05:00
Wilson Snyder b24d7c83d3 Copyright year update 2023-01-01 10:18:39 -05:00
Jevin Sweval 3340f7b0b4
Fix macOS weak symbols with -U linker flag (#3823) 2022-12-20 11:17:43 -05:00
Kamil Rakoczy 7a15457511
Tests: Add multithreading attribute checks (#3748) 2022-12-16 11:19:27 -05:00
Kritik Bhimani 9d2f1c607a
Fix MSVCC issues (#3813) 2022-12-14 07:07:25 -05:00
Kritik Bhimani 7b073fec7d
Fix MSVC++ portability issues (#3812) 2022-12-12 18:45:32 -05:00
Wilson Snyder a0e7930036 docs: Fix spelling 2022-12-09 22:39:41 -05:00
Kamil Rakoczy 5aa935d170
Internals: Add annotations for check attributes (#3803) 2022-12-09 07:12:26 -05:00
Larry Doolittle f27cf4c804
Commentary: Fix spelling in C++ comments (#3797) (#3798) 2022-12-02 18:46:38 -05:00
Wilson Snyder 7d807a7e0e Commentary 2022-11-29 07:33:12 -05:00
Larry Doolittle 6349e76abd
Remove $date from .vcd files (#3779) 2022-11-27 20:24:22 -05:00
Miodrag Milanović f782496092
Fix for mingw cross-compile, arm and riscv (#3752) 2022-11-16 05:34:25 -08:00
Kamil Rakoczy 207bc2b18a Fix comment annotation
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
2022-11-10 13:36:14 +00:00