From 0bbad73760ee5d3b31644221d49e25c70c31baba Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 1 Dec 2020 18:01:34 -0800 Subject: [PATCH] Sanity check on read length --- cocotbext/axi/axi_master.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocotbext/axi/axi_master.py b/cocotbext/axi/axi_master.py index 89b9b84..054c8b5 100644 --- a/cocotbext/axi/axi_master.py +++ b/cocotbext/axi/axi_master.py @@ -442,6 +442,9 @@ class AxiMasterRead(object): raise Exception("Token is not unique") self.active_tokens.add(token) + if length < 0: + raise ValueError("Read length must be positive") + if arid is None or arid < 0: arid = None elif arid > self.id_count: