diff --git a/vhdlpp/expression_elaborate.cc b/vhdlpp/expression_elaborate.cc index 50afb51c3..171ace8ca 100644 --- a/vhdlpp/expression_elaborate.cc +++ b/vhdlpp/expression_elaborate.cc @@ -418,7 +418,7 @@ const VType*ExpAggregate::fit_type(Entity*, ScopeBase*, const VTypeArray*host) c Expression*use_msb = prange->msb(); Expression*use_lsb = prange->lsb(); - ivl_assert(*this, host->dimensions() == 1); + ivl_assert(*this, host->dimensions().size() == 1); vector range (1); range[0] = VTypeArray::range_t(use_msb, use_lsb); @@ -677,7 +677,7 @@ const VType*ExpConcat::fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*at if(const VTypeArray*arr = dynamic_cast(types[i])) { types[i] = arr->element_type(); - ivl_assert(*this, arr->dimensions() == 1); + ivl_assert(*this, arr->dimensions().size() == 1); const VTypeArray::range_t&dim = arr->dimension(0); sizes[i] = new ExpArithmetic(ExpArithmetic::MINUS, dim.msb(), dim.lsb()); } else { @@ -732,7 +732,7 @@ int ExpConcat::elaborate_expr_array_(Entity*ent, ScopeBase*scope, const VTypeArr int errors = 0; // For now, only support single-dimension arrays here. - ivl_assert(*this, atype->dimensions() == 1); + ivl_assert(*this, atype->dimensions().size() == 1); const VType*type1 = operand1_->fit_type(ent, scope, atype); ivl_assert(*this, type1); diff --git a/vhdlpp/expression_emit.cc b/vhdlpp/expression_emit.cc index e3c6cb964..a3d6e77e0 100644 --- a/vhdlpp/expression_emit.cc +++ b/vhdlpp/expression_emit.cc @@ -140,7 +140,7 @@ int ExpAggregate::emit_array_(ostream&out, Entity*ent, ScopeBase*scope, const VT // Special case: The aggregate is a single "others" item. if (aggregate_.size() == 1 && aggregate_[0].choice->others()) { - assert(atype->dimensions() == 1); + assert(atype->dimensions().size() == 1); const VTypeArray::range_t&rang = atype->dimension(0); assert(! rang.is_box()); @@ -978,7 +978,7 @@ int ExpString::emit(ostream& out, Entity*ent, ScopeBase*scope) const int ExpString::emit_as_array_(ostream& out, Entity*, ScopeBase*, const VTypeArray*arr) const { int errors = 0; - assert(arr->dimensions() == 1); + assert(arr->dimensions().size() == 1); const VTypePrimitive*etype = dynamic_cast (arr->basic_type()); assert(etype); diff --git a/vhdlpp/expression_evaluate.cc b/vhdlpp/expression_evaluate.cc index e202ba475..56b2b7eec 100644 --- a/vhdlpp/expression_evaluate.cc +++ b/vhdlpp/expression_evaluate.cc @@ -85,7 +85,7 @@ bool ExpAttribute::test_array_type(const VType*type) const return false; } - if (arr->dimensions() > 1) { + if (arr->dimensions().size() > 1) { cerr << endl << get_fileline() << ": error: " << "Cannot apply the '" << name_ << " attribute to multidimensional arrays" << endl; diff --git a/vhdlpp/parse_misc.cc b/vhdlpp/parse_misc.cc index a26eac818..78f2a2c8f 100644 --- a/vhdlpp/parse_misc.cc +++ b/vhdlpp/parse_misc.cc @@ -97,7 +97,7 @@ static const VType* calculate_subtype_array(const YYLTYPE&loc, const char*base_n vector range (base_array->dimensions()); // For now, I only know how to handle 1 dimension - assert(base_array->dimensions() == 1); + assert(base_array->dimensions().size() == 1); range[0] = VTypeArray::range_t(array_left, array_right, downto); diff --git a/vhdlpp/vtype.h b/vhdlpp/vtype.h index 7c5ec3aac..a0576c51f 100644 --- a/vhdlpp/vtype.h +++ b/vhdlpp/vtype.h @@ -226,7 +226,7 @@ class VTypeArray : public VType { void show(std::ostream&) const; int get_width(ScopeBase*scope) const; - inline size_t dimensions() const { return ranges_.size(); }; + const std::vector&dimensions() const { return ranges_; }; const range_t&dimension(size_t idx) const { return ranges_[idx]; } diff --git a/vhdlpp/vtype_emit.cc b/vhdlpp/vtype_emit.cc index 8327af50c..81807fa4b 100644 --- a/vhdlpp/vtype_emit.cc +++ b/vhdlpp/vtype_emit.cc @@ -65,7 +65,7 @@ int VTypeArray::emit_def(ostream&out, perm_string name) const const VTypePrimitive*base = dynamic_cast (raw_base); if (base) { - assert(dimensions() == 1); + assert(dimensions().size() == 1); // If this is a string type without any boundaries specified, then // there is a direct counterpart in SV called.. 'string' @@ -127,7 +127,7 @@ int VTypeArray::emit_with_dims_(std::ostream&out, bool packed, perm_string name) name_emitted = true; } - for(unsigned i = 0; i < cur->dimensions(); ++i) { + for(unsigned i = 0; i < cur->dimensions().size(); ++i) { if(cur->dimension(i).is_box() && !name_emitted) { emit_name(out, name); name_emitted = true;