Skip to content

Commit

Permalink
Merge pull request #259 from NicoPy/patch-9
Browse files Browse the repository at this point in the history
fixes signal assigment with .min .max and len()
  • Loading branch information
jandecaluwe committed Mar 28, 2018
2 parents a311468 + f5efd1e commit b7a02af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions myhdl/conversion/_toVHDL.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,10 @@ def getAttr(self, node):
self.write(suf)
if isinstance(obj, (_Signal, intbv)):
if node.attr in ('min', 'max'):
pre, suf = self.inferCast(node.vhd, node.vhdOri)
self.write(pre)
self.write("%s" % node.obj)
self.write(suf)
if isinstance(obj, EnumType):
assert hasattr(obj, node.attr)
e = getattr(obj, node.attr)
Expand Down Expand Up @@ -1040,7 +1043,10 @@ def visit_Call(self, node):
elif f is len:
val = self.getVal(node)
self.require(node, val is not None, "cannot calculate len")
pre, suf = self.inferCast(node.vhd, node.vhdOri)
self.write(pre)
self.write(repr(val))
self.write(suf)
return
elif f is now:
pre, suf = self.inferCast(node.vhd, node.vhdOri)
Expand Down

0 comments on commit b7a02af

Please sign in to comment.