Handle properly parsed structs in module ports.
This commit is contained in:
parent
67af96fee7
commit
247f6a4ecf
12
pform.cc
12
pform.cc
|
|
@ -1906,6 +1906,8 @@ void pform_module_define_port(const struct vlltype&li,
|
||||||
list<pform_range_t>*range,
|
list<pform_range_t>*range,
|
||||||
list<named_pexpr_t>*attr)
|
list<named_pexpr_t>*attr)
|
||||||
{
|
{
|
||||||
|
struct_type_t*struct_type = 0;
|
||||||
|
|
||||||
PWire*cur = pform_get_wire_in_scope(name);
|
PWire*cur = pform_get_wire_in_scope(name);
|
||||||
if (cur) {
|
if (cur) {
|
||||||
ostringstream msg;
|
ostringstream msg;
|
||||||
|
|
@ -1943,6 +1945,11 @@ void pform_module_define_port(const struct vlltype&li,
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (struct_type = dynamic_cast<struct_type_t*>(vtype)) {
|
||||||
|
data_type = figure_struct_base_type(struct_type);
|
||||||
|
signed_flag = false;
|
||||||
|
range = 0;
|
||||||
|
|
||||||
} else if (vtype) {
|
} else if (vtype) {
|
||||||
VLerror(li, "sorry: Given type %s not supported here (%s:%d).",
|
VLerror(li, "sorry: Given type %s not supported here (%s:%d).",
|
||||||
typeid(*vtype).name(), __FILE__, __LINE__);
|
typeid(*vtype).name(), __FILE__, __LINE__);
|
||||||
|
|
@ -1958,7 +1965,10 @@ void pform_module_define_port(const struct vlltype&li,
|
||||||
|
|
||||||
cur->set_signed(signed_flag);
|
cur->set_signed(signed_flag);
|
||||||
|
|
||||||
if (range == 0) {
|
if (struct_type) {
|
||||||
|
cur->set_struct_type(struct_type);
|
||||||
|
|
||||||
|
} else if (range == 0) {
|
||||||
cur->set_range_scalar((type == NetNet::IMPLICIT) ? SR_PORT : SR_BOTH);
|
cur->set_range_scalar((type == NetNet::IMPLICIT) ? SR_PORT : SR_BOTH);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
# include "parse_misc.h"
|
# include "parse_misc.h"
|
||||||
# include "ivl_assert.h"
|
# include "ivl_assert.h"
|
||||||
|
|
||||||
static ivl_variable_type_t figure_struct_base_type(struct_type_t*struct_type)
|
ivl_variable_type_t figure_struct_base_type(struct_type_t*struct_type)
|
||||||
{
|
{
|
||||||
ivl_variable_type_t base_type = IVL_VT_BOOL;
|
ivl_variable_type_t base_type = IVL_VT_BOOL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ struct struct_type_t : public data_type_t {
|
||||||
bool packed_flag;
|
bool packed_flag;
|
||||||
std::auto_ptr< list<struct_member_t*> > members;
|
std::auto_ptr< list<struct_member_t*> > members;
|
||||||
};
|
};
|
||||||
|
extern ivl_variable_type_t figure_struct_base_type(struct_type_t*struct_type);
|
||||||
|
|
||||||
struct atom2_type_t : public data_type_t {
|
struct atom2_type_t : public data_type_t {
|
||||||
inline explicit atom2_type_t(int tc, bool flag)
|
inline explicit atom2_type_t(int tc, bool flag)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue