📄 multigenhd_horz_logo.v
字号:
//------------------------------------------------------------------------------
// Copyright (c) 2004 Xilinx, Inc.
// All Rights Reserved
//------------------------------------------------------------------------------
// ____ ____
// / /\/ /
// /___/ \ / Vendor: Xilinx
// \ \ \/ Author: John F. Snow, Advanced Product Division, Xilinx, Inc.
// \ \ Filename: $RCSfile: multigenHD_horz_logo.v,rcs $
// / / Date Last Modified: $Date: 2004-10-15 09:04:58-06 $
// /___/ /\ Date Created: May 25, 2004
// \ \ / \
// \___\/\___\
//
//
// Revision History:
// $Log: multigenHD_horz_logo.v,rcs $
// Revision 1.1 2004-10-15 09:04:58-06 jsnow
// Header update.
//
// Revision 1.0 2004-05-25 13:21:35-06 jsnow
// Initial revision
//------------------------------------------------------------------------------
//
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
// SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR
// XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION
// AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION
// OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS
// IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
// AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
// FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
// WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
// IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
// REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
// INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE.
//
//------------------------------------------------------------------------------
/*
This module contains the horizontal sequencer for the HD video pattern
generator. A block RAM is used as a finite state machine to sequence through
the various horizontal regions of the video patterns. The module outputs a
horizontal region code indicating which horizontal region of the video pattern
is currently active.
This is a slightly modified version of the multigenHD_horz module from XAPP682.
The only difference is that this module outputs the entire horizontal counter
value as a port.
*/
module multigenHD_horz_logo #(parameter HCNT_WIDTH = 12) (
input wire clk, // word-rate clock
input wire rst, // async reset
input wire ce, // clock enable
input wire [2:0] std, // selects video format
input wire [1:0] pattern, // 00 = RP 219 colorbars,
// X1 = RP 198 checkfield,
// 10 = 75% colorbars
input wire [1:0] user_opt, // selects option for the *2 &
// *3 blocks of RP 219
input wire first_line, // asserted during first active line
input wire f, // odd/even field indicator
output wire v_inc, // increment vertical counter
output wire trs, // asserted at start of TRS
output wire xyz, // asserted during XYZ word of TRS
output wire h, // h blanking interval indicator
output reg [4:0] h_region, // horizontal region code
output wire h_counter_lsb, // LSB of horizontal counter
output reg [HCNT_WIDTH-1:0] h_counter // horizontal counter
);
//-----------------------------------------------------------------------------
// Parameter definitions
//
//
// This group of parameters defines the bit widths of various fields in the
// module. Note that if the VID_WIDTH parameter is changed, the video component
// values for the various colors will need to be modified accordingly.
//
parameter VID_WIDTH = 10; // Width of video components
parameter HRGN_WIDTH = 5; // Width of h_region counter
parameter H_EVNT_WIDTH = HCNT_WIDTH - 1; // Width of h_next_evnt
parameter VID_MSB = VID_WIDTH - 1; // MS bit # of video data path
parameter HCNT_MSB = HCNT_WIDTH - 1; // MS bit # of h_counter
parameter HRGN_MSB = HRGN_WIDTH - 1; // MS bit # of h_region counter
parameter H_EVNT_MSB = H_EVNT_WIDTH - 1; // MS bit # of h_next_evnt
//
// This group of parameters defines the horizontal regions from the horizontal
// ROM. Note that the three HRGN_USROPTx regions are never generated by the
// horizontal ROM. An encoder will change HRGN_BAR1 to any of these three values
// depending on the user option inputs before feeding the modified horizontal
// region code to the color ROM. The encoder will also determine whether to
// output the HRGN_CEQ_POL0 or POL1 code depending on whether the current frame
// is odd or even.
//
parameter [HRGN_MSB:0]
HRGN_BAR0 = 0, // 40% gray
HRGN_BAR1 = 1, // 75% white (left part 0% black)
HRGN_BAR2 = 2, // left part 75% yellow (right part 0% black)
HRGN_BAR3 = 3, // right part 75% yellow (right part 100% white)
HRGN_BAR4 = 4, // 75% cyan (middle part 100% white)
HRGN_BAR5 = 5, // left part 75% green (left part 100% white)
HRGN_BAR6 = 6, // right part 75% green (left part 0% black)
HRGN_BAR7 = 7, // left part 75% magenta (right part 0% black)
HRGN_BAR8 = 8, // middle part 75% magenta (-2% black)
HRGN_BAR9 = 9, // right part 75% magenta (0% black)
HRGN_BAR10 = 10, // left part 75% red (+2% black)
HRGN_BAR11 = 11, // middle part 75% red (0% black)
HRGN_BAR12 = 12, // right part 75% red (+4% black)
HRGN_BAR13 = 13, // 75% blue (0% black)
HRGN_BAR14 = 14, // 40% gray
HRGN_INCV = 15, // increment vertical line number
HRGN_EAV1 = 16, // first two words of EAV
HRGN_EAV2_F0 = 17, // second two words of EAV for field 0
HRGN_HBLANK = 18, // horizontal blanking period
HRGN_SAV1 = 19, // first two words of SAV
HRGN_SAV2_F0 = 20, // second two words of SAV for field 0
HRGN_LN = 21, // two words of line number
HRGN_CRC = 22, // two words of CRC
HRGN_SAV2_F1 = 23, // second two words of SAV for field 1
HRGN_USROPT1 = 24, // BAR1 but with 100% white in pat 2, 0% black in pat 3
HRGN_USROPT2 = 25, // BAR1 but with +I in pat 2, 0% black in pat 3
HRGN_USROPT3 = 26, // BAR1 but with -I in pat 2, +Q in pat 3
HRGN_EAV2_F1 = 27, // second two words of EAV for field 1
HRGN_CEQ_PLL = 28, // RP 198 cable equalization pattern
HRGN_CEQ_POL_0 = 29, // RP 198 cable eq pattern, polarity word even frame
HRGN_CEQ_POL_1 = 30, // RP 198 cable eq pattern, polarity word odd frame
HRGN_RST = 31; // initial state after reset
//-----------------------------------------------------------------------------
// Signal definitions
//
wire [31:0] hrom_out; // HROM output
wire [H_EVNT_MSB:0] h_next_evnt; // next horizontal event
wire h_evnt_match; // output of horizontal event comparator
wire hrom_en; // EN input to horizontal ROM
wire [HRGN_MSB:0] h_region_rom; // current horizontal region
wire [HRGN_MSB:0] h_next_region; // next horizontal region
wire h_clr; // clears the horizontal counter
wire usropt_rgn; // horz region where h_region is affected by user_opt inputs
wire ceqpol_rgn; // horz region where h_region is affected by ceq polarity
wire eav2_rgn; // last two words of EAV
wire sav2_rgn; // last two words of SAV
wire [31:0] GND32 = 32'b0000_0000_0000_0000_0000_0000_0000_0000;
wire [3:0] GND4 = 4'b0000;
//
// Horizontal ROM
//
// Simulation initialization code HROM
// Created by multigenHD_romgen.v
// Video format mapping:
// 000 = SMPTE 295M - 1080i 25Hz (1250 lines/frame)
// 001 = SMPTE 274M - 1080sF 24Hz & 23.98Hz
// 002 = SMPTE 274M - 1080i 30Hz & 29.97 Hz
// 003 = SMPTE 274M - 1080i 25Hz
// 004 = SMPTE 274M - 1080p 30Hz & 29.97Hz
// 005 = SMPTE 274M - 1080p 25Hz
// 006 = SMPTE 274M - 1080p 24Hz & 23.98Hz
// 007 = SMPTE 296M - 720p 60Hz & 59.94Hz
//synthesis translate_off
defparam
HROM.INIT = 36'h00060FFFF,
HROM.SRVAL = 36'h00060FFFF,
HROM.WRITE_MODE = "READ_FIRST",
HROM.INITP_00 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_01 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_02 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_03 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_04 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_05 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_06 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INITP_07 = 256'h0000000000000000000000000000000000000000000000000000000000000000,
HROM.INIT_00 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_01 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_02 = 256'h00170010011678720115785611B4946001939454011294330991783501907811,
HROM.INIT_03 = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_04 = 256'h0007001000060010000500100004001000030010000200100001001000000010,
HROM.INIT_05 = 256'h004F77F0000E0010000D0010000C0010000B0010000A00100009001000080010,
HROM.INIT_06 = 256'h00170010011678720115785611B4947D01939454011294330991783501907811,
HROM.INIT_07 = 256'h015F0012001E0010041D003C001C77CF001B0010001A00100019001000180010,
HROM.INIT_08 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_09 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_0A = 256'h00170010011678720115785611B4ABC00193ABB40112AB930991783501907811,
HROM.INIT_0B = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_0C = 256'h0007001000060010000500100004001000030010000200100001001000000010,
HROM.INIT_0D = 256'h004F77F0000E0010000D0010000C0010000B0010000A00100009001000080010,
HROM.INIT_0E = 256'h00170010011678720115785611B4ABDD0193ABB40112AB930991783501907811,
HROM.INIT_0F = 256'h015F0012001E0010041D003C001C77CF001B0010001A00100019001000180010,
HROM.INIT_10 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_11 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_12 = 256'h00170010011678720115785611B4896001938954011289330991783501907811,
HROM.INIT_13 = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_14 = 256'h0007001000060010000500100004001000030010000200100001001000000010,
HROM.INIT_15 = 256'h004F77F0000E0010000D0010000C0010000B0010000A00100009001000080010,
HROM.INIT_16 = 256'h00170010011678720115785611B4897D01938954011289330991783501907811,
HROM.INIT_17 = 256'h015F0012001E0010041D003C001C77CF001B0010001A00100019001000180010,
HROM.INIT_18 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_19 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_1A = 256'h00170010011678720115785611B4A4E00193A4D40112A4B30991783501907811,
HROM.INIT_1B = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_1C = 256'h0007001000060010000500100004001000030010000200100001001000000010,
HROM.INIT_1D = 256'h004F77F0000E0010000D0010000C0010000B0010000A00100009001000080010,
HROM.INIT_1E = 256'h00170010011678720115785611B4A4FD0193A4D40112A4B30991783501907811,
HROM.INIT_1F = 256'h015F0012001E0010041D003C001C77CF001B0010001A00100019001000180010,
HROM.INIT_20 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_21 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_22 = 256'h00170010011678720115785611B4896001938954011289330991783501907811,
HROM.INIT_23 = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_24 = 256'h0007001000060010000500100004001000030010000200100001001000000010,
HROM.INIT_25 = 256'h004F77F0000E0010000D0010000C0010000B0010000A00100009001000080010,
HROM.INIT_26 = 256'h00170010011678720115785611B4897D01938954011289330991783501907811,
HROM.INIT_27 = 256'h015F0012001E0010041D003C001C77CF001B0010001A00100019001000180010,
HROM.INIT_28 = 256'h000746880006424700053BE600043585000328A40002222302011BC200000EE1,
HROM.INIT_29 = 256'h004F77F0000E77CF000D68EE000C5C0D000B57CC000A536B00094F2A00084AC9,
HROM.INIT_2A = 256'h00170010011678720115785611B4A4E00193A4D40112A4B30991783501907811,
HROM.INIT_2B = 256'h015F0012001E0010001D0010001C0010001B0010001A00100019001000180010,
HROM.INIT_2C = 256'h0007001000060010000500100004001000030010000200100001001000000010,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -