Add write data type check

This commit is contained in:
Alex Forencich
2021-11-10 23:49:13 -08:00
parent 6329187ced
commit 34498f6e5d
2 changed files with 6 additions and 0 deletions

View File

@@ -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: