Clean up some NetNet variable type handling.
This commit is contained in:
parent
5494c9ae09
commit
2355e1ed8e
12
netlist.cc
12
netlist.cc
|
|
@ -759,18 +759,14 @@ void NetNet::set_module_port_index(unsigned idx)
|
|||
|
||||
ivl_variable_type_t NetNet::data_type() const
|
||||
{
|
||||
if (net_type_==0)
|
||||
return IVL_VT_LOGIC;
|
||||
else
|
||||
return net_type_->base_type();
|
||||
ivl_assert(*this, net_type_);
|
||||
return net_type_->base_type();
|
||||
}
|
||||
|
||||
bool NetNet::get_signed() const
|
||||
{
|
||||
if (net_type_==0)
|
||||
return false;
|
||||
else
|
||||
return net_type_->get_signed();
|
||||
ivl_assert(*this, net_type_);
|
||||
return net_type_->get_signed();
|
||||
}
|
||||
|
||||
bool NetNet::get_isint() const
|
||||
|
|
|
|||
|
|
@ -627,7 +627,7 @@ class NetNet : public NetObj, public PortType {
|
|||
// now, the unpacked type is not burried into an ivl_type_s object.
|
||||
explicit NetNet(NetScope*s, perm_string n, Type t,
|
||||
const std::list<netrange_t>&unpacked,
|
||||
ivl_type_t type =0);
|
||||
ivl_type_t type);
|
||||
|
||||
// This form builds a NetNet from its record/enum/darray
|
||||
// definition. They should probably be replaced with a single
|
||||
|
|
|
|||
|
|
@ -751,13 +751,15 @@ NetExpr* elab_and_eval(Design*des, NetScope*scope, PExpr*pe,
|
|||
expr_width = context_width;
|
||||
|
||||
if (debug_elaborate) {
|
||||
cerr << pe->get_fileline() << ": debug: test_width of "
|
||||
cerr << pe->get_fileline() << ": elab_and_eval: test_width of "
|
||||
<< *pe << endl;
|
||||
cerr << pe->get_fileline() << ": "
|
||||
cerr << pe->get_fileline() << ": : "
|
||||
<< "returns type=" << pe->expr_type()
|
||||
<< ", width=" << expr_width
|
||||
<< ", signed=" << pe->has_sign()
|
||||
<< ", mode=" << PExpr::width_mode_name(mode) << endl;
|
||||
cerr << pe->get_fileline() << ": : "
|
||||
<< "cast_type=" << cast_type << endl;
|
||||
}
|
||||
|
||||
// If we can get the same result using a smaller expression
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ class ivl_type_s {
|
|||
virtual long packed_width(void) const;
|
||||
virtual std::vector<netrange_t> slice_dimensions() const;
|
||||
|
||||
// Some types have a base variable type.
|
||||
// Some types have a base variable type. This is the bit type
|
||||
// for packed data types, or IVL_VT_DARRAY or IVL_VT_CLASS for
|
||||
// those specific types.
|
||||
virtual ivl_variable_type_t base_type() const;
|
||||
virtual bool get_signed() const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue