Auto calc safe max depth for Litescope Analyzer

Avoids failed compilations and manually hunting for usable, valid depth
This commit is contained in:
Aadi Desai 2023-05-18 16:21:45 +01:00
parent c4469cd6f6
commit 8dbcd18269
No known key found for this signature in database

15
make.py
View file

@ -242,21 +242,24 @@ class BaseSoC(SoCCore):
from litescope import LiteScopeAnalyzer from litescope import LiteScopeAnalyzer
analyzer_signals = [ analyzer_signals = [
self.audio.targ0.re, self.audio.targ0.re,
self.audio.targ0.storage, # self.audio.targ0.storage,
# self.audio.backpressure_48, self.audio.wave0.re,
# self.audio.wave0.storage,
self.audio.backpressure_48,
# self.audio.sample_48, # self.audio.sample_48,
# self.audio.audioready_48, self.audio.audioready_48,
self.audio.readrequest_36, self.audio.readrequest_36,
self.audio.sample_36, # self.audio.sample_36,
self.audio.fifoempty_36, self.audio.fifoempty_36,
self.audio.dac_lrck, self.audio.dac_lrck,
self.audio.dac_bck, self.audio.dac_bck,
self.audio.dac_data, self.audio.dac_data,
] ]
from math import ceil, floor
analyzer_depth = floor(190_000 / ((ceil(sum([s.nbits for s in analyzer_signals]) / 16)) * 16))
self.submodules.analyzer = LiteScopeAnalyzer( self.submodules.analyzer = LiteScopeAnalyzer(
analyzer_signals, analyzer_signals,
# depth = 23000, depth = analyzer_depth,
depth = 3072,
clock_domain = "dac", clock_domain = "dac",
samplerate = 36.92e6, # Actual clock frequency of DAC clock domain samplerate = 36.92e6, # Actual clock frequency of DAC clock domain
csr_csv = "analyzer.csv", csr_csv = "analyzer.csv",