vhdlpp: Evaluates attributes if possible.

This commit is contained in:
Maciej Suminski 2015-03-02 14:09:30 +01:00
parent afbda099fb
commit 9128eb67b9
1 changed files with 7 additions and 0 deletions

View File

@ -307,6 +307,13 @@ int ExpAttribute::emit(ostream&out, Entity*ent, ScopeBase*scope)
{ {
int errors = 0; int errors = 0;
// Try to evaluate first
int64_t val;
if(evaluate(scope, val)) {
out << val;
return 0;
}
if (name_ == "event") { if (name_ == "event") {
out << "$ivlh_attribute_event("; out << "$ivlh_attribute_event(";
errors += base_->emit(out, ent, scope); errors += base_->emit(out, ent, scope);