//---------------------------------------------------------------------
// Copyright By vtron  Corporation.
// vtron Confidential Proprietary
//---------------------------------------------------------------------
// File name: config_m.v
// Module name: config_m
// Created by: Chen Haoli
// ---------------------------------------------------------------------
// Release history
// VERSION |  Date       | AUTHOR     |    DESCRIPTION
// ---------------------------------------------------------------------
//  1.0    | 15-Nov-2011 | Chen Haoli |     initial 
// ---------------------------------------------------------------------
//  1.1    | 18-Mar-2015 | Caojie     | 修改端口，增加参数
// ---------------------------------------------------------------------
//  1.2    | 23-Mar-2015 | Caojie     | 修改端口，增加output输出时序
// ---------------------------------------------------------------------
//  1.3    | 03-Apr-2015 | Caojie     | 只保留output输出时序参数和时钟
// ---------------------------------------------------------------------

`timescale 1ns / 1ps

module config_m#
(
    parameter OUTPUT_VIDEO_FORMAT = "1024x768_xHz",//video format       
                                                    //"WxH_xHz"          
                                                    //"80x60_xHz"        
                                                    //"160x120_xHz"      
                                                    //"320x240_xHz"      
                                                    //"640x480_xHz"      
                                                    //"800x600_xHz"      
                                                    //"1024x768_xHz"     
                                                    //"1366x768_xHz"     
                                                    //"1400x1050_xHz"    
                                                    //"1600x1200_xHz"    
                                                    //"1920x1080_xHz"    
                                                    //"1920x1200_xHz(RB)"
    parameter OUTPUT_PIXEL_CLK_FREQ = 65.000, //pixel clock frequency, unit: MHz
                                              //any --> "WxH_xHz"
                                              //any --> "80x60_xHz"
                                              //any --> "160x120_xHz"
                                              //any --> "320x240_xHz".
                                              //any --> "640x480_xHz"
                                              //any --> "640x480_xHz"
                                              //any --> "800x600_xHz"
                                              //any --> "1024x768_xHz"
                                              //any --> "1366x768_xHz"
                                              //any --> "1400x1050_xHz"
                                              //any --> "1600x1200_xHz"
                                              //any --> "1920x1080_xHz"
                                              //any --> "1920x1200_xHz(RB)"
    parameter OUTPUT_HOR_RESOLUTION = 16'd1024,
    parameter OUTPUT_VER_RESOLUTION = 16'd768
)
(
    output wire [15:0] data_valid_xst_o, 
    output wire [15:0] data_valid_xed_o, 
    output wire [15:0] data_valid_yst_o, 
    output wire [15:0] data_valid_yed_o,
    output wire [15:0] hor_sync_time_o ,
    output wire [15:0] ver_sync_time_o ,
    output wire [15:0] hor_total_time_o, 
    output wire [15:0] ver_total_time_o  
); 

//=========================================================================
//-----------------------------
video_syntime_config_24b #(
    .VIDEO_FORMAT   (OUTPUT_VIDEO_FORMAT  ),
    .PIXEL_CLK_FREQ (OUTPUT_PIXEL_CLK_FREQ),
    .HOR_RESOLUTION (OUTPUT_HOR_RESOLUTION),
    .VER_RESOLUTION (OUTPUT_VER_RESOLUTION)
    )
u_video_syntime_config_24b(
    .hor_total_time_o (hor_total_time_o), //horizontal total pixels
    .ver_total_time_o (ver_total_time_o), //vertical total lines
    .hor_sync_time_o  (hor_sync_time_o ), //horizontal synchronization time (unit:pixel) 
    .ver_sync_time_o  (ver_sync_time_o ), //vertical synchronization time (unit:line)
    .data_valid_xst_o (data_valid_xst_o), //addressable video horizontal start coorodinate   
    .data_valid_xed_o (data_valid_xed_o), //addressable video horizontal end coorodinate     
    .data_valid_yst_o (data_valid_yst_o), //addressable video vertical start coorodinate     
    .data_valid_yed_o (data_valid_yed_o)  //addressable video vertical end coorodinate
    );

endmodule
