litex/litesata/phy/__init__.py

25 lines
815 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
2015-01-19 11:52:05 -05:00
self.trx = K7LiteSATAPHYTRX(pads, revision)
self.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.ctrl = LiteSATAPHYCtrl(self.trx, self.crg, clk_freq)
# Datapath
self.datapath = LiteSATAPHYDatapath(self.trx, self.ctrl)
self.sink, self.source = self.datapath.sink, self.datapath.source