mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-04 00:31:42 +02:00
ivl_target interface to packed type details.
The darray in particular needs to know about the subtype info. In the process, clean up some of the type information.
This commit is contained in:
+9
-13
@@ -20,16 +20,12 @@
|
||||
*/
|
||||
|
||||
# include "nettypes.h"
|
||||
# include "netvector.h"
|
||||
# include "ivl_target.h"
|
||||
# include <list>
|
||||
|
||||
class netvector_t;
|
||||
|
||||
class netdarray_t : public ivl_type_s {
|
||||
class netdarray_t : public netarray_t {
|
||||
|
||||
public:
|
||||
explicit netdarray_t(netvector_t*vec);
|
||||
explicit netdarray_t(ivl_type_t vec);
|
||||
~netdarray_t();
|
||||
|
||||
// This is the "base_type()" virtual method of the
|
||||
@@ -37,18 +33,18 @@ class netdarray_t : public ivl_type_s {
|
||||
// IVL_VT_DARRAY for dynamic arrays?
|
||||
ivl_variable_type_t base_type() const;
|
||||
|
||||
// The ivl_target.h API uses this method to get the type of
|
||||
// the element of the array.
|
||||
inline const ivl_type_s* element_type() const { return elem_type_; }
|
||||
// This is the base_type() of the element of the array. We
|
||||
// need this in some cases in order to get the base type of
|
||||
// the element, and not the IVL_VT_DARRAY of the array itself.
|
||||
inline ivl_variable_type_t element_base_type() const { return element_type()->base_type(); }
|
||||
|
||||
// This is the base_type() of the element of the array.
|
||||
inline ivl_variable_type_t element_base_type() const { return elem_type_->base_type(); }
|
||||
inline unsigned long vector_width(void) const { return elem_type_->packed_width(); }
|
||||
// This is a convenience function for getting the width of an
|
||||
// element. Strictly speaking it's not necessary.
|
||||
inline unsigned long element_width(void) const { return element_type()->packed_width(); }
|
||||
|
||||
std::ostream& debug_dump(std::ostream&) const;
|
||||
|
||||
private:
|
||||
netvector_t*elem_type_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user