diff --git a/elab_sig.cc b/elab_sig.cc index cca3a4187..83bc2ce5c 100644 --- a/elab_sig.cc +++ b/elab_sig.cc @@ -937,12 +937,7 @@ bool test_ranges_eeq(const vector&lef, const vector&rig) ivl_type_t PWire::elaborate_type(Design*des, NetScope*scope, const std::vector&packed_dimensions) const { - if (dynamic_cast(set_data_type_) || - dynamic_cast(set_data_type_) || - dynamic_cast(set_data_type_) || - dynamic_cast(set_data_type_) || - dynamic_cast(set_data_type_) || - dynamic_cast(set_data_type_)) { + if (set_data_type_ && !dynamic_cast(set_data_type_)) { ivl_type_t use_type = set_data_type_->elaborate_type(des, scope); ivl_assert(*this, packed_dimensions.empty()); return use_type; @@ -962,8 +957,7 @@ ivl_type_t PWire::elaborate_type(Design*des, NetScope*scope, } ivl_assert(*this, use_data_type == IVL_VT_LOGIC || - use_data_type == IVL_VT_BOOL || - use_data_type == IVL_VT_REAL); + use_data_type == IVL_VT_BOOL); netvector_t*vec = new netvector_t(packed_dimensions, use_data_type); vec->set_signed(get_signed()); diff --git a/netlist.cc b/netlist.cc index a96728765..cb2ee73a6 100644 --- a/netlist.cc +++ b/netlist.cc @@ -32,6 +32,7 @@ # include "netdarray.h" # include "netenum.h" # include "netparray.h" +# include "netscalar.h" # include "netqueue.h" # include "netstruct.h" # include "netvector.h" diff --git a/pform.cc b/pform.cc index 0fd56df41..a5b178478 100644 --- a/pform.cc +++ b/pform.cc @@ -2569,7 +2569,6 @@ void pform_module_define_port(const struct vlltype&li, list*attr, bool keep_attr) { - data_type_t*packed_type = 0; ivl_variable_type_t data_type = IVL_VT_NO_TYPE; bool signed_flag = false; @@ -2601,6 +2600,7 @@ void pform_module_define_port(const struct vlltype&li, data_type = vec_type->base_type; signed_flag = vec_type->signed_flag; prange = vec_type->pdims.get(); + vtype = 0; } else if (real_type_t*rtype = dynamic_cast(vtype)) { data_type = IVL_VT_REAL; signed_flag = true; @@ -2614,7 +2614,6 @@ void pform_module_define_port(const struct vlltype&li, } else if (vtype) { if (vtype->figure_packed_base_type() != IVL_VT_NO_TYPE) { data_type = vtype->figure_packed_base_type(); - packed_type = vtype; } else { VLerror(li, "sorry: Given type %s not supported here (%s:%d).", typeid(*vtype).name(), __FILE__, __LINE__); @@ -2631,10 +2630,10 @@ void pform_module_define_port(const struct vlltype&li, cur->set_signed(signed_flag); - if (packed_type) { - cur->set_data_type(packed_type); + if (vtype) + cur->set_data_type(vtype); - } else if (prange == 0) { + if (prange == 0) { cur->set_range_scalar((type == NetNet::IMPLICIT) ? SR_PORT : SR_BOTH); } else { @@ -2966,8 +2965,7 @@ vector*pform_make_task_ports(const struct vlltype&loc, } if (/*real_type_t*real_type = */ dynamic_cast (vtype)) { - ret = pform_make_task_ports(loc, pt, IVL_VT_REAL, - true, 0, ports); + ret = do_make_task_ports(loc, pt, IVL_VT_REAL, vtype, ports); } if (dynamic_cast (vtype)) { @@ -3442,7 +3440,6 @@ void pform_set_data_type(const struct vlltype&li, data_type_t*data_type, list (data_type)) { - pform_set_net_range(names, 0, true, 0); vt = IVL_VT_REAL; } diff --git a/pform_disciplines.cc b/pform_disciplines.cc index 3e9ce838a..0e3c2e7f7 100644 --- a/pform_disciplines.cc +++ b/pform_disciplines.cc @@ -209,7 +209,9 @@ void pform_attach_discipline(const struct vlltype&loc, error_count += 1; } else { - cur_net->set_data_type(IVL_VT_REAL); + data_type_t *type = new real_type_t(real_type_t::REAL); + FILE_NAME(type, loc); + cur_net->set_data_type(type); cur_net->set_discipline(discipline); } }