From f8629917535d751100a67e1e8d6f251ac4a3db80 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 28 Mar 2019 05:12:02 +0000 Subject: [PATCH] back.rtlil: fix off-by-one in Part legalization. Fixes #52. --- nmigen/back/rtlil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.30.2