mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
fhdl: fix implicit slice index
This commit is contained in:
parent
82f77180d5
commit
fab02f84cb
1 changed files with 2 additions and 0 deletions
|
@ -72,6 +72,8 @@ class Value:
|
||||||
elif isinstance(key, slice):
|
elif isinstance(key, slice):
|
||||||
start = key.start or 0
|
start = key.start or 0
|
||||||
stop = key.stop or self.bv.width
|
stop = key.stop or self.bv.width
|
||||||
|
if stop > self.bv.width:
|
||||||
|
stop = self.bv.width
|
||||||
if key.step != None:
|
if key.step != None:
|
||||||
raise KeyError
|
raise KeyError
|
||||||
return Slice(self, start, stop)
|
return Slice(self, start, stop)
|
||||||
|
|
Loading…
Reference in a new issue