From: whitequark Date: Wed, 2 Jan 2019 18:14:29 +0000 (+0000) Subject: back.rtlil: translate empty slices correctly. X-Git-Tag: working~98 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef1e0b8d55fd5c957ee9c64518359d8ad8d6b5ce;p=nmigen.git back.rtlil: translate empty slices correctly. --- diff --git a/nmigen/back/rtlil.py b/nmigen/back/rtlil.py index 85856f8..8982f23 100644 --- a/nmigen/back/rtlil.py +++ b/nmigen/back/rtlil.py @@ -319,7 +319,9 @@ class _ValueCompiler(xfrm.ValueVisitor): return self(value.value) sigspec = self._prepare_value_for_Slice(value.value) - if value.start + 1 == value.end: + if value.start == value.end: + return "{}" + elif value.start + 1 == value.end: return "{} [{}]".format(sigspec, value.start) else: return "{} [{}:{}]".format(sigspec, value.end - 1, value.start)