Commit f582ba4d authored by Matthieu Cattin's avatar Matthieu Cattin

common:gn4124: Add function to print all dma items for debug.

parent ccfcfda4
......@@ -204,6 +204,22 @@ class CGN4124:
self.wr_reg(self.HOST_BAR, self.HOST_DMA_ATTRIB + current_item_addr, attrib)
self.dma_item_cnt += 1
# Print all DMA items
def print_dma_items(self):
print("Host memory page addresses:")
for page in self.pages:
print("First item (in FPGA):")
for addr in range(0x0, 0x24, 0x4):
print("0x%02X: 0x%08X"%(addr, self.dma_csr.rd_reg(addr)))
print("Items in host memory:")
for item in range(self.PAGE_SIZE/0x20):
print("Item %d:"%item)
for addr in range(0x0, 0x20, 0x4):
print("0x%02X: 0x%08X"%(item*0x20 + addr, self.rd_reg(self.HOST_BAR, item*0x20 + addr)))
# Start DMA transfer
def start_dma(self):
self.dma_item_cnt = 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment