diff --git a/elab_sig.cc b/elab_sig.cc index 7310e411d..2b939a211 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -1098,9 +1098,10 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const // dimensions, then turn this into a dynamic array and // put all the packed dimensions there. if (use_lidx==0 && use_ridx==0) { - ivl_assert(*this, netarray==0); - netarray = new netdarray_t(packed_dimensions, data_type_, wid); + netvector_t*vec = new netvector_t(packed_dimensions, data_type_); packed_dimensions.clear(); + ivl_assert(*this, netarray==0); + netarray = new netdarray_t(vec); continue; } diff --git a/netdarray.cc b/netdarray.cc index 55a121cbd..ed5c3a85b 100644 --- a/netdarray.cc +++ b/netdarray.cc @@ -21,12 +21,12 @@ using namespace std; -netdarray_t::netdarray_t(const std::list&packed, - ivl_variable_type_t type, unsigned long wid) -: packed_dims_(packed), type_(type), width_(wid) +netdarray_t::netdarray_t(netvector_t*vec) +: elem_type_(vec) { } netdarray_t::~netdarray_t() { + delete elem_type_; } diff --git a/netdarray.h b/netdarray.h index 568ea2696..cca16de16 100644 --- a/netdarray.h +++ b/netdarray.h @@ -20,24 +20,23 @@ */ # include "nettypes.h" +# include "netvector.h" # include "ivl_target.h" # include +class netvector_t; + class netdarray_t : public nettype_base_t { public: - explicit netdarray_t(const std::list&packed, - ivl_variable_type_t type, - unsigned long wid); + explicit netdarray_t(netvector_t*vec); ~netdarray_t(); - inline ivl_variable_type_t data_type() const { return type_; } - inline unsigned long vector_width(void) const { return width_; } + inline ivl_variable_type_t data_type() const { return elem_type_->base_type(); } + inline unsigned long vector_width(void) const { return elem_type_->packed_width(); } private: - std::list packed_dims_; - ivl_variable_type_t type_; - unsigned long width_; + netvector_t*elem_type_; }; #endif