litex/lib/sata/phy/k7sataphy/__init__.py

24 lines
875 B
Python
Raw Normal View History

from migen.fhdl.std import *
2014-11-11 10:15:28 -05:00
from lib.sata.std import *
from lib.sata.phy.k7sataphy.gtx import K7SATAPHYGTX
from lib.sata.phy.k7sataphy.crg import K7SATAPHYCRG
from lib.sata.phy.k7sataphy.ctrl import K7SATAPHYHostCtrl, K7SATAPHYDeviceCtrl
from lib.sata.phy.k7sataphy.datapath import K7SATAPHYDatapath
class K7SATAPHY(Module):
2014-09-29 12:25:24 -04:00
def __init__(self, pads, clk_freq, host=True, default_speed="SATA1"):
2014-09-27 10:10:39 -04:00
# GTX
2014-09-29 12:25:24 -04:00
self.submodules.gtx = K7SATAPHYGTX(pads, default_speed)
2014-09-27 10:10:39 -04:00
# CRG / CTRL
2014-09-29 12:25:24 -04:00
self.submodules.crg = K7SATAPHYCRG(pads, self.gtx, clk_freq, default_speed)
2014-09-27 10:10:39 -04:00
if host:
2014-09-29 12:25:24 -04:00
self.submodules.ctrl = K7SATAPHYHostCtrl(self.gtx, self.crg, clk_freq)
2014-09-27 10:10:39 -04:00
else:
2014-09-29 12:25:24 -04:00
self.submodules.ctrl = K7SATAPHYDeviceCtrl(self.gtx, self.crg, clk_freq)
2014-09-27 10:10:39 -04:00
# DATAPATH
2014-09-29 12:25:24 -04:00
self.submodules.datapath = K7SATAPHYDatapath(self.gtx, self.ctrl)
self.sink, self.source = self.datapath.sink, self.datapath.source