From 5a2bcafbbe1b3d3eedf9595f2968687bb0f16ff7 Mon Sep 17 00:00:00 2001 From: Anderson Ignacio da Silva Date: Thu, 26 Dec 2024 17:27:32 +0000 Subject: [PATCH] Fixed lint error and updated version Signed-off-by: Anderson Ignacio da Silva --- cocotbext/ahb/ahb_slave.py | 5 +++-- cocotbext/ahb/version.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocotbext/ahb/ahb_slave.py b/cocotbext/ahb/ahb_slave.py index 6c40c95..5b0841d 100644 --- a/cocotbext/ahb/ahb_slave.py +++ b/cocotbext/ahb/ahb_slave.py @@ -4,7 +4,7 @@ # License : MIT license # Author : Anderson I. da Silva (aignacio) # Date : 16.10.2023 -# Last Modified Date: 01.10.2024 +# Last Modified Date: 26.12.2024 import cocotb import logging @@ -258,9 +258,10 @@ def _chk_wr(self, addr: int, size: AHBSize) -> bool: def _get_addr_aligned(self, addr: int) -> int: def calc_addr_mask(addr_width: int, data_width: int) -> int: import math + clog2 = lambda x: math.ceil(math.log2(x)) return ((1 << addr_width) - 1) - ((1 << clog2(data_width / 8)) - 1) - + return calc_addr_mask(self.bus._addr_width, self.bus._data_width) & addr def _rd(self, addr: int, size: AHBSize) -> int: diff --git a/cocotbext/ahb/version.py b/cocotbext/ahb/version.py index 98a433b..3dd3d2d 100644 --- a/cocotbext/ahb/version.py +++ b/cocotbext/ahb/version.py @@ -1 +1 @@ -__version__ = "0.4.5" +__version__ = "0.4.6"