mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
flow/actor: add single_sink/single_source retrieval methods
This commit is contained in:
parent
f7cac15b34
commit
9228e8a96d
1 changed files with 10 additions and 0 deletions
|
@ -60,6 +60,16 @@ class Actor:
|
|||
|
||||
def sources(self):
|
||||
return self.filter_endpoints(Source)
|
||||
|
||||
def single_sink(self):
|
||||
eps = self.sinks()
|
||||
assert(len(eps) == 1)
|
||||
return eps[0]
|
||||
|
||||
def single_source(self):
|
||||
eps = self.sources()
|
||||
assert(len(eps) == 1)
|
||||
return eps[0]
|
||||
|
||||
def get_control_fragment(self):
|
||||
raise NotImplementedError("Actor classes must overload get_control_fragment or get_fragment")
|
||||
|
|
Loading…
Reference in a new issue