Permalink
Browse files

A signal can be an enumeration variable.

An enumeration variable can be a R-value in an enumeration assignment so
pass on this attribute.
  • Loading branch information...
1 parent f957dee commit 5347217b56a38513253107407ca69193944ab7d4 @caryr caryr committed Oct 11, 2012
Showing with 8 additions and 1 deletion.
  1. +6 −1 netlist.cc
  2. +2 −0 netlist.h
View
@@ -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_;
View
@@ -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<perm_string,NetExpr*>&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_;
};

0 comments on commit 5347217

Please sign in to comment.