24 lines
781 B
Python
24 lines
781 B
Python
|
from litesata.common import *
|
||
|
from litesata.phy.ctrl import *
|
||
|
from litesata.phy.datapath import *
|
||
|
|
||
|
class LiteSATAPHY(Module):
|
||
|
def __init__(self, device, pads, speed, clk_freq):
|
||
|
self.speed = speed
|
||
|
# Transceiver / Clocks
|
||
|
if device[:3] == "xc7": # Kintex 7
|
||
|
from litesata.phy.k7.trx import K7LiteSATAPHYTRX
|
||
|
from litesata.phy.k7.crg import K7LiteSATAPHYCRG
|
||
|
self.trx = K7LiteSATAPHYTRX(pads, speed)
|
||
|
self.crg = K7LiteSATAPHYCRG(pads, self.trx, speed, clk_freq)
|
||
|
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
|