diff --git a/cocotbext/axi/axi_master.py b/cocotbext/axi/axi_master.py index c298035..d9cf729 100644 --- a/cocotbext/axi/axi_master.py +++ b/cocotbext/axi/axi_master.py @@ -282,6 +282,9 @@ class AxiMasterWrite(Reset): if address < 0 or address >= 2**self.address_width: raise ValueError("Address out of range") + if isinstance(data, int): + raise ValueError("Expected bytes or bytearray for data") + if awid is None or awid < 0: awid = None elif awid > self.id_count: diff --git a/cocotbext/axi/axil_master.py b/cocotbext/axi/axil_master.py index b001963..2fbfa79 100644 --- a/cocotbext/axi/axil_master.py +++ b/cocotbext/axi/axil_master.py @@ -150,6 +150,9 @@ class AxiLiteMasterWrite(Reset): if address < 0 or address >= 2**self.address_width: raise ValueError("Address out of range") + if isinstance(data, int): + raise ValueError("Expected bytes or bytearray for data") + if not self.awprot_present and prot != AxiProt.NONSECURE: raise ValueError("awprot sideband signal value specified, but signal is not connected")