2015-02-28 04:53:51 -05:00
|
|
|
from misoclib.mem.litesata.common import *
|
|
|
|
from misoclib.mem.litesata.phy.ctrl import *
|
|
|
|
from misoclib.mem.litesata.phy.datapath import *
|
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 LiteSATAPHY(Module):
|
2015-04-13 08:55:26 -04:00
|
|
|
def __init__(self, device, pads, revision, clk_freq):
|
|
|
|
self.pads = pads
|
|
|
|
self.revision = revision
|
2015-05-05 19:33:02 -04:00
|
|
|
|
2015-04-13 08:55:26 -04:00
|
|
|
# Transceiver / Clocks
|
|
|
|
if device[:3] == "xc7": # Kintex 7
|
|
|
|
from misoclib.mem.litesata.phy.k7.trx import K7LiteSATAPHYTRX
|
|
|
|
from misoclib.mem.litesata.phy.k7.crg import K7LiteSATAPHYCRG
|
|
|
|
self.submodules.trx = K7LiteSATAPHYTRX(pads, revision)
|
|
|
|
self.submodules.crg = K7LiteSATAPHYCRG(pads, self.trx, revision, clk_freq)
|
|
|
|
else:
|
2015-05-05 19:33:02 -04:00
|
|
|
raise NotImplementedError
|
2015-01-16 17:52:41 -05:00
|
|
|
|
2015-04-13 08:55:26 -04:00
|
|
|
# Control
|
|
|
|
self.submodules.ctrl = LiteSATAPHYCtrl(self.trx, self.crg, clk_freq)
|
2015-01-16 17:52:41 -05:00
|
|
|
|
2015-04-13 08:55:26 -04:00
|
|
|
# Datapath
|
|
|
|
self.submodules.datapath = LiteSATAPHYDatapath(self.trx, self.ctrl)
|
|
|
|
self.sink, self.source = self.datapath.sink, self.datapath.source
|