From ffd7ec10071c2b956d9237ff81e082d30d4d0511 Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Mon, 20 Oct 2025 11:16:36 -0400 Subject: [PATCH] Fix DFG synthesis non-determinism (#6557) (#6568) --- src/V3DfgSynthesize.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/V3DfgSynthesize.cpp b/src/V3DfgSynthesize.cpp index cae9778ff..b5009fd88 100644 --- a/src/V3DfgSynthesize.cpp +++ b/src/V3DfgSynthesize.cpp @@ -531,7 +531,14 @@ class AstToDfgSynthesize final { // TYPES using Variable = std::conditional_t; - using SymTab = std::unordered_map; + + // SymTab must be ordered in order to yield stable results + struct VariableComparator final { + bool operator()(const Variable* lhs, const Variable* rhs) const { + return lhs->name() < rhs->name(); + } + }; + using SymTab = std::map; // Represents a [potentially partial] driver of a variable struct Driver final {