Home of the
A subclass of numpy.ndarray which is allocated using physically contiguous memory for use with DMA engines and hardware accelerators. As physically contiguous memory is a limited resource it is strongly recommended to free the underlying buffer with close when the buffer is no longer needed. Alternatively a with statement can be used to automatically free the memory at the end of the scope.
This class should not be constructed directly and instead created using pynq.allocate().
The physical address to the array
Whether the buffer is coherent
Unused - for backwards compatibility only
Flush the underlying memory if necessary
Free the underlying memory
This will free the memory regardless of whether other objects may still be using the buffer so ensure that no other references to the array exist prior to freeing.
Invalidate the underlying memory if necessary
Copy the contents of the device buffer into the mirrored host buffer
Copy the contents of the host buffer into the mirrored device buffer
allocate(shape, dtype='u4', target=None, **kwargs)¶
Allocate a PYNQ buffer
This API mimics the numpy ndarray constructor with the following differences:
- The default dtype is 32-bit unsigned int rather than float
- A new
targetkeyword parameter to determine where the buffer should be allocated
The target determines where the buffer gets allocated
- If None then the currently active device is used
- If a Device is specified then the main memory