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
|
|
|
|
|
|
|
class LiteSATAPHY(Module):
|
2015-01-19 11:52:05 -05:00
|
|
|
def __init__(self, device, pads, revision, clk_freq):
|
2015-01-19 12:40:32 -05:00
|
|
|
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
|
2015-02-28 04:53:51 -05:00
|
|
|
from misoclib.mem.litesata.phy.k7.trx import K7LiteSATAPHYTRX
|
|
|
|
from misoclib.mem.litesata.phy.k7.crg import K7LiteSATAPHYCRG
|
2015-01-22 10:02:41 -05:00
|
|
|
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
|
2015-01-22 10:02:41 -05:00
|
|
|
self.submodules.ctrl = LiteSATAPHYCtrl(self.trx, self.crg, clk_freq)
|
2015-01-16 17:52:41 -05:00
|
|
|
|
|
|
|
# Datapath
|
2015-01-22 10:02:41 -05:00
|
|
|
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
|