Handle DARRAYs of real variables

This involves working out the code to get the base type of a select
expression of a darray. Also added the runtime support for darrays
with real value elements.
This commit is contained in:
Stephen Williams
2012-10-14 17:16:47 -07:00
parent 1326f9aef1
commit d6efece5dd
18 changed files with 226 additions and 20 deletions
+19
View File
@@ -348,6 +348,25 @@ ivl_select_type_t NetESelect::select_type() const
return sel_type_;
}
ivl_variable_type_t NetESelect::expr_type() const
{
ivl_variable_type_t type = expr_->expr_type();
if (type != IVL_VT_DARRAY)
return type;
ivl_assert(*this, type == IVL_VT_DARRAY);
// Special case: If the expression is a DARRAY, then the
// sub-expression must be a NetESignal and the type of the
// NetESelect expression is the element type of the arrayed signal.
NetESignal*sig = dynamic_cast<NetESignal*>(expr_);
ivl_assert(*this, sig);
const netarray_t*array_type = dynamic_cast<const netarray_t*> (sig->sig()->net_type());
ivl_assert(*this, array_type);
return array_type->element_type()->base_type();
}
bool NetESelect::has_width() const
{
return true;