Add VERILATOR_NUMA_STRATEGY environment variable (#6826) (#6880)

Signed-off-by: Yangyu Chen <[email protected]>
This commit is contained in:
Yangyu Chen
2026-01-06 10:20:57 -05:00
committed by GitHub
parent f9f7a7146d
commit 2ba96536e6
5 changed files with 73 additions and 2 deletions
+6
View File
@@ -147,6 +147,12 @@ VlThreadPool::~VlThreadPool() {
std::string VlThreadPool::numaAssign() {
#if defined(__linux) || defined(CPU_ZERO) || defined(VL_CPPCHECK) // Linux-like pthreads
std::string numa_strategy = VlOs::getenvStr("VERILATOR_NUMA_STRATEGY", "default");
if (numa_strategy == "none") {
return "no NUMA assignment requested";
} else if (numa_strategy != "default" && numa_strategy != "") {
return "%Warning: unknown VERILATOR_NUMA_STRATEGY value '" + numa_strategy + "'";
}
// Get number of processor available to the current process
const unsigned num_proc = VlOs::getProcessAvailableParallelism();
if (!num_proc) return "Can't determine number of available threads";