Merge pull request #30 from antmicro/jboc/registered-inputs

litescope/core: add option to register input signals to cut timings
This commit is contained in:
enjoy-digital 2021-08-25 13:23:59 +02:00 committed by GitHub
commit 1596bff127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -226,7 +226,7 @@ class _Storage(Module, AutoCSR):
class LiteScopeAnalyzer(Module, AutoCSR): class LiteScopeAnalyzer(Module, AutoCSR):
def __init__(self, groups, depth, clock_domain="sys", trigger_depth=16, csr_csv="analyzer.csv"): def __init__(self, groups, depth, clock_domain="sys", trigger_depth=16, register=0, csr_csv="analyzer.csv"):
self.groups = groups = self.format_groups(groups) self.groups = groups = self.format_groups(groups)
self.depth = depth self.depth = depth
@ -242,10 +242,16 @@ class LiteScopeAnalyzer(Module, AutoCSR):
# Mux # Mux
self.submodules.mux = _Mux(data_width, len(groups)) self.submodules.mux = _Mux(data_width, len(groups))
sd = getattr(self.sync, clock_domain)
for i, signals in groups.items(): for i, signals in groups.items():
s = Cat(signals)
for _ in range(register):
s_d = Signal(len(s))
sd += s_d.eq(s)
s = s_d
self.comb += [ self.comb += [
self.mux.sinks[i].valid.eq(1), self.mux.sinks[i].valid.eq(1),
self.mux.sinks[i].data.eq(Cat(signals)) self.mux.sinks[i].data.eq(s)
] ]
# Frontend # Frontend