Skip to content

Commit

Permalink
vhdlpp: Evaluates attributes if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
orsonmmz committed Mar 6, 2015
1 parent afbda09 commit 9128eb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vhdlpp/expression_emit.cc
Expand Up @@ -307,6 +307,13 @@ int ExpAttribute::emit(ostream&out, Entity*ent, ScopeBase*scope)
{
int errors = 0;

// Try to evaluate first
int64_t val;
if(evaluate(scope, val)) {
out << val;
return 0;
}

if (name_ == "event") {
out << "$ivlh_attribute_event(";
errors += base_->emit(out, ent, scope);
Expand Down

0 comments on commit 9128eb6

Please sign in to comment.