diff --git a/net_assign.cc b/net_assign.cc index a6608320e..e47010df9 100644 --- a/net_assign.cc +++ b/net_assign.cc @@ -149,11 +149,10 @@ ivl_type_t NetAssign_::net_type() const } else { ivl_assert(*this, sig_); - // We don't have types for array signals yet. if (sig_->unpacked_dimensions() && !word_) - return nullptr; - - ntype = sig_->net_type(); + ntype = sig_->array_type(); + else + ntype = sig_->net_type(); } if (!member_.nil()) { diff --git a/netlist.cc b/netlist.cc index 239f7004f..1fdd07606 100644 --- a/netlist.cc +++ b/netlist.cc @@ -598,6 +598,9 @@ NetNet::NetNet(NetScope*s, perm_string n, Type t, initialize_dir_(); + if (!unpacked_dims_.empty()) + array_type_ = new netuarray_t(unpacked_dims_, net_type_); + s->add_signal(this); } @@ -733,6 +736,14 @@ const netclass_t* NetNet::class_type(void) const return dynamic_cast (net_type_); } +const netarray_t* NetNet::array_type() const +{ + if (array_type_) + return array_type_; + + return darray_type(); +} + /* * "depth" is the number of index expressions that the user is using * to index this identifier. So consider if Net was declared like so: diff --git a/netlist.h b/netlist.h index 85814c1d3..61163d66e 100644 --- a/netlist.h +++ b/netlist.h @@ -709,6 +709,7 @@ class NetNet : public NetObj, public PortType { const netdarray_t*darray_type(void) const; const netqueue_t*queue_type(void) const; const netclass_t*class_type(void) const; + const netarray_t*array_type(void) const; /* Attach a discipline to the net. */ ivl_discipline_t get_discipline() const; @@ -803,6 +804,7 @@ class NetNet : public NetObj, public PortType { PortType port_type_ : 3; bool local_flag_: 1; ivl_type_t net_type_; + netuarray_t *array_type_ = nullptr; ivl_discipline_t discipline_; std::vector unpacked_dims_;