cores/video: Add fifo_depth parameter to add_video_framebuffer and use new KILOBYTE to define depth.

This commit is contained in:
Florent Kermarrec 2024-06-13 12:59:09 +02:00
parent 491974c719
commit 3fa3532f16
2 changed files with 7 additions and 6 deletions

View File

@ -646,7 +646,7 @@ class VideoTerminal(LiteXModule):
class VideoFrameBuffer(LiteXModule):
"""Video FrameBuffer"""
def __init__(self, dram_port, hres=800, vres=600, base=0x00000000, fifo_depth=65536, clock_domain="sys", clock_faster_than_sys=False, format="rgb888"):
def __init__(self, dram_port, hres=800, vres=600, base=0x00000000, fifo_depth=64*KILOBYTE, clock_domain="sys", clock_faster_than_sys=False, format="rgb888"):
self.vtg_sink = vtg_sink = stream.Endpoint(video_timing_layout)
self.source = source = stream.Endpoint(video_data_layout)
self.underflow = Signal()

View File

@ -2375,7 +2375,7 @@ class LiteXSoC(SoC):
self.comb += vt.source.connect(phy if isinstance(phy, stream.Endpoint) else phy.sink)
# Add Video Framebuffer ------------------------------------------------------------------------
def add_video_framebuffer(self, name="video_framebuffer", phy=None, timings="800x600@60Hz", clock_domain="sys", format="rgb888"):
def add_video_framebuffer(self, name="video_framebuffer", phy=None, timings="800x600@60Hz", clock_domain="sys", format="rgb888", fifo_depth=64*KILOBYTE):
# Imports.
from litex.soc.cores.video import VideoTimingGenerator, VideoFrameBuffer
@ -2397,10 +2397,11 @@ class LiteXSoC(SoC):
hres = int(timings.split("@")[0].split("x")[0])
vres = int(timings.split("@")[0].split("x")[1])
vfb = VideoFrameBuffer(self.sdram.crossbar.get_port(),
hres = hres,
vres = vres,
base = base,
format = format,
hres = hres,
vres = vres,
base = base,
fifo_depth = fifo_depth,
format = format,
clock_domain = clock_domain,
clock_faster_than_sys = vtg.video_timings["pix_clk"] >= self.sys_clk_freq,
)