from migen import *
+# Identifier ---------------------------------------------------------------------------------------
class Identifier(Module):
def __init__(self, ident):
from migen import *
from migen.genlib.cdc import MultiReg
+# PRBS Generators ----------------------------------------------------------------------------------
class PRBSGenerator(Module):
def __init__(self, n_out, n_state=23, taps=[17, 22]):
def __init__(self, n_out):
PRBSGenerator.__init__(self, n_out, n_state=31, taps=[27, 30])
+# PRBS TX ------------------------------------------------------------------------------------------
class PRBSTX(Module):
def __init__(self, width, reverse=False):
self.o.eq(prbs_data)
)
+# PRBS Checkers ------------------------------------------------------------------------------------
class PRBSChecker(Module):
def __init__(self, n_in, n_state=23, taps=[17, 22]):
def __init__(self, n_out):
PRBSChecker.__init__(self, n_out, n_state=31, taps=[27, 30])
+# PRBS RX ------------------------------------------------------------------------------------------
class PRBSRX(Module):
def __init__(self, width, reverse=False):
from litex.soc.interconnect.csr_eventmanager import *
from litex.soc.integration.doc import ModuleDoc
+# Timer --------------------------------------------------------------------------------------------
+
class Timer(Module, AutoCSR, ModuleDoc):
"""Timer
self._value = CSRStatus(width, description="""Latched countdown value""")
self.submodules.ev = EventManager()
- self.ev.zero = EventSourceProcess()
+ self.ev.zero = EventSourceProcess()
self.ev.finalize()
# # #
self.submodules.phy = RS232PHY(pads, clk_freq, baudrate)
WishboneStreamingBridge.__init__(self, self.phy, clk_freq)
+# UART Mutltiplexer --------------------------------------------------------------------------------
def UARTPads():
return Record([("tx", 1), ("rx", 1)])
from litex.soc.interconnect import stream
+# Layout/Helpers -----------------------------------------------------------------------------------
def phy_description(dw):
payload_layout = [("data", dw)]
module.comb += max_time.eq(0)
return en, max_time
+# FT245 Synchronous FIFO Mode ----------------------------------------------------------------------
class FT245PHYSynchronous(Module):
def __init__(self, pads, clk_freq,
)
]
+# FT245 Asynchronous FIFO Mode ---------------------------------------------------------------------
class FT245PHYAsynchronous(Module):
def __init__(self, pads, clk_freq,
t += clk_period_ns/2
return math.ceil(t/clk_period_ns)
+# FT245 FIFO Mode PHY (Automatic Asynchronous/Synchronous selection) -------------------------------
def FT245PHY(pads, *args, **kwargs):
# autodetect PHY
# Copyright 2014-2015 Robert Jordens <jordens@gmail.com>
+# License: BSD
from migen import *
from litex.soc.interconnect.csr import *
+# XADC ---------------------------------------------------------------------------------------------
class XADC(Module, AutoCSR):
def __init__(self):
# Alarms
self.alarm = Signal(8)
- self.ot = Signal()
+ self.ot = Signal()
# # #
- busy = Signal()
+ busy = Signal()
channel = Signal(7)
- eoc = Signal()
- eos = Signal()
- data = Signal(16)
- drdy = Signal()
+ eoc = Signal()
+ eos = Signal()
+ data = Signal(16)
+ drdy = Signal()
self.specials += Instance("XADC",
# from ug480
)
channels = {
- 0: self.temperature,
- 1: self.vccint,
- 2: self.vccaux,
- 6: self.vccbram
+ 0: self.temperature,
+ 1: self.vccint,
+ 2: self.vccaux,
+ 6: self.vccbram
}
self.sync += [