From: whitequark Date: Thu, 28 Mar 2019 05:12:02 +0000 (+0000) Subject: back.rtlil: fix off-by-one in Part legalization. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8629917535d751100a67e1e8d6f251ac4a3db80;p=nmigen.git back.rtlil: fix off-by-one in Part legalization. Fixes #52. --- diff --git a/nmigen/back/rtlil.py b/nmigen/back/rtlil.py index 6fcd50b..b338491 100644 --- a/nmigen/back/rtlil.py +++ b/nmigen/back/rtlil.py @@ -571,7 +571,7 @@ class _LHSValueCompiler(_ValueCompiler): if isinstance(offset, ast.Const): return self(ast.Slice(value.value, offset.value, offset.value + value.width)) else: - raise LegalizeValue(value.offset, range((1 << len(value.offset)) - 1)) + raise LegalizeValue(value.offset, range((1 << len(value.offset)))) def on_Repl(self, value): raise TypeError # :nocov: