123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- `default_nettype none
- module hdmi_text_2x #(
- parameter integer DW = 4
- )(
-
- output wire [DW-1:0] hdmi_data,
- output wire hdmi_hsync,
- output wire hdmi_vsync,
- output wire hdmi_de,
- output wire hdmi_clk,
-
- input wire [15:0] bus_addr,
- input wire [15:0] bus_din,
- output wire [15:0] bus_dout,
- input wire bus_cyc,
- input wire bus_we,
- output wire bus_ack,
-
- input wire clk_1x,
- input wire clk_2x,
- input wire rst
- );
-
-
-
- wire tg_hsync;
- wire tg_vsync;
- wire tg_active;
- wire tg_h_first;
- wire tg_h_last;
- wire tg_v_first;
- wire tg_v_last;
-
- wire [15:0] txt_data0;
- wire [15:0] txt_data1;
-
- wire vo_hsync;
- wire vo_vsync;
- wire vo_active;
- reg vo_toggle = 1'b0;
- reg [ 3:0] vo_data0;
- reg [ 3:0] vo_data1;
-
-
- vid_tgen tgen_I (
- .vid_hsync(tg_hsync),
- .vid_vsync(tg_vsync),
- .vid_active(tg_active),
- .vid_h_first(tg_h_first),
- .vid_h_last(tg_h_last),
- .vid_v_first(tg_v_first),
- .vid_v_last(tg_v_last),
- .clk(clk_1x),
- .rst(rst)
- );
-
-
- vid_text text_I (
- .vid_active_0(tg_active),
- .vid_h_first_0(tg_h_first),
- .vid_h_last_0(tg_h_last),
- .vid_v_first_0(tg_v_first),
- .vid_v_last_0(tg_v_last),
- .vid_pix0_11(txt_data0),
- .vid_pix1_11(txt_data1),
- .bus_addr(bus_addr),
- .bus_din(bus_din),
- .bus_dout(bus_dout),
- .bus_cyc(bus_cyc),
- .bus_we(bus_we),
- .bus_ack(bus_ack),
- .clk(clk_1x),
- .rst(rst)
- );
-
-
-
- delay_bit #(12) dly_hsync ( .d(tg_hsync), .q(vo_hsync), .clk(clk_1x) );
- delay_bit #(12) dly_vsync ( .d(tg_vsync), .q(vo_vsync), .clk(clk_1x) );
- delay_bit #(12) dly_active ( .d(tg_active), .q(vo_active), .clk(clk_1x) );
-
- always @(posedge clk_1x)
- begin
- vo_toggle <= ~rst & (vo_toggle ^ (tg_v_first & tg_h_first));
- vo_data0 <= vo_toggle ? txt_data0[7:4] : txt_data0[3:0];
- vo_data1 <= vo_toggle ? txt_data1[7:4] : txt_data1[3:0];
- end
-
-
- hdmi_phy_2x #(
- .DW(DW)
- ) phy_I (
- .hdmi_data(hdmi_data),
- .hdmi_hsync(hdmi_hsync),
- .hdmi_vsync(hdmi_vsync),
- .hdmi_de(hdmi_de),
- .hdmi_clk(hdmi_clk),
- .in_data0(vo_data0),
- .in_data1(vo_data1),
- .in_hsync(vo_hsync),
- .in_vsync(vo_vsync),
- .in_de(vo_active),
- .clk_1x(clk_1x),
- .clk_2x(clk_2x)
- );
- endmodule
|