From e280bff1ec196bdb408eaf1d44d6b06d9c6e85eb Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 5 Mar 2021 14:40:27 +0100 Subject: [PATCH] targets/video: Simplify/Cleanup integration. --- litex_boards/targets/icebreaker.py | 2 +- litex_boards/targets/nexys4ddr.py | 21 ++++++++++----------- litex_boards/targets/nexys_video.py | 19 +++++++++---------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/litex_boards/targets/icebreaker.py b/litex_boards/targets/icebreaker.py index 3ac1645..0051435 100755 --- a/litex_boards/targets/icebreaker.py +++ b/litex_boards/targets/icebreaker.py @@ -104,7 +104,7 @@ class BaseSoC(SoCCore): linker = True) ) - # Video Terminal --------------------------------------------------------------------------- + # Video ------------------------------------------------------------------------------------ if with_video_terminal: platform.add_extension(icebreaker.dvi_pmod) self.submodules.videophy = VideoDVIPHY(platform.request("dvi"), clock_domain="sys") diff --git a/litex_boards/targets/nexys4ddr.py b/litex_boards/targets/nexys4ddr.py index cdc36f5..487e4b1 100755 --- a/litex_boards/targets/nexys4ddr.py +++ b/litex_boards/targets/nexys4ddr.py @@ -18,7 +18,7 @@ from litex.soc.integration.soc import SoCRegion from litex.soc.integration.soc_core import * from litex.soc.integration.soc_sdram import * from litex.soc.integration.builder import * -from litex.soc.cores.video import VideoVGAPHY, VideoTimingGenerator, VideoFrameBuffer +from litex.soc.cores.video import VideoVGAPHY from litex.soc.cores.led import LedChaser from litedram.modules import MT47H64M16 @@ -95,15 +95,13 @@ class BaseSoC(SoCCore): if with_etherbone: self.add_etherbone(phy=self.ethphy) - # Video Terminal --------------------------------------------------------------------------- - if with_video_terminal: + # Video ------------------------------------------------------------------------------------ + if with_video_terminal or with_video_framebuffer: self.submodules.videophy = VideoVGAPHY(platform.request("vga"), clock_domain="vga") - self.add_video_terminal(phy=self.videophy, timings="800x600@60Hz", clock_domain="vga") - - # Video Framebuffer ------------------------------------------------------------------------ - if with_video_framebuffer: - self.submodules.videophy = VideoVGAPHY(platform.request("vga"), clock_domain="vga") - self.add_video_framebuffer(phy=self.videophy, timings="800x600@60Hz", clock_domain="vga") + if with_video_terminal: + self.add_video_terminal(phy=self.videophy, timings="800x600@60Hz", clock_domain="vga") + if with_video_framebuffer: + self.add_video_framebuffer(phy=self.videophy, timings="800x600@60Hz", clock_domain="vga") # Leds ------------------------------------------------------------------------------------- self.submodules.leds = LedChaser( @@ -124,8 +122,9 @@ def main(): sdopts = parser.add_mutually_exclusive_group() sdopts.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support") sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support") - parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (VGA)") - parser.add_argument("--with-video-framebuffer", action="store_true", help="Enable Video Framebuffer (VGA)") + viopts = parser.add_mutually_exclusive_group() + viopts.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (VGA)") + viopts.add_argument("--with-video-framebuffer", action="store_true", help="Enable Video Framebuffer (VGA)") builder_args(parser) soc_sdram_args(parser) args = parser.parse_args() diff --git a/litex_boards/targets/nexys_video.py b/litex_boards/targets/nexys_video.py index 92de38d..317e3bd 100755 --- a/litex_boards/targets/nexys_video.py +++ b/litex_boards/targets/nexys_video.py @@ -126,15 +126,13 @@ class BaseSoC(SoCCore): # Core self.add_sata(phy=self.sata_phy, mode="read+write") - # Video Terminal --------------------------------------------------------------------------- - if with_video_terminal: + # Video ------------------------------------------------------------------------------------ + if with_video_terminal or with_video_framebuffer: self.submodules.videophy = VideoS7HDMIPHY(platform.request("hdmi_out"), clock_domain="hdmi") - self.add_video_terminal(phy=self.videophy, timings="800x600@60Hz", clock_domain="hdmi") - - # Video Framebuffer ------------------------------------------------------------------------ - if with_video_framebuffer: - self.submodules.videophy = VideoS7HDMIPHY(platform.request("hdmi_out"), clock_domain="hdmi") - self.add_video_framebuffer(phy=self.videophy, timings="800x600@60Hz", clock_domain="hdmi") + if with_video_terminal: + self.add_video_terminal(phy=self.videophy, timings="800x600@60Hz", clock_domain="hdmi") + if with_video_framebuffer: + self.add_video_framebuffer(phy=self.videophy, timings="800x600@60Hz", clock_domain="hdmi") # Leds ------------------------------------------------------------------------------------- self.submodules.leds = LedChaser( @@ -155,8 +153,9 @@ def main(): sdopts.add_argument("--with-spi-sdcard", action="store_true", help="Enable SPI-mode SDCard support") sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support") parser.add_argument("--with-sata", action="store_true", help="Enable SATA support (over FMCRAID)") - parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (HDMI)") - parser.add_argument("--with-video-framebuffer", action="store_true", help="Enable Video Framebuffer (HDMI)") + viopts = parser.add_mutually_exclusive_group() + viopts.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (HDMI)") + viopts.add_argument("--with-video-framebuffer", action="store_true", help="Enable Video Framebuffer (HDMI)") builder_args(parser) soc_sdram_args(parser) vivado_build_args(parser)