vhdlpp: VTypeArray::dimensions() returns std::vector<range_t>

This commit is contained in:
Maciej Suminski 2016-08-23 17:07:05 +02:00
parent 643a3f2f2c
commit fe77b0ac87
6 changed files with 10 additions and 10 deletions

View File

@ -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<VTypeArray::range_t> 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<const VTypeArray*>(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);

View File

@ -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<const VTypePrimitive*> (arr->basic_type());
assert(etype);

View File

@ -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;

View File

@ -97,7 +97,7 @@ static const VType* calculate_subtype_array(const YYLTYPE&loc, const char*base_n
vector<VTypeArray::range_t> 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);

View File

@ -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<range_t>&dimensions() const { return ranges_; };
const range_t&dimension(size_t idx) const
{ return ranges_[idx]; }

View File

@ -65,7 +65,7 @@ int VTypeArray::emit_def(ostream&out, perm_string name) const
const VTypePrimitive*base = dynamic_cast<const VTypePrimitive*> (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;