Add write data type check
This commit is contained in:
@@ -282,6 +282,9 @@ class AxiMasterWrite(Reset):
|
|||||||
if address < 0 or address >= 2**self.address_width:
|
if address < 0 or address >= 2**self.address_width:
|
||||||
raise ValueError("Address out of range")
|
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:
|
if awid is None or awid < 0:
|
||||||
awid = None
|
awid = None
|
||||||
elif awid > self.id_count:
|
elif awid > self.id_count:
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ class AxiLiteMasterWrite(Reset):
|
|||||||
if address < 0 or address >= 2**self.address_width:
|
if address < 0 or address >= 2**self.address_width:
|
||||||
raise ValueError("Address out of range")
|
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:
|
if not self.awprot_present and prot != AxiProt.NONSECURE:
|
||||||
raise ValueError("awprot sideband signal value specified, but signal is not connected")
|
raise ValueError("awprot sideband signal value specified, but signal is not connected")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user