-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed hready beh. of AHB slave to match AMBA ARM spec
Signed-off-by: Anderson Ignacio da Silva <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# License : MIT license <Check LICENSE> | ||
# Author : Anderson I. da Silva (aignacio) <[email protected]> | ||
# Date : 16.10.2023 | ||
# Last Modified Date: 09.06.2024 | ||
# Last Modified Date: 09.09.2024 | ||
|
||
import cocotb | ||
import logging | ||
|
@@ -45,7 +45,9 @@ def __init__( | |
self._init_bus() | ||
self.log.info(f"AHB ({name}) slave") | ||
self.log.info("cocotbext-ahb version %s", __version__) | ||
self.log.info(f"Copyright (c) {datetime.datetime.now().year} Anderson Ignacio da Silva") | ||
self.log.info( | ||
f"Copyright (c) {datetime.datetime.now().year} Anderson Ignacio da Silva" | ||
) | ||
self.log.info("https://github.com/aignacio/cocotbext-ahb") | ||
|
||
cocotb.start_soon(self._proc_txn()) | ||
|
@@ -88,10 +90,24 @@ async def _proc_txn(self): | |
self.bus.hresp.value = AHBResp.OKAY | ||
|
||
if self.bp is not None: | ||
ready = next(self.bp) | ||
if self.bus.hsel_exist and self.bus.hsel.value.is_resolvable: | ||
if self.bus.hsel.value == 0: | ||
ready = True | ||
else: | ||
ready = next(self.bp) | ||
else: | ||
ready = next(self.bp) | ||
|
||
if rd_start is False and wr_start is False: | ||
ready = True # slave cannot bp on address phase | ||
|
||
else: | ||
ready = True | ||
|
||
if self.rst.value.is_resolvable: | ||
if self.rst.value == 0: # Active 0 | ||
ready = True | ||
|
||
if ready: | ||
self.bus.hready.value = 1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.4" | ||
__version__ = "0.3.5" |