litex/misoclib/mem/litesata/phy/__init__.py

25 lines
859 B
Python
Raw Normal View History

2015-01-16 17:52:41 -05:00
from litesata.common import *
from litesata.phy.ctrl import *
from litesata.phy.datapath import *
class LiteSATAPHY(Module):
2015-01-19 11:52:05 -05:00
def __init__(self, device, pads, revision, clk_freq):
self.pads = pads
2015-01-19 11:52:05 -05:00
self.revision = revision
2015-01-16 17:52:41 -05:00
# Transceiver / Clocks
if device[:3] == "xc7": # Kintex 7
from litesata.phy.k7.trx import K7LiteSATAPHYTRX
from litesata.phy.k7.crg import K7LiteSATAPHYCRG
self.submodules.trx = K7LiteSATAPHYTRX(pads, revision)
self.submodules.crg = K7LiteSATAPHYCRG(pads, self.trx, revision, clk_freq)
2015-01-16 17:52:41 -05:00
else:
msg = "Device" + device + "not (yet) supported."
raise NotImplementedError(msg)
# Control
self.submodules.ctrl = LiteSATAPHYCtrl(self.trx, self.crg, clk_freq)
2015-01-16 17:52:41 -05:00
# Datapath
self.submodules.datapath = LiteSATAPHYDatapath(self.trx, self.ctrl)
2015-01-16 17:52:41 -05:00
self.sink, self.source = self.datapath.sink, self.datapath.source