Commit 63746a35 authored by Matthieu Cattin's avatar Matthieu Cattin

fmc_adc: Use byte addresses for DDR read function.

parent 1b425081
......@@ -213,6 +213,7 @@ class CFmcAdc100m:
# Dump SDB records
def sdb_dump(self):
print("SDB address: 0x%x"%(self.adc_mezz_offset + self.SDB_ADDR))
......@@ -927,19 +928,20 @@ class CFmcAdc100m:
# DDR memory interface, FOR SVEC ONLY
# Read data from DDR
# carrier_addr and length are in 32-bit word
# carrier_addr and length are in bytes
def get_data(self, carrier_addr, length, raw=False):
ret = []
data = []
cc = self.bus.iwrite(0, self.DDR_ADR_ADDR, 4, carrier_addr)
cc = self.bus.iwrite(0, self.DDR_ADR_ADDR, 4, carrier_addr/4)
#print('[get_data] write: addr=0x%.8X cc=%d'%(self.DDR_ADR_ADDR, cc))
for i in range(length):
# length param is byte, but we're reading 32-bit words -> length/4
for i in range(length/4):
#adr_cnt_b = self.bus.iread(0, self.DDR_ADR_ADDR, 4)
data.append(self.bus.iread(0, self.DDR_DAT_ADDR, 4))
#print('[get_data] read: addr=0x%.9X i=%d'%(self.DDR_DAT_ADDR, i))
#adr_cnt = self.bus.iread(0, self.DDR_ADR_ADDR, 4)
#print('[get_data] address counter: before=0x%.8X after=0x%.8X'%(adr_cnt_b, adr_cnt))
for i in range(length):
for i in range(length/4):
ret.append(data[i] & 0xFFFF)
if raw:
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