From 4f26621e2b82c62ae3b99e24b7fb5928b70a806c Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 27 Dec 2021 17:31:08 -0800 Subject: [PATCH] Make size optional when creating windows --- cocotbext/axi/address_space.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocotbext/axi/address_space.py b/cocotbext/axi/address_space.py index 2098c2c..4151da4 100644 --- a/cocotbext/axi/address_space.py +++ b/cocotbext/axi/address_space.py @@ -125,7 +125,9 @@ class MemoryInterface: async def write_qword(self, address, data, byteorder='little', **kwargs): await self.write_qwords(address, [data], byteorder, **kwargs) - def create_window(self, offset, size): + def create_window(self, offset, size=None): + if not size or size < 0: + size = self.size - offset self.check_range(offset, size) return Window(self, offset, size, base=self.get_absolute_address(offset))