vhdlpp: Added VType::is_unbounded() method.
This commit is contained in:
parent
756c9ceccf
commit
51b9191021
|
|
@ -148,6 +148,17 @@ void VTypeArray::show(ostream&out) const
|
||||||
out << "<nil>";
|
out << "<nil>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VTypeArray::is_unbounded() const {
|
||||||
|
for(std::vector<range_t>::const_iterator it = ranges_.begin();
|
||||||
|
it != ranges_.end(); ++it)
|
||||||
|
{
|
||||||
|
if(it->is_box())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return etype_->is_unbounded();
|
||||||
|
}
|
||||||
|
|
||||||
VTypeRange::VTypeRange(const VType*base, int64_t max_val, int64_t min_val)
|
VTypeRange::VTypeRange(const VType*base, int64_t max_val, int64_t min_val)
|
||||||
: base_(base)
|
: base_(base)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@ class VType {
|
||||||
// Determines if a type can be used in Verilog packed array.
|
// Determines if a type can be used in Verilog packed array.
|
||||||
virtual bool can_be_packed() const { return false; }
|
virtual bool can_be_packed() const { return false; }
|
||||||
|
|
||||||
|
// Returns true if the type has an undefined dimension.
|
||||||
|
virtual bool is_unbounded() const { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct decl_t;
|
friend struct decl_t;
|
||||||
// This virtual method is called to emit the declaration. This
|
// This virtual method is called to emit the declaration. This
|
||||||
|
|
@ -218,6 +221,8 @@ class VTypeArray : public VType {
|
||||||
|
|
||||||
bool can_be_packed() const { return etype_->can_be_packed(); }
|
bool can_be_packed() const { return etype_->can_be_packed(); }
|
||||||
|
|
||||||
|
bool is_unbounded() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int emit_with_dims_(std::ostream&out, bool packed, perm_string name) const;
|
int emit_with_dims_(std::ostream&out, bool packed, perm_string name) const;
|
||||||
|
|
||||||
|
|
@ -320,6 +325,8 @@ class VTypeDef : public VType {
|
||||||
int emit_def(std::ostream&out, perm_string name) const;
|
int emit_def(std::ostream&out, perm_string name) const;
|
||||||
|
|
||||||
bool can_be_packed() const { return type_->can_be_packed(); }
|
bool can_be_packed() const { return type_->can_be_packed(); }
|
||||||
|
|
||||||
|
bool is_unbounded() const { return type_->is_unbounded(); }
|
||||||
private:
|
private:
|
||||||
int emit_decl(std::ostream&out, perm_string name, bool reg_flag) const;
|
int emit_decl(std::ostream&out, perm_string name, bool reg_flag) const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue