A signal can be an enumeration variable.

An enumeration variable can be a R-value in an enumeration assignment so
pass on this attribute.
This commit is contained in:
Cary R 2012-10-10 18:27:02 -07:00
parent f957deeca7
commit 5347217b56
2 changed files with 8 additions and 1 deletions

View File

@ -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 File

@ -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_;
};