From 4ead7d4d5b77f52aaaac70c2abf8b3848b7fb4d3 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 24 Jun 2021 12:26:32 +0200 Subject: [PATCH] HDMI output first signs of life --- src/hdmi_io.vhd | 2 +- src/top.v | 71 +++++++++++++++---------------------------------- 2 files changed, 23 insertions(+), 50 deletions(-) diff --git a/src/hdmi_io.vhd b/src/hdmi_io.vhd index 5fd598a..747ec5a 100644 --- a/src/hdmi_io.vhd +++ b/src/hdmi_io.vhd @@ -386,7 +386,7 @@ i_hdmi_input : hdmi_input port map ( -- Pixel and serializer clocks pixel_clk => pixel_clk_i, pixel_io_clk_x1 => pixel_io_clk_x1, - pixel_io_clk_x5 => pixel_io_clk_x5, + pixel_io_clk_x5 => pixel_io_clk_x5, --- HDMI input signals hdmi_in_clk => tmds_in_clk, hdmi_in_ch0 => tmds_in_ch0, diff --git a/src/top.v b/src/top.v index 2cb67c8..d88d900 100644 --- a/src/top.v +++ b/src/top.v @@ -25,13 +25,6 @@ module proc_top( /* Color bar generator */ -parameter CB_HRES = 1280; -parameter CB_VRES = 768; -parameter CB_H_FP = 64; -parameter CB_H_BP = 192; -parameter CB_V_FP = 3; -parameter CB_V_BP = 20; - reg [11:0] cb_x = 0; reg [11:0] cb_y = 0; reg [11:0] cb_cnt = 0; @@ -50,59 +43,39 @@ assign out_green = cb_green; assign out_blue = cb_blue; always @(posedge clk) begin - cb_x <= cb_x + 1; + cb_red <= 8'hff; + cb_green <= 8'h00; + cb_blue <= 8'h00; + + if (cb_x == 1279) begin + cb_blank <= 1; + end else if (cb_x == 1648-1 && (cb_y == 749 || cb_y < 719)) begin + cb_blank <= 0; + end - if (cb_x == 12'h003) begin + if (cb_x == 1280+72-1) begin cb_hsync <= 1; - end else if (cb_x == 12'h010) begin + end else if (cb_x == 1280+72+80-1) begin cb_hsync <= 0; end - if (cb_x == CB_H_FP + CB_HRES + CB_H_BP - 1) begin + if (cb_x == 1648-1) begin cb_x <= 0; - cb_y <= cb_y + 1; - cb_vsync <= (cb_y == 2) || (cb_y == 3); + if (cb_y == 720+3-1) begin + cb_vsync <= 1; + end else if (cb_y == 720+3+5-1) begin + cb_vsync <= 0; + end - if (cb_y == CB_V_FP - 1) begin - cb_vactive <= 1; - - end else if (cb_y == CB_V_FP + CB_VRES - 1) begin - cb_vactive <= 0; - - end else if (cb_y == CB_V_FP + CB_VRES + CB_V_BP - 1) begin + if (cb_y == 750-1) begin cb_y <= 0; + end else begin + cb_y <= cb_y + 1; end - end else if (cb_vactive && (cb_x == CB_H_FP - 1)) begin - cb_red <= 0; - cb_green <= 0; - cb_blue <= 0; - cb_blank <= 0; - cb_cnt <= 0; - cb_bar <= 0; - - end else if (cb_vactive && (cb_x == CB_H_FP + CB_HRES - 1)) begin - cb_blank <= 1; - - end - - if (!cb_blank) begin - cb_cnt <= cb_cnt + 1; - - if (cb_cnt == 255) begin - cb_cnt <= 0; - cb_bar <= cb_bar + 1; - - if (cb_bar == 7) begin - cb_bar <= 0; - end - - cb_red <= {8{cb_bar[0]}}; - cb_green <= {8{cb_bar[1]}}; - cb_blue <= {8{cb_bar[2]}}; - end - + end else begin + cb_x <= cb_x + 1; end end