3 Commits

Author SHA1 Message Date
Alex Forencich
af377b2c11 Release v0.1.24
Signed-off-by: Alex Forencich <alex@alexforencich.com>
2023-03-24 11:05:02 -07:00
Alex Forencich
cfb52c6130 Fix transfer length checks
Signed-off-by: Alex Forencich <alex@alexforencich.com>
2023-03-24 10:06:19 -07:00
Alex Forencich
7e32e584ff Bump to dev version
Signed-off-by: Alex Forencich <alex@alexforencich.com>
2023-03-24 01:57:09 -07:00
3 changed files with 16 additions and 7 deletions

View File

@@ -291,7 +291,7 @@ class AxiMasterWrite(Region, Reset):
if isinstance(data, int): if isinstance(data, int):
raise ValueError("Expected bytes or bytearray for data") raise ValueError("Expected bytes or bytearray for data")
if burst != AxiBurstType.FIXED and address+len(data) >= 2**self.address_width: if burst != AxiBurstType.FIXED and address+len(data) > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if awid is None or awid < 0: if awid is None or awid < 0:
@@ -360,7 +360,7 @@ class AxiMasterWrite(Region, Reset):
if isinstance(data, int): if isinstance(data, int):
raise ValueError("Expected bytes or bytearray for data") raise ValueError("Expected bytes or bytearray for data")
if burst != AxiBurstType.FIXED and address+len(data) >= 2**self.address_width: if burst != AxiBurstType.FIXED and address+len(data) > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if awid is None or awid < 0: if awid is None or awid < 0:
@@ -723,7 +723,7 @@ class AxiMasterRead(Region, Reset):
if length < 0: if length < 0:
raise ValueError("Read length must be positive") raise ValueError("Read length must be positive")
if burst != AxiBurstType.FIXED and address+length >= 2**self.address_width: if burst != AxiBurstType.FIXED and address+length > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if arid is None or arid < 0: if arid is None or arid < 0:
@@ -780,7 +780,7 @@ class AxiMasterRead(Region, Reset):
if length < 0: if length < 0:
raise ValueError("Read length must be positive") raise ValueError("Read length must be positive")
if burst != AxiBurstType.FIXED and address+length >= 2**self.address_width: if burst != AxiBurstType.FIXED and address+length > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if arid is None or arid < 0: if arid is None or arid < 0:

View File

@@ -159,6 +159,9 @@ class AxiLiteMasterWrite(Region, Reset):
if isinstance(data, int): if isinstance(data, int):
raise ValueError("Expected bytes or bytearray for data") raise ValueError("Expected bytes or bytearray for data")
if address+len(data) > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space")
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")
@@ -182,7 +185,7 @@ class AxiLiteMasterWrite(Region, Reset):
if isinstance(data, int): if isinstance(data, int):
raise ValueError("Expected bytes or bytearray for data") raise ValueError("Expected bytes or bytearray for data")
if address+len(data) >= 2**self.address_width: if address+len(data) > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if not self.awprot_present and prot != AxiProt.NONSECURE: if not self.awprot_present and prot != AxiProt.NONSECURE:
@@ -404,6 +407,12 @@ class AxiLiteMasterRead(Region, 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 length < 0:
raise ValueError("Read length must be positive")
if address+length > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space")
if not self.arprot_present and prot != AxiProt.NONSECURE: if not self.arprot_present and prot != AxiProt.NONSECURE:
raise ValueError("arprot sideband signal value specified, but signal is not connected") raise ValueError("arprot sideband signal value specified, but signal is not connected")
@@ -425,7 +434,7 @@ class AxiLiteMasterRead(Region, Reset):
if length < 0: if length < 0:
raise ValueError("Read length must be positive") raise ValueError("Read length must be positive")
if address+length >= 2**self.address_width: if address+length > 2**self.address_width:
raise ValueError("Requested transfer overruns end of address space") raise ValueError("Requested transfer overruns end of address space")
if not self.arprot_present and prot != AxiProt.NONSECURE: if not self.arprot_present and prot != AxiProt.NONSECURE:

View File

@@ -1 +1 @@
__version__ = "0.1.22" __version__ = "0.1.24"