vhdlpp: Do not evaluate generics.

They might change depending on the instance, so they cannot be evaluated using the default value.
This commit is contained in:
Maciej Suminski 2016-06-16 00:49:13 +02:00
parent ed3e67926f
commit 643a3f2f2c
2 changed files with 5 additions and 19 deletions

View File

@ -74,14 +74,13 @@ const VType*ExpName::elaborate_adjust_type_with_range_(Entity*ent, ScopeBase*sco
// If the name is an array, then a part select is
// also an array, but with different bounds.
int64_t use_msb, use_lsb;
bool flag;
bool flag = true;
flag = range->msb()->evaluate(ent, scope, use_msb);
ivl_assert(*this, flag);
flag = range->lsb()->evaluate(ent, scope, use_lsb);
ivl_assert(*this, flag);
flag &= range->msb()->evaluate(ent, scope, use_msb);
flag &= range->lsb()->evaluate(ent, scope, use_lsb);
type = new VTypeArray(array->element_type(), use_msb, use_lsb);
if(flag)
type = new VTypeArray(array->element_type(), use_msb, use_lsb);
}
else if(idx) {
// If the name is an array or a vector, then an

View File

@ -144,19 +144,6 @@ bool ExpName::evaluate(Entity*ent, ScopeBase*scope, int64_t&val) const
return false;
}
if (ent) {
const InterfacePort*gen = ent->find_generic(name_);
if (gen) {
// Evaluate the default expression and use that.
if (gen->expr && gen->expr->evaluate(ent, scope, val))
return true;
cerr << get_fileline() << ": sorry: I could not evaluate "
<< "generic override." << endl;
return false;
}
}
if (scope) {
const VType*type;
Expression*exp;