projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a83ad5
)
hdl.ast: allow slicing [n:n] into n-bit value.
author
whitequark
<cz@m-labs.hk>
Wed, 2 Jan 2019 18:14:57 +0000
(18:14 +0000)
committer
whitequark
<cz@m-labs.hk>
Wed, 2 Jan 2019 18:14:57 +0000
(18:14 +0000)
nmigen/hdl/ast.py
patch
|
blob
|
history
diff --git
a/nmigen/hdl/ast.py
b/nmigen/hdl/ast.py
index 9295ed441e3db0d3bda4aa5cafa4f5ebb9fa6eae..56c61ca8e2c830d0025749378438bcd789e4f54e 100644
(file)
--- a/
nmigen/hdl/ast.py
+++ b/
nmigen/hdl/ast.py
@@
-361,7
+361,7
@@
class Slice(Value):
raise TypeError("Slice end must be an integer, not '{!r}'".format(end))
n = len(value)
- if start not in range(-
n, n
):
+ if start not in range(-
(n+1), n+1
):
raise IndexError("Cannot start slice {} bits into {}-bit value".format(start, n))
if start < 0:
start += n