Skip to content

Commit

Permalink
Fixed lint error and updated version
Browse files Browse the repository at this point in the history
Signed-off-by: Anderson Ignacio da Silva <anderson@aignacio.com>
  • Loading branch information
aignacio committed Dec 26, 2024
1 parent dcc98de commit 5a2bcaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cocotbext/ahb/ahb_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License : MIT license <Check LICENSE>
# Author : Anderson I. da Silva (aignacio) <anderson@aignacio.com>
# Date : 16.10.2023
# Last Modified Date: 01.10.2024
# Last Modified Date: 26.12.2024

import cocotb
import logging
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cocotbext/ahb/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.5"
__version__ = "0.4.6"

0 comments on commit 5a2bcaf

Please sign in to comment.