From: whitequark Date: Thu, 28 Mar 2019 05:12:02 +0000 (+0000) Subject: back.rtlil: fix off-by-one in Part legalization. X-Git-Tag: working~22 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a57c72d6066853eabfe02b66333279e263dc95e4;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: