From: Sebastien Bourdeauducq Date: Wed, 7 Dec 2011 21:21:30 +0000 (+0100) Subject: fhdl: fix implicit slice index X-Git-Tag: 24jan2021_ls180~2099^2~1174 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fab02f84cbb9ee5d790023aeec4667261568bf87;p=litex.git fhdl: fix implicit slice index --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 16fa1ee8..4116c889 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -72,6 +72,8 @@ class Value: elif isinstance(key, slice): start = key.start or 0 stop = key.stop or self.bv.width + if stop > self.bv.width: + stop = self.bv.width if key.step != None: raise KeyError return Slice(self, start, stop)