From 5347217b56a38513253107407ca69193944ab7d4 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 10 Oct 2012 18:27:02 -0700 Subject: [PATCH] A signal can be an enumeration variable. An enumeration variable can be a R-value in an enumeration assignment so pass on this attribute. --- netlist.cc | 7 ++++++- netlist.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) 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_; };