mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
common: clean up
This commit is contained in:
parent
f0f6183c9a
commit
fccf2c9430
1 changed files with 6 additions and 9 deletions
|
@ -266,16 +266,13 @@ class Timeout(Module):
|
||||||
###
|
###
|
||||||
value = Signal(max=length)
|
value = Signal(max=length)
|
||||||
self.sync += value.eq(value+1)
|
self.sync += value.eq(value+1)
|
||||||
self.comb += [
|
self.comb += self.reached.eq(value == length)
|
||||||
self.reached.eq(value == length)
|
|
||||||
]
|
|
||||||
|
|
||||||
# XXX use ModuleDecorator
|
|
||||||
class BufferizeEndpoints(Module):
|
class BufferizeEndpoints(Module):
|
||||||
def __init__(self, decorated, *args):
|
def __init__(self, submodule, *args):
|
||||||
self.decorated = decorated
|
self.submodule = submodule
|
||||||
|
|
||||||
endpoints = get_endpoints(decorated)
|
endpoints = get_endpoints(submodule)
|
||||||
sinks = {}
|
sinks = {}
|
||||||
sources = {}
|
sources = {}
|
||||||
for name, endpoint in endpoints.items():
|
for name, endpoint in endpoints.items():
|
||||||
|
@ -300,7 +297,7 @@ class BufferizeEndpoints(Module):
|
||||||
setattr(self, name, buf.q)
|
setattr(self, name, buf.q)
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.decorated, name)
|
return getattr(self.submodule, name)
|
||||||
|
|
||||||
def __dir__(self):
|
def __dir__(self):
|
||||||
return dir(self.decorated)
|
return dir(self.submodule)
|
||||||
|
|
Loading…
Reference in a new issue