From d394b137773f5447170ec9bf696a09830800a0e4 Mon Sep 17 00:00:00 2001 From: Anderson Ignacio Date: Wed, 15 Nov 2023 12:50:08 +0000 Subject: [PATCH] Moved from setimmediatevalue to normal assign on but init Signed-off-by: Anderson Ignacio --- cocotbext/ahb/ahb_master.py | 27 ++++++++++++++++++--------- cocotbext/ahb/version.py | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/cocotbext/ahb/ahb_master.py b/cocotbext/ahb/ahb_master.py index e719da6..3716330 100644 --- a/cocotbext/ahb/ahb_master.py +++ b/cocotbext/ahb/ahb_master.py @@ -4,7 +4,7 @@ # License : MIT license # Author : Anderson I. da Silva (aignacio) # Date : 08.10.2023 -# Last Modified Date: 14.11.2023 +# Last Modified Date: 15.11.2023 import cocotb import logging @@ -52,7 +52,10 @@ def _init_bus(self) -> None: sig = getattr(self.bus, signal) try: default_value = self._get_def(len(sig)) - sig.setimmediatevalue(default_value) + sig.value = default_value + # setimmediatevalue seems to not work with some designs + # decided to move to normal assign + # sig.setimmediatevalue(default_value) except AttributeError: pass @@ -141,7 +144,7 @@ async def _send_txn( mode: Sequence[AHBWrite], trans: Sequence[AHBTrans], pip: bool = False, - sync: bool = True + sync: bool = False, ) -> Sequence[dict]: """Drives the AHB transaction into the bus.""" response = [] @@ -249,7 +252,7 @@ async def write( value: Union[int, Sequence[int]], size: Optional[Union[int, Sequence[int]]] = None, pip: Optional[bool] = False, - sync: Optional[bool] = True + sync: Optional[bool] = False, ) -> Sequence[dict]: """Write data in the AHB bus.""" @@ -301,14 +304,16 @@ async def write( width = len(self.bus.htrans) t_trans = self._create_vector(t_trans, width, "address_ph", pip) - return await self._send_txn(t_address, t_value, t_size, t_mode, t_trans, pip, sync) + return await self._send_txn( + t_address, t_value, t_size, t_mode, t_trans, pip, sync + ) async def read( self, address: Union[int, Sequence[int]], size: Optional[Union[int, Sequence[int]]] = None, pip: Optional[bool] = False, - sync: Optional[bool] = True + sync: Optional[bool] = False, ) -> Sequence[dict]: """Read data from the AHB bus.""" @@ -351,7 +356,9 @@ async def read( width = len(self.bus.htrans) t_trans = self._create_vector(t_trans, width, "address_ph", pip) - return await self._send_txn(t_address, t_value, t_size, t_mode, t_trans, pip, sync) + return await self._send_txn( + t_address, t_value, t_size, t_mode, t_trans, pip, sync + ) async def custom( self, @@ -360,7 +367,7 @@ async def custom( mode: Union[int, Sequence[int]], size: Optional[Union[int, Sequence[int]]] = None, pip: Optional[bool] = True, - sync: Optional[bool] = True + sync: Optional[bool] = False, ) -> Sequence[dict]: """Back-to-Back operation""" @@ -410,7 +417,9 @@ async def custom( width = len(self.bus.htrans) t_trans = self._create_vector(t_trans, width, "address_ph", pip) - return await self._send_txn(t_address, t_value, t_size, t_mode, t_trans, pip, sync) + return await self._send_txn( + t_address, t_value, t_size, t_mode, t_trans, pip, sync + ) class AHBMaster(AHBLiteMaster): diff --git a/cocotbext/ahb/version.py b/cocotbext/ahb/version.py index b5fdc75..d31c31e 100644 --- a/cocotbext/ahb/version.py +++ b/cocotbext/ahb/version.py @@ -1 +1 @@ -__version__ = "0.2.2" +__version__ = "0.2.3"