From 9128eb67b98f3a99a4181727f21e19a317091d0f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 2 Mar 2015 14:09:30 +0100 Subject: [PATCH] vhdlpp: Evaluates attributes if possible. --- vhdlpp/expression_emit.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vhdlpp/expression_emit.cc b/vhdlpp/expression_emit.cc index 49f60446f..61f241490 100644 --- a/vhdlpp/expression_emit.cc +++ b/vhdlpp/expression_emit.cc @@ -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);