-
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.
Removed BinaryValue for cocotb compatibility
Signed-off-by: Anderson Ignacio da Silva <[email protected]>
- Loading branch information
Showing
3 changed files
with
6 additions
and
9 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 : 08.10.2023 | ||
# Last Modified Date: 03.09.2024 | ||
# Last Modified Date: 01.10.2024 | ||
|
||
import logging | ||
import cocotb | ||
|
@@ -18,7 +18,6 @@ | |
from cocotb.triggers import RisingEdge | ||
from typing import Optional, Sequence, Union, List | ||
from cocotb.types import LogicArray | ||
from cocotb.binary import BinaryValue | ||
|
||
|
||
class AHBLiteMaster: | ||
|
@@ -68,7 +67,7 @@ def _reset_bus(self) -> None: | |
except AttributeError: | ||
pass | ||
|
||
def _get_def(self, width: int = 1) -> BinaryValue: | ||
def _get_def(self, width: int = 1) -> LogicArray: | ||
"""Return a handle obj with the default value""" | ||
return LogicArray([self.def_val for _ in range(width)]) | ||
|
||
|
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 : 27.10.2023 | ||
# Last Modified Date: 09.09.2024 | ||
# Last Modified Date: 01.10.2024 | ||
import cocotb | ||
import logging | ||
import random | ||
|
@@ -19,7 +19,6 @@ | |
from cocotb.triggers import RisingEdge, FallingEdge | ||
from cocotb.handle import SimHandleBase | ||
from cocotb.types import LogicArray | ||
from cocotb.binary import BinaryValue | ||
from cocotb_bus.monitors import Monitor | ||
from typing import Optional, Union, Generator, List, Any | ||
from .memory import Memory | ||
|
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.09.2024 | ||
# Last Modified Date: 01.10.2024 | ||
|
||
import cocotb | ||
import logging | ||
|
@@ -18,7 +18,6 @@ | |
|
||
from cocotb.triggers import RisingEdge | ||
from cocotb.types import LogicArray | ||
from cocotb.binary import BinaryValue | ||
from typing import Optional, Union, Generator, List | ||
from .memory import Memory | ||
|
||
|
@@ -58,7 +57,7 @@ def _init_bus(self) -> None: | |
self.bus.hresp.setimmediatevalue(AHBResp.OKAY) | ||
self.bus.hrdata.setimmediatevalue(0) | ||
|
||
def _get_def(self, width: int = 1) -> BinaryValue: | ||
def _get_def(self, width: int = 1) -> LogicArray: | ||
"""Return a handle obj with the default value""" | ||
return LogicArray([self.def_val for _ in range(width)]) | ||
|
||
|
@@ -273,7 +272,7 @@ def _rd(self, addr: int, size: AHBSize) -> int: | |
data = int.from_bytes(data, byteorder="little") | ||
return data | ||
|
||
def _wr(self, addr: int, size: AHBSize, value: BinaryValue) -> int: | ||
def _wr(self, addr: int, size: AHBSize, value: LogicArray) -> int: | ||
if size == AHBSize.BYTE: | ||
# Mask the data to a single byte | ||
data = value.integer & 0xFF | ||
|