can use in your FPGA and aims to provide a a free, portable and flexible
alternatve to vendor's solutions!
-LiteScope is part of LiteX libraries whose aims is to lower entry level of complex
+LiteScope is part of LiteX libraries whose aims are to lower entry level of complex
FPGA IP cores by providing simple, elegant and efficient implementations of
components used in today's SoC such as Ethernet, SATA, PCIe, SDRAM Controller...
from litescope.common import *
-class LiteScopeTerm(Module):
+class LiteScopeTermUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
sink.ack.eq(source.ack)
]
-class LiteScopeTermCSR(LiteScopeTerm, AutoCSR):
+class LiteScopeTerm(LiteScopeTermUnit, AutoCSR):
def __init__(self, dw):
- LiteScopeTerm.__init__(self, dw)
+ LiteScopeTermUnit.__init__(self, dw)
self._trig = CSRStorage(dw)
self._mask = CSRStorage(dw)
###
self.mask.eq(self._mask.storage)
]
-class LiteScopeRangeDetector(Module):
+class LiteScopeRangeDetectorUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
sink.ack.eq(source.ack)
]
-class LiteScopeRangeDetectorCSR(LiteScopeRangeDetector, AutoCSR):
+class LiteScopeRangeDetector(LiteScopeRangeDetectorUnit, AutoCSR):
def __init__(self, dw):
- LiteScopeRangeDetector.__init__(self, dw)
+ LiteScopeRangeDetectorUnit.__init__(self, dw)
self._low = CSRStorage(dw)
self._high = CSRStorage(dw)
###
self.high.eq(self._high.storage)
]
-class LiteScopeEdgeDetector(Module):
+class LiteScopeEdgeDetectorUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
source.hit.eq(rising | falling | both)
]
-class LiteScopeEdgeDetectorCSR(LiteScopeEdgeDetector, AutoCSR):
+class LiteScopeEdgeDetector(LiteScopeEdgeDetectorUnit, AutoCSR):
def __init__(self, dw):
- LiteScopeEdgeDetector.__init__(self, dw)
+ LiteScopeEdgeDetectorUnit.__init__(self, dw)
self._rising = CSRStorage(dw)
self._falling = CSRStorage(dw)
self._both = CSRStorage(dw)
from litescope.common import *
-class LiteScopeRunLengthEncoder(Module):
+class LiteScopeRunLengthEncoderUnit(Module):
def __init__(self, dw, length=1024):
self.dw = dw
self.length = length
)
)
-class LiteScopeRunLengthEncoderCSR(Module, AutoCSR):
- def __init__(self, rle):
- self.submodules += rle
+class LiteScopeRunLengthEncoder(LiteScopeRunLengthEncoderUnit, AutoCSR):
+ def __init__(self, dw, length=1024):
+ LiteScopeRunLengthEncoderUnit.__init__(self, dw, length)
self._enable = CSRStorage()
###
- self.comb += rle.enable.eq(self_enable.storage)
+ self.comb += self.enable.eq(self_enable.storage)
class LiteScopeRecorder(Module, AutoCSR):
def __init__(self, dw, depth):
from litescope.common import *
-class LiteScopeSum(Module, AutoCSR):
+class LiteScopeSumUnit(Module, AutoCSR):
def __init__(self, ports):
self.sinks = sinks = [Sink(hit_layout()) for i in range(ports)]
self.source = source = Source(hit_layout())
for i, sink in enumerate(sinks):
self.comb += sink.ack.eq(sink.stb & source.ack)
-class LiteScopeSumCSR(Module, AutoCSR):
+class LiteScopeSum(LiteScopeSumUnit, AutoCSR):
def __init__(self, ports):
- LiteScopeSum.__init__(self, ports)
+ LiteScopeSumUnit.__init__(self, ports)
self._prog_we = CSR()
self._prog_adr = CSRStorage(ports)
self._prog_dat = CSRStorage()
self.ports.append(port)
def do_finalize(self):
- self.submodules.sum = LiteScopeSumCSR(len(self.ports))
+ self.submodules.sum = LiteScopeSum(len(self.ports))
###
for i, port in enumerate(self.ports):
# Note: port's ack is not used and supposed to be always 1
# insert Buffer on sink (optional, can be used to improve timings)
if self.input_buffer:
self.submodules.buffer = Buffer(self.sink.description)
- self.comb += Record.connect(self.sink, self.buffer.sink)
- self.sink = self.buffer.source
+ self.comb += Record.connect(self.sink, self.buffer.d)
+ self.sink = self.buffer.q
# clock domain crossing (optional, required when capture_clk is not sys_clk)
# XXX : sys_clk must be faster than capture_clk, add Converter on data to remove this limitation
from litescope.bridge.uart2wb import LiteScopeUART2WB
from litescope.frontend.io import LiteScopeIO
from litescope.frontend.la import LiteScopeLA
-from litescope.core.port import LiteScopeTermCSR
+from litescope.core.port import LiteScopeTerm
class _CRG(Module):
def __init__(self, clk_in):
cnt1
)
self.submodules.la = LiteScopeLA(self.debug, 512)
- self.la.trigger.add_port(LiteScopeTermCSR(self.la.dw))
+ self.la.trigger.add_port(LiteScopeTerm(self.la.dw))
atexit.register(self.exit, platform)
def exit(self, platform):