Skip to content

Commit

Permalink
Merge pull request #1081 from antmicro/fix-evaluation
Browse files Browse the repository at this point in the history
Fix compilation with gcc 14; Fix evaluation of `$left`, `$right`, `$high`, `$low`
  • Loading branch information
tgorochowik authored Jul 31, 2024
2 parents 0ed5497 + 6e62a0f commit cdba7aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions templates/ExprEval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2568,12 +2568,12 @@ any *ExprEval::hierarchicalSelector(std::vector<std::string> &select_path,
}
tmp->Ranges(tmpR);
return tmp;
}
}
} else if (const array_typespec *ltps =
any_cast<const array_typespec *>(object)) {
if (const ref_typespec *rt = ltps->Elem_typespec()) {
return (typespec *)rt->Actual_typespec();
}
}
} else if (const packed_array_typespec *ltps =
any_cast<const packed_array_typespec *>(object)) {
if (const ref_typespec *rt = ltps->Elem_typespec()) {
Expand Down Expand Up @@ -4049,17 +4049,17 @@ expr *ExprEval::reduceExpr(const any *result, bool &invalidValue,
int64_t lrv = eval.get_value(invalidValue, lr);
rr = reduceExpr(rr, invalidValue, inst, pexpr, muteError);
int64_t rrv = eval.get_value(invalidValue, rr);
if (name == "left") {
if (name == "$left") {
return lr;
} else if (name == "right") {
} else if (name == "$right") {
return rr;
} else if (name == "high") {
} else if (name == "$high") {
if (lrv > rrv) {
return lr;
} else {
return rr;
}
} else if (name == "low") {
} else if (name == "$low") {
if (lrv > rrv) {
return rr;
} else {
Expand Down
1 change: 1 addition & 0 deletions templates/vpi_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>

static bool showIDs = false;
static constexpr int32_t kLevelIndent = 2;
Expand Down

0 comments on commit cdba7aa

Please sign in to comment.