litex/misoclib/mem/litesata/frontend/crossbar.py

28 lines
798 B
Python
Raw Normal View History

from misoclib.mem.litesata.common import *
from misoclib.mem.litesata.frontend.common import *
from misoclib.mem.litesata.frontend.arbiter import LiteSATAArbiter
2015-01-16 17:52:41 -05:00
2015-04-13 09:12:39 -04:00
2015-01-16 17:52:41 -05:00
class LiteSATACrossbar(Module):
def __init__(self, core):
self.users = []
self.master = LiteSATAMasterPort(32)
self.comb += [
self.master.source.connect(core.sink),
core.source.connect(self.master.sink)
]
2015-01-16 17:52:41 -05:00
def get_port(self):
port = LiteSATAUserPort(32)
self.users += [port]
return port
2015-01-16 17:52:41 -05:00
def get_ports(self, n):
ports = []
for i in range(n):
ports.append(self.get_port())
return ports
2015-01-16 17:52:41 -05:00
def do_finalize(self):
arbiter = LiteSATAArbiter(self.users, self.master)
self.submodules += arbiter