Use data_type_t to pass `string` type information to signal elaboration

For signals that are declared in a block string_type_t is already used to
pass the type information to the signal elaboration.

But for task ports it is passed as IVL_VT_STRING. Switch this over to also
passing the type information as a data_type_t.

This allows to remove the special handling for IVL_VT_STRING in the signal
elaboration.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-01-09 21:04:06 +01:00
parent 372e3eae25
commit 5f71307ab4
2 changed files with 5 additions and 17 deletions

View File

@ -1254,21 +1254,6 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
sig = new NetNet(scope, name_, wtype, unpacked_dimensions,
&netstring_t::type_string);
} else if (set_data_type_==0 && data_type_==IVL_VT_STRING) {
// Signal declared as: string foo;
if (debug_elaborate) {
cerr << get_fileline() << ": PWire::elaborate_sig: "
<< "Create signal " << wtype
<< " string "
<< name_ << " in scope " << scope_path(scope)
<< " without set_data_type_"
<< endl;
}
sig = new NetNet(scope, name_, wtype, unpacked_dimensions,
&netstring_t::type_string);
} else if (parray_type_t*parray_type = dynamic_cast<parray_type_t*>(set_data_type_)) {
// The pform gives us a parray_type_t for packed arrays
// that show up in type definitions. This can be handled
@ -1315,6 +1300,10 @@ NetNet* PWire::elaborate_sig(Design*des, NetScope*scope) const
}
}
ivl_assert(*this, use_data_type == IVL_VT_LOGIC ||
use_data_type == IVL_VT_BOOL ||
use_data_type == IVL_VT_REAL);
netvector_t*vec = new netvector_t(packed_dimensions, use_data_type);
vec->set_signed(get_signed());
vec->set_isint(get_isint());

View File

@ -3044,8 +3044,7 @@ vector<pform_tf_port_t>*pform_make_task_ports(const struct vlltype&loc,
}
if (dynamic_cast<string_type_t*> (vtype)) {
ret = pform_make_task_ports(loc, pt, IVL_VT_STRING,
false, 0, ports);
ret = do_make_task_ports(loc, pt, IVL_VT_STRING, vtype, ports);
}
if (class_type_t*class_type = dynamic_cast<class_type_t*> (vtype)) {