Giter Site home page Giter Site logo

DDR instead of LVDS output. about hdmi HOT 1 OPEN

hdl-util avatar hdl-util commented on July 16, 2024
DDR instead of LVDS output.

from hdmi.

Comments (1)

xolod79 avatar xolod79 commented on July 16, 2024

serializer.sv

module serializer
#(
    parameter int NUM_CHANNELS = 3,
    parameter real VIDEO_RATE
)
(
    input logic clk_pixel,
    input logic clk_pixel_x5,
    input logic reset,
    input logic [9:0] tmds_internal [NUM_CHANNELS-1:0],
    output logic [7:0] tmds
);

reg [2:0] TMDS_mod5=0;  // modulus 5 counter
reg [4:0] TMDS_shift_bh=0, TMDS_shift_bl=0;
reg [4:0] TMDS_shift_gh=0, TMDS_shift_gl=0;
reg [4:0] TMDS_shift_rh=0, TMDS_shift_rl=0;

wire [4:0] TMDS_blue_l  = {tmds_internal[0][9],tmds_internal[0][7],tmds_internal[0][5],tmds_internal[0][3],tmds_internal[0][1]};
wire [4:0] TMDS_blue_h  = {tmds_internal[0][8],tmds_internal[0][6],tmds_internal[0][4],tmds_internal[0][2],tmds_internal[0][0]};
wire [4:0] TMDS_green_l = {tmds_internal[1][9],tmds_internal[1][7],tmds_internal[1][5],tmds_internal[1][3],tmds_internal[1][1]};
wire [4:0] TMDS_green_h = {tmds_internal[1][8],tmds_internal[1][6],tmds_internal[1][4],tmds_internal[1][2],tmds_internal[1][0]};
wire [4:0] TMDS_red_l   = {tmds_internal[2][9],tmds_internal[2][7],tmds_internal[2][5],tmds_internal[2][3],tmds_internal[2][1]};
wire [4:0] TMDS_red_h   = {tmds_internal[2][8],tmds_internal[2][6],tmds_internal[2][4],tmds_internal[2][2],tmds_internal[2][0]};

always @(posedge clk_pixel_x5)
begin
   TMDS_shift_bh <= TMDS_mod5[2] ? TMDS_blue_h  : TMDS_shift_bh[4:1];
   TMDS_shift_bl <= TMDS_mod5[2] ? TMDS_blue_l  : TMDS_shift_bl[4:1];
   TMDS_shift_gh <= TMDS_mod5[2] ? TMDS_green_h : TMDS_shift_gh[4:1];
   TMDS_shift_gl <= TMDS_mod5[2] ? TMDS_green_l : TMDS_shift_gl[4:1];
   TMDS_shift_rh <= TMDS_mod5[2] ? TMDS_red_h   : TMDS_shift_rh[4:1];
   TMDS_shift_rl <= TMDS_mod5[2] ? TMDS_red_l   : TMDS_shift_rl[4:1];
   TMDS_mod5     <= TMDS_mod5[2] ? 3'd0 : TMDS_mod5+3'd1;
end

altddio_out1 u_ddio0( .datain_h(~clk_pxl),   .datain_l(~clk_pxl),   .outclock(clk_hdmi), .dataout( tmds[0] ) );
altddio_out1 u_ddio1( .datain_h( clk_pxl),   .datain_l( clk_pxl),   .outclock(clk_hdmi), .dataout( tmds[1] ) );
altddio_out1 u_ddio2( .datain_h(~TMDS_shift_bh[0]), .datain_l(~TMDS_shift_bl[0]), .outclock(clk_hdmi), .dataout( tmds[2] ) );
altddio_out1 u_ddio3( .datain_h( TMDS_shift_bh[0]), .datain_l( TMDS_shift_bl[0]), .outclock(clk_hdmi), .dataout( tmds[3] ) );
altddio_out1 u_ddio4( .datain_h(~TMDS_shift_gh[0]), .datain_l(~TMDS_shift_gl[0]), .outclock(clk_hdmi), .dataout( tmds[4] ) );
altddio_out1 u_ddio5( .datain_h( TMDS_shift_gh[0]), .datain_l( TMDS_shift_gl[0]), .outclock(clk_hdmi), .dataout( tmds[5] ) );
altddio_out1 u_ddio6( .datain_h(~TMDS_shift_rh[0]), .datain_l(~TMDS_shift_rl[0]), .outclock(clk_hdmi), .dataout( tmds[6] ) );
altddio_out1 u_ddio7( .datain_h( TMDS_shift_rh[0]), .datain_l( TMDS_shift_rl[0]), .outclock(clk_hdmi), .dataout( tmds[7] ) );

endmodule

from hdmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.