Skip to content

Commit

Permalink
Signal.like(): inherit more properties from other
Browse files Browse the repository at this point in the history
jordens committed Jun 28, 2017
1 parent 5ccee6c commit e90aa1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion migen/fhdl/structure.py
Original file line number Diff line number Diff line change
@@ -383,7 +383,11 @@ def like(cls, other, **kwargs):
See `migen.fhdl.bitcontainer.value_bits_sign` for details.
"""
from migen.fhdl.bitcontainer import value_bits_sign
return cls(bits_sign=value_bits_sign(other), **kwargs)
kw = dict(bits_sign=value_bits_sign(other), variable=other.variable,
reset=other.reset, reset_less=other.reset_less,
related=other.related, attr=set(other.attr))
kw.update(kwargs)
return cls(**kwargs)

def __hash__(self):
return self.duid

0 comments on commit e90aa1e

Please sign in to comment.