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

@@ -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")