core: use new CSRStatus.we signal to speed-up Storage upload (>10x speedup over ethernet)

This commit is contained in:
Florent Kermarrec 2019-09-24 18:03:06 +02:00
parent 284253d558
commit 7a9fa9d3b1
2 changed files with 4 additions and 4 deletions

View File

@ -147,8 +147,7 @@ class _Storage(Module, AutoCSR):
self.offset = CSRStorage(bits_for(depth)) self.offset = CSRStorage(bits_for(depth))
self.mem_valid = CSRStatus() self.mem_valid = CSRStatus()
self.mem_ready = CSR() self.mem_data = CSRStatus(data_width)
self.mem_data = CSRStatus(data_width)
# # # # # #
@ -223,7 +222,7 @@ class _Storage(Module, AutoCSR):
# memory read # memory read
self.comb += [ self.comb += [
self.mem_valid.status.eq(cdc.source.valid), self.mem_valid.status.eq(cdc.source.valid),
cdc.source.ready.eq(self.mem_ready.re | ~self.enable.storage), cdc.source.ready.eq(self.mem_data.we | ~self.enable.storage),
self.mem_data.status.eq(cdc.source.data) self.mem_data.status.eq(cdc.source.data)
] ]

View File

@ -125,8 +125,9 @@ class LiteScopeAnalyzerDriver:
' ' * (20-20*position//length), ' ' * (20-20*position//length),
100*position//length)) 100*position//length))
sys.stdout.flush() sys.stdout.flush()
if not self.storage_mem_valid.read():
break
self.data.append(self.storage_mem_data.read()) self.data.append(self.storage_mem_data.read())
self.storage_mem_ready.write(1)
if self.debug: if self.debug:
print("") print("")
return self.data return self.data