diff --git a/netlist.cc b/netlist.cc index 3aa48920b..57e9e3be1 100644 --- a/netlist.cc +++ b/netlist.cc @@ -2423,7 +2423,7 @@ const NetScope* NetEScope::scope() const } NetESignal::NetESignal(NetNet*n) -: NetExpr(n->vector_width()), net_(n), word_(0) +: NetExpr(n->vector_width()), net_(n), enum_type_(n->enumeration()), word_(0) { net_->incr_eref(); set_line(*n); @@ -2448,6 +2448,11 @@ perm_string NetESignal::name() const return net_->name(); } +netenum_t* NetESignal::enumeration() const +{ + return enum_type_; +} + const NetExpr* NetESignal::word_index() const { return word_; diff --git a/netlist.h b/netlist.h index a86f13398..bd5af11b0 100644 --- a/netlist.h +++ b/netlist.h @@ -4086,6 +4086,7 @@ class NetESignal : public NetExpr { virtual NetESignal* dup_expr() const; NetNet* synthesize(Design*des, NetScope*scope, NetExpr*root); NexusSet* nex_input(bool rem_out = true); + netenum_t*enumeration() const; virtual NetExpr*evaluate_function(const LineInfo&loc, std::map&ctx) const; @@ -4110,6 +4111,7 @@ class NetESignal : public NetExpr { private: NetNet*net_; + netenum_t*enum_type_; // Expression to select a word from the net. NetExpr*word_; };