From de76c4864de743a90db8db868ee45f441f856b94 Mon Sep 17 00:00:00 2001 From: darius Date: Fri, 12 Oct 2018 16:47:01 -0700 Subject: [PATCH 1/2] fix: tested the wrong variable --- rattle/rattle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rattle/rattle.py b/rattle/rattle.py index 4470b83..f63d0e8 100644 --- a/rattle/rattle.py +++ b/rattle/rattle.py @@ -402,8 +402,8 @@ def make_memoized_slice_node(operand, start, stop): raise TypeError("Slice start must be greater than slice stop") if stop < 0: raise TypeError("Slice start must be nonnegative") - if start > operand.type.width: - raise TypeError("Slice stop must be less than operand width") + if stop > operand.type.width: + raise TypeError("Slice stop must be less than or equal to operand width") if isinstance(operand, SliceNode): return make_memoized_slice_node(operand.operand, start + operand.start, stop + operand.start) return SliceNode(operand, start, stop) From e1fe8ee5af3078633b92a8cc85194a5a510cca6c Mon Sep 17 00:00:00 2001 From: darius Date: Fri, 12 Oct 2018 16:47:47 -0700 Subject: [PATCH 2/2] fix: neglected to pass the enable parameter --- rattle/rattle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rattle/rattle.py b/rattle/rattle.py index f63d0e8..65d2cce 100644 --- a/rattle/rattle.py +++ b/rattle/rattle.py @@ -479,7 +479,7 @@ def enable(self, node): self._enable = node def register(type, init=None, next=None, enable=None): - return RegisterNode(type, init, next, enable=None) + return RegisterNode(type, init, next, enable) class ConstantNode(Node): def __init__(self, type, value):