基于FPGA视频时序生成中的库文件

上一篇分享了一个视频时序生成代码,下面我根据之前项目中用到的时序,对各个参数做了库文件,方便调用。

--
--    Package File Template
--
--    Purpose: This package defines supplemental types, subtypes, 
--         constants, and functions 
--
--   To use any of the example code shown below, uncomment the lines and modify as necessary
--

library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
use ieee.numeric_std.all;

package timing_factor_pkg is
--------------------------------------------------------------------------------
-- Old data types retained for backwards compatibility
subtype factor_type     is     std_logic_vector(12 downto 0);

----------------------1920x1200@60Hz--------------------------------
constant    hsblnk_1920x1200 :  factor_type :="0011101111111";--1919
constant    hssync_1920x1200 :  factor_type :="0011110101111";--1967
constant    hesync_1920x1200 :  factor_type :="0011111001111";--1999
constant    heblnk_1920x1200 :  factor_type :="0100000011111";--2079
constant    vsblnk_1920x1200 :  factor_type :="0010010101111";--1199
constant    vssync_1920x1200 :  factor_type :="0010010110010";--1202
constant    vesync_1920x1200 :  factor_type :="0010010111000";--1208
constant    veblnk_1920x1200 :  factor_type :="0010011010010";--1234
 
----------------------1920*1080@60HZ-------------------------------
constant    hsblnk_1920x1080     : factor_type    :="0011101111111";--1919
constant    hssync_1920x1080     : factor_type    :="0011111010111";--2007
constant    hesync_1920x1080     : factor_type    :="0100000000011";--2051  
constant    heblnk_1920x1080     : factor_type    :="0100010010111";--2199
constant    vsblnk_1920x1080     : factor_type    :="0010000110111";--1079
constant    vssync_1920x1080     : factor_type    :="0010000111011";--1083
constant    vesync_1920x1080     : factor_type    :="0010001000000";--1088
constant    veblnk_1920x1080     : factor_type    :="0010001100100";--1124

--------------------1920*1080@25/30/50HZ----------------------------
constant    hsblnk_1920x1080_50 : factor_type    :="0011101111111";--1919
constant    hssync_1920x1080_50 : factor_type    :="0100110001111";--2447
constant    hesync_1920x1080_50 : factor_type    :="0100110111011";--2491  
constant    heblnk_1920x1080_50 : factor_type    :="0101001001111";--2639 
constant    vsblnk_1920x1080_50 : factor_type    :="0010000110111";--1079
constant    vssync_1920x1080_50 : factor_type    :="0010000111011";--1083
constant    vesync_1920x1080_50 : factor_type    :="0010001000000";--1088
constant    veblnk_1920x1080_50 : factor_type    :="0010001100100";--1124


--------------------1920*1080@60Hz I----------------------------
constant    hsblnk_1920x1080_60I     : factor_type    :="0011101111111";--1919
constant    hssync_1920x1080_60I     : factor_type    :="0011111010111";--2007
constant    hesync_1920x1080_60I     : factor_type    :="0100000000011";--2051  
constant    heblnk_1920x1080_60I     : factor_type    :="0100010010111";--2199
constant    vsblnk_1920x1080_60I     : factor_type    :="0001000011011";--539
constant    vssync_1920x1080_60I       : factor_type    :="0001000011101";--541
constant    vesync_1920x1080_60I     : factor_type    :="0001000100010";--546
constant    veblnk_1920x1080_60I     : factor_type    :="0001000110010";--562

--------------------1920*1080@50Hz I----------------------------
constant    hsblnk_1920x1080_50I     : factor_type    :="0011101111111";--1919
constant    hssync_1920x1080_50I     : factor_type    :="0100110001111";--2447
constant    hesync_1920x1080_50I     : factor_type    :="0100110111011";--2491
constant    heblnk_1920x1080_50I     : factor_type    :="0101001001111";--2639
constant    vsblnk_1920x1080_50I     : factor_type    :="0001000011011";--539
constant    vssync_1920x1080_50I       : factor_type    :="0001000011101";--541
constant    vesync_1920x1080_50I     : factor_type    :="0001000100010";--546
constant    veblnk_1920x1080_50I     : factor_type    :="0001000110010";--562

--------------------1920*1080@24HZ----------------------------
constant    hsblnk_1920x1080_24 : factor_type    :="0011101111111";--1919
constant    hssync_1920x1080_24 : factor_type    :="0100111111101";--2557
constant    hesync_1920x1080_24 : factor_type    :="0101000101001";--2601  
constant    heblnk_1920x1080_24 : factor_type    :="0101010111101";--2749
constant    vsblnk_1920x1080_24 : factor_type    :="0010000110111";--1079
constant    vssync_1920x1080_24 : factor_type    :="0010000111011";--1083
constant    vesync_1920x1080_24 : factor_type    :="0010001000000";--1088
constant    veblnk_1920x1080_24 : factor_type    :="0010001100100";--1124

----------------------1600x1200@60Hz-----------------------------------
constant    hsblnk_1600x1200 :  factor_type :="0011000111111";--1599
constant    hssync_1600x1200 :  factor_type :="0011001111111";--1663
constant    hesync_1600x1200 :  factor_type :="0011100111111";--1855
constant    heblnk_1600x1200 :  factor_type :="0100001101111";--2159
constant    vsblnk_1600x1200 :  factor_type :="0010010101111";--1199
constant    vssync_1600x1200 :  factor_type :="0010010110000";--1200
constant    vesync_1600x1200 :  factor_type :="0010010110011";--1203
constant    veblnk_1600x1200 :  factor_type :="0010011100001";--1249  

----------------------1400x1050@60Hz-------------------------------
constant    hsblnk_1400x1050 :  factor_type :="0010101110111";--1399
constant    hssync_1400x1050 :  factor_type :="0010111001111";--1487
constant    hesync_1400x1050 :  factor_type :="0011001011111";--1631
constant    heblnk_1400x1050 :  factor_type :="0011101000111";--1863 
constant    vsblnk_1400x1050 :  factor_type :="0010000011001";--1049
constant    vssync_1400x1050 :  factor_type :="0010000011100";--1052
constant    vesync_1400x1050 :  factor_type :="0010000100000";--1056
constant    veblnk_1400x1050 :  factor_type :="0010001000000";--1088

----------------------1440x900@60Hz--------------------------------
constant    hsblnk_1440x900  :  factor_type :="0010110011111";--1439
constant    hssync_1440x900  :  factor_type :="0010111101111";--1519
constant    hesync_1440x900  :  factor_type :="0011010000111";--1671
constant    heblnk_1440x900  :  factor_type :="0011101101111";--1903
constant    vsblnk_1440x900  :  factor_type :="0001110000011";--899
constant    vssync_1440x900  :  factor_type :="0001110000110";--902
constant    vesync_1440x900  :  factor_type :="0001110001100";--908
constant    veblnk_1440x900  :  factor_type :="0001110100101";--933

----------------------1440x480I@60Hz--------------------------------
constant    hsblnk_1440x480I :  factor_type :="0010110011111";--1439
constant    hssync_1440x480I :  factor_type :="0010110100111";--1447
constant    hesync_1440x480I :  factor_type :="0011001000001";--1601
constant    heblnk_1440x480I :  factor_type :="0011010110011";--1715
constant    vsblnk_1440x480I :  factor_type :="0000011101111";--239
constant    vssync_1440x480I :  factor_type :="0000011110011";--243
constant    vesync_1440x480I :  factor_type :="0000011110110";--246
constant    veblnk_1440x480I :  factor_type :="0000100000110";--262

----------------------1440x576I@60Hz--------------------------------
constant    hsblnk_1440x576I :  factor_type :="0010110011111";--1439
constant    hssync_1440x576I :  factor_type :="0010110110111";--1463
constant    hesync_1440x576I :  factor_type :="0011000110101";--1589
constant    heblnk_1440x576I :  factor_type :="0011010111111";--1727
constant    vsblnk_1440x576I :  factor_type :="0000100011111";--287
constant    vssync_1440x576I :  factor_type :="0000100100001";--289
constant    vesync_1440x576I :  factor_type :="0000100100100";--292
constant    veblnk_1440x576I :  factor_type :="0000100111000";--312


----------------------1280x800@60Hz----------------------------
constant    hsblnk_1280x800  :  factor_type :="0010011111111";--1279
constant    hssync_1280x800  :  factor_type :="0010101000111";--1351
constant    hesync_1280x800  :  factor_type :="0010111000111";--1479
constant    heblnk_1280x800  :  factor_type :="0011010001111";--1679
constant    vsblnk_1280x800  :  factor_type :="0001100011111";--799
constant    vssync_1280x800  :  factor_type :="0001100100010";--802
constant    vesync_1280x800  :  factor_type :="0001100101000";--808
constant    veblnk_1280x800  :  factor_type :="0001100111110";--830

----------------------1280x800@75Hz----------------------------
constant    hsblnk_1280x800_75  :  factor_type :="0010011111111";--1279
constant    hssync_1280x800_75  :  factor_type :="0010101001111";--1359
constant    hesync_1280x800_75  :  factor_type :="0010111001111";--1487
constant    heblnk_1280x800_75  :  factor_type :="0011010011111";--1695
constant    vsblnk_1280x800_75  :  factor_type :="0001100011111";--799
constant    vssync_1280x800_75  :  factor_type :="0001100100010";--802
constant    vesync_1280x800_75  :  factor_type :="0001100101000";--808
constant    veblnk_1280x800_75  :  factor_type :="0001101000101";--837

----------------------1280x768@60Hz----------------------------
constant    hsblnk_1280x768  :  factor_type :="0010011111111";--1279
constant    hssync_1280x768  :  factor_type :="0010100111111";--1343
constant    hesync_1280x768  :  factor_type :="0010110111111";--1471
constant    heblnk_1280x768  :  factor_type :="0011001111111";--1663
constant    vsblnk_1280x768  :  factor_type :="0001011111111";--767
constant    vssync_1280x768  :  factor_type :="0001100000010";--770
constant    vesync_1280x768  :  factor_type :="0001100001001";--777
constant    veblnk_1280x768  :  factor_type :="0001100011101";--797

----------------------1280x768@75Hz----------------------------
constant    hsblnk_1280x768_75  :  factor_type :="0010011111111";--1279
constant    hssync_1280x768_75  :  factor_type :="0010101001111";--1359
constant    hesync_1280x768_75  :  factor_type :="0010111001111";--1487
constant    heblnk_1280x768_75  :  factor_type :="0011010011111";--1695
constant    vsblnk_1280x768_75  :  factor_type :="0001011111111";--767
constant    vssync_1280x768_75  :  factor_type :="0001100000010";--770
constant    vesync_1280x768_75  :  factor_type :="0001100001001";--777
constant    veblnk_1280x768_75  :  factor_type :="0001100100100";--804

---------------------1280*720@60HZ--------------------------------
constant    hsblnk_1280x720  : factor_type  :="0010011111111";--1279
constant    hssync_1280x720  : factor_type  :="0010101101101";--1389
constant    hesync_1280x720  : factor_type  :="0010110010101";--1429   
constant    heblnk_1280x720  : factor_type  :="0011001110001";--1649
constant    vsblnk_1280x720  : factor_type  :="0001011001111";--719
constant    vssync_1280x720  : factor_type  :="0001011010100";--724
constant    vesync_1280x720  : factor_type  :="0001011011001";--729
constant    veblnk_1280x720  : factor_type  :="0001011101101";--749

---------------------1280*720@50HZ--------------------------------
constant    hsblnk_1280x720_50  : factor_type  :="0010011111111";--1279
constant    hssync_1280x720_50  : factor_type  :="0011010110111";--1719
constant    hesync_1280x720_50  : factor_type  :="0011011011111";--1759   
constant    heblnk_1280x720_50  : factor_type  :="0011110111011";--1979
constant    vsblnk_1280x720_50  : factor_type  :="0001011001111";--719
constant    vssync_1280x720_50  : factor_type  :="0001011010100";--724
constant    vesync_1280x720_50  : factor_type  :="0001011011001";--729
constant    veblnk_1280x720_50  : factor_type  :="0001011101101";--749

---------------------1280*720@30HZ------------------------------------
constant    hsblnk_1280x720_30  : factor_type  :="0010011111111";--1279
constant    hssync_1280x720_30  : factor_type  :="0101111011111";--3039
constant    hesync_1280x720_30  : factor_type  :="0110000000111";--3079  
constant    heblnk_1280x720_30  : factor_type  :="0110011100011";--3299
constant    vsblnk_1280x720_30  : factor_type  :="0001011001111";--719
constant    vssync_1280x720_30  : factor_type  :="0001011010100";--724
constant    vesync_1280x720_30  : factor_type  :="0001011011001";--729
constant    veblnk_1280x720_30  : factor_type  :="0001011101101";--749

---------------------1280x1024@60-------------------------------------
constant    hsblnk_1280x1024 : factor_type  :="0010011111111";--1279
constant    hssync_1280x1024 : factor_type  :="0010100101111";--1327
constant    hesync_1280x1024 : factor_type  :="0010110011111";--1439
constant    heblnk_1280x1024 : factor_type  :="0011010010111";--1687 
constant    vsblnk_1280x1024 : factor_type  :="0001111111111";--1023
constant    vssync_1280x1024 : factor_type  :="0010000000000";--1024
constant    vesync_1280x1024 : factor_type  :="0010000000011";--1027
constant    veblnk_1280x1024 : factor_type  :="0010000101001";--1065

---------------------1366x768@60--------------------------------------
constant    hsblnk_1366x768  :  factor_type :="0010101010101";--1365
constant    hssync_1366x768  :  factor_type :="0010110011011";--1435
constant    hesync_1366x768  :  factor_type :="0011000101010";--1578
constant    heblnk_1366x768  :  factor_type :="0011011111111";--1791
constant    vsblnk_1366x768  :  factor_type :="0001011111111";--767
constant    vssync_1366x768  :  factor_type :="0001100000010";--770
constant    vesync_1366x768  :  factor_type :="0001100000101";--773
constant    veblnk_1366x768  :  factor_type :="0001100011101";--797

---------------------1360x768@60--------------------------------------
constant    hsblnk_1360x768  :  factor_type :="0010101001111";--1359
constant    hssync_1360x768  :  factor_type :="0010110001111";--1423
constant    hesync_1360x768  :  factor_type :="0010111111111";--1535
constant    heblnk_1360x768  :  factor_type :="0011011111111";--1791
constant    vsblnk_1360x768  :  factor_type :="0001011111111";--767
constant    vssync_1360x768  :  factor_type :="0001100000010";--770
constant    vesync_1360x768  :  factor_type :="0001100001000";--776
constant    veblnk_1360x768  :  factor_type :="0001100011010";--794

---------------------1024*768@60Hz------------------------------------
constant    hsblnk_1024x768  :  factor_type :="0001111111111";--1023
constant    hssync_1024x768  :  factor_type :="0010000010111";--1047
constant    hesync_1024x768  :  factor_type :="0010010011111";--1183
constant    heblnk_1024x768  :  factor_type :="0010100111111";--1343
constant    vsblnk_1024x768  :  factor_type :="0001011111111";--767
constant    vssync_1024x768  :  factor_type :="0001100000010";--770
constant    vesync_1024x768  :  factor_type :="0001100001000";--776
constant    veblnk_1024x768  :  factor_type :="0001100100101";--805

---------------------1024*768@75Hz------------------------------------
constant    hsblnk_1024x768_75  :  factor_type :="0001111111111";--1023
constant    hssync_1024x768_75  :  factor_type :="0010000001111";--1039
constant    hesync_1024x768_75  :  factor_type :="0010001101111";--1135
constant    heblnk_1024x768_75  :  factor_type :="0010100011111";--1311
constant    vsblnk_1024x768_75  :  factor_type :="0001011111111";--767
constant    vssync_1024x768_75  :  factor_type :="0001100000000";--768
constant    vesync_1024x768_75  :  factor_type :="0001100000011";--771
constant    veblnk_1024x768_75  :  factor_type :="0001100001011";--779

---------------------1024*768@85Hz------------------------------------
constant    hsblnk_1024x768_85  :  factor_type :="0001111111111";--1023
constant    hssync_1024x768_85  :  factor_type :="0010000101111";--1071
constant    hesync_1024x768_85  :  factor_type :="0010010001001";--1161
constant    heblnk_1024x768_85  :  factor_type :="0010101011111";--1375
constant    vsblnk_1024x768_85  :  factor_type :="0001011111111";--767
constant    vssync_1024x768_85  :  factor_type :="0001100000000";--768
constant    vesync_1024x768_85  :  factor_type :="0001100000011";--771
constant    veblnk_1024x768_85  :  factor_type :="0001100100111";--807

---------------------800*600@60Hz------------------------------------
constant    hsblnk_800x600   :  factor_type :="0001100011111";--799
constant    hssync_800x600   :  factor_type :="0001101000111";--839
constant    hesync_800x600   :  factor_type :="0001111000111";--967  
constant    heblnk_800x600   :  factor_type :="0010000011111";--1055
constant    vsblnk_800x600   :  factor_type :="0001001010111";--599
constant    vssync_800x600   :  factor_type :="0001001011000";--600
constant    vesync_800x600   :  factor_type :="0001001011100";--604
constant    veblnk_800x600   :  factor_type :="0001001110011";--627

---------------------800*600@75Hz------------------------------------
constant    hsblnk_800x600_75   :  factor_type :="0001100011111";--799
constant    hssync_800x600_75   :  factor_type :="0001100101111";--815
constant    hesync_800x600_75   :  factor_type :="0001101111111";--895  
constant    heblnk_800x600_75   :  factor_type :="0010000011111";--1055
constant    vsblnk_800x600_75   :  factor_type :="0001001010111";--599
constant    vssync_800x600_75   :  factor_type :="0001001011000";--600
constant    vesync_800x600_75   :  factor_type :="0001001011011";--603
constant    veblnk_800x600_75   :  factor_type :="0001001110000";--624

---------------------800*600@85Hz------------------------------------
constant    hsblnk_800x600_85   :  factor_type :="0001100011111";--799
constant    hssync_800x600_85   :  factor_type :="0001100111111";--831
constant    hesync_800x600_85   :  factor_type :="0001101111111";--895  
constant    heblnk_800x600_85   :  factor_type :="0010000011111";--1055
constant    vsblnk_800x600_85   :  factor_type :="0001001010111";--599
constant    vssync_800x600_85   :  factor_type :="0001001011000";--600
constant    vesync_800x600_85   :  factor_type :="0001001011011";--603
constant    veblnk_800x600_85   :  factor_type :="0001001110110";--630

---------------------720x576------------------------------------
constant    hsblnk_720x576      :  factor_type :="0001011001111";--719
constant    hssync_720x576      :  factor_type :="0001011011011";--731
constant    hesync_720x576      :  factor_type :="0001100011011";--795  
constant    heblnk_720x576      :  factor_type :="0001101011111";--863
constant    vsblnk_720x576      :  factor_type :="0001000111111";--575
constant    vssync_720x576      :  factor_type :="0001001000100";--580
constant    vesync_720x576      :  factor_type :="0001001001001";--585
constant    veblnk_720x576      :  factor_type :="0001001110000";--624

---------------------720x480------------------------------------
constant    hsblnk_720x480      :  factor_type :="0001011001111";--719
constant    hssync_720x480      :  factor_type :="0001011011111";--735
constant    hesync_720x480      :  factor_type :="0001100011101";--797 
constant    heblnk_720x480      :  factor_type :="0001101011001";--857
constant    vsblnk_720x480      :  factor_type :="0000111011111";--479
constant    vssync_720x480      :  factor_type :="0000111101000";--488
constant    vesync_720x480      :  factor_type :="0000111101110";--494
constant    veblnk_720x480      :  factor_type :="0001000001100";--524

end;
原文地址:https://www.cnblogs.com/rickyli/p/10742085.html