Support constraint imperfect distributions (#6811) (#7168)

This commit is contained in:
Yilou Wang
2026-03-03 11:23:14 -05:00
committed by GitHub
parent 5f3d475736
commit 3bc73cc768
11 changed files with 405 additions and 13 deletions
+8
View File
@@ -746,6 +746,14 @@ void VlRandomizer::soft(std::string&& constraint, const char* /*filename*/, uint
m_softConstraints.emplace_back(std::move(constraint));
}
void VlRandomizer::disable_soft(const std::string& varName) {
// IEEE 1800-2017 18.5.13: Remove all soft constraints referencing the variable
m_softConstraints.erase(
std::remove_if(m_softConstraints.begin(), m_softConstraints.end(),
[&](const std::string& c) { return c.find(varName) != std::string::npos; }),
m_softConstraints.end());
}
void VlRandomizer::clearConstraints() {
m_constraints.clear();
m_constraints_line.clear();