merge litesata
[litex.git] / misoclib / mem / litesata / phy / __init__.py
1 from litesata.common import *
2 from litesata.phy.ctrl import *
3 from litesata.phy.datapath import *
4
5 class LiteSATAPHY(Module):
6 def __init__(self, device, pads, revision, clk_freq):
7 self.pads = pads
8 self.revision = revision
9 # Transceiver / Clocks
10 if device[:3] == "xc7": # Kintex 7
11 from litesata.phy.k7.trx import K7LiteSATAPHYTRX
12 from litesata.phy.k7.crg import K7LiteSATAPHYCRG
13 self.submodules.trx = K7LiteSATAPHYTRX(pads, revision)
14 self.submodules.crg = K7LiteSATAPHYCRG(pads, self.trx, revision, clk_freq)
15 else:
16 msg = "Device" + device + "not (yet) supported."
17 raise NotImplementedError(msg)
18
19 # Control
20 self.submodules.ctrl = LiteSATAPHYCtrl(self.trx, self.crg, clk_freq)
21
22 # Datapath
23 self.submodules.datapath = LiteSATAPHYDatapath(self.trx, self.ctrl)
24 self.sink, self.source = self.datapath.sink, self.datapath.source