From 1895dd36e2b96ac7969481b492b9e7e18bbbed44 Mon Sep 17 00:00:00 2001 From: David A Roberts Date: Tue, 26 Mar 2024 20:23:51 +1000 Subject: [PATCH] tools/litex_sim: Add --with-video-colorbars option --- litex/tools/litex_sim.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/litex/tools/litex_sim.py b/litex/tools/litex_sim.py index 1e412b87c..5444ad449 100755 --- a/litex/tools/litex_sim.py +++ b/litex/tools/litex_sim.py @@ -178,6 +178,7 @@ class SimSoC(SoCCore): with_gpio = False, with_video_framebuffer = False, with_video_terminal = False, + with_video_colorbars = False, sim_debug = False, trace_reset_on = False, with_jtag = False, @@ -313,6 +314,11 @@ class SimSoC(SoCCore): self.submodules.videophy = VideoGenericPHY(platform.request("vga")) self.add_video_terminal(phy=self.videophy, timings="640x480@60Hz") + # Video test pattern ----------------------------------------------------------------------- + if with_video_colorbars: + self.submodules.videophy = VideoGenericPHY(platform.request("vga")) + self.add_video_colorbars(phy=self.videophy, timings="640x480@60Hz") + # Simulation debugging ---------------------------------------------------------------------- if sim_debug: platform.add_debug(self, reset=1 if trace_reset_on else 0) @@ -428,6 +434,7 @@ def sim_args(parser): # Video. parser.add_argument("--with-video-framebuffer", action="store_true", help="Enable Video Framebuffer.") parser.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal.") + parser.add_argument("--with-video-colorbars", action="store_true", help="Enable Video test pattern.") # Debug/Waveform. parser.add_argument("--sim-debug", action="store_true", help="Add simulation debugging modules.") @@ -510,7 +517,7 @@ def main(): sim_config.add_module("jtagremote", "jtag", args={'port': 44853}) # Video. - if args.with_video_framebuffer or args.with_video_terminal: + if args.with_video_framebuffer or args.with_video_terminal or args.with_video_colorbars: sim_config.add_module("video", "vga") # SoC ------------------------------------------------------------------------------------------ @@ -528,6 +535,7 @@ def main(): with_gpio = args.with_gpio, with_video_framebuffer = args.with_video_framebuffer, with_video_terminal = args.with_video_terminal, + with_video_colorbars = args.with_video_colorbars, sim_debug = args.sim_debug, trace_reset_on = int(float(args.trace_start)) > 0 or int(float(args.trace_end)) > 0, spi_flash_init = None if args.spi_flash_init is None else get_mem_data(args.spi_flash_init, endianness="big"), @@ -551,7 +559,7 @@ def main(): builder.build( sim_config = sim_config, interactive = not args.non_interactive, - video = args.with_video_framebuffer or args.with_video_terminal, + video = args.with_video_framebuffer or args.with_video_terminal or args.with_video_colorbars, pre_run_callback = pre_run_callback, **parser.toolchain_argdict, )