mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
soc/integration: Improve error handling for framebuffer without sdram
This commit is contained in:
parent
e9f6fef3d4
commit
ccbfce920a
1 changed files with 9 additions and 2 deletions
|
@ -2367,10 +2367,14 @@ class LiteXSoC(SoC):
|
|||
size = 0x800000
|
||||
# If the intended region isn't contained in the main_ram region, adjust it to fit.
|
||||
main_ram_region = self.bus.regions.get("main_ram", None)
|
||||
if main_ram_region is not None and not (
|
||||
if main_ram_region is None:
|
||||
self.logger.error("Video framebuffer requires SDRAM")
|
||||
raise SoCError()
|
||||
contained_in_main_ram = (
|
||||
main_ram_region.origin < base
|
||||
and base + size < main_ram_region.origin + main_ram_region.size
|
||||
):
|
||||
)
|
||||
if not contained_in_main_ram:
|
||||
size = min(size, main_ram_region.size // 2)
|
||||
base = main_ram_region.origin + main_ram_region.size - size
|
||||
self.bus.add_region(name, SoCRegion(
|
||||
|
@ -2381,6 +2385,9 @@ class LiteXSoC(SoC):
|
|||
base = self.bus.regions[name].origin
|
||||
hres = int(timings.split("@")[0].split("x")[0])
|
||||
vres = int(timings.split("@")[0].split("x")[1])
|
||||
if not hasattr(self, "sdram"):
|
||||
self.logger.error("Video framebuffer requires SDRAM")
|
||||
raise SoCError()
|
||||
vfb = VideoFrameBuffer(self.sdram.crossbar.get_port(),
|
||||
hres = hres,
|
||||
vres = vres,
|
||||
|
|
Loading…
Reference in a new issue