📄 plb_npi_vga_controller.vhd
字号:
-------------------------------------------------------------------------------- plb_npi_vga_controller.vhd - entity/architecture pair-------------------------------------------------------------------------------- IMPORTANT:-- DO NOT MODIFY THIS FILE EXCEPT IN THE DESIGNATED SECTIONS.---- SEARCH FOR --USER TO DETERMINE WHERE CHANGES ARE ALLOWED.---- TYPICALLY, THE ONLY ACCEPTABLE CHANGES INVOLVE ADDING NEW-- PORTS AND GENERICS THAT GET PASSED THROUGH TO THE INSTANTIATION-- OF THE USER_LOGIC ENTITY.---------------------------------------------------------------------------------- ***************************************************************************-- ** Copyright (c) 1995-2007 Xilinx, Inc. All rights reserved. **-- ** **-- ** Xilinx, Inc. **-- ** XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" **-- ** AS A COURTESY TO YOU, 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. **-- ** **-- ***************************************************************************---------------------------------------------------------------------------------- Filename: plb_npi_vga_controller.vhd-- Version: 1.01.a-- Description: Top level design, instantiates library components and user logic.-- Date: Thu Dec 27 16:46:24 2007 (by Create and Import Peripheral Wizard)-- VHDL Standard: VHDL'93-------------------------------------------------------------------------------- Naming Conventions:-- active low signals: "*_n"-- clock signals: "clk", "clk_div#", "clk_#x"-- reset signals: "rst", "rst_n"-- generics: "C_*"-- user defined types: "*_TYPE"-- state machine next state: "*_ns"-- state machine current state: "*_cs"-- combinatorial signals: "*_com"-- pipelined or register delay signals: "*_d#"-- counter signals: "*cnt*"-- clock enable signals: "*_ce"-- internal version of output port: "*_i"-- device pins: "*_pin"-- ports: "- Names begin with Uppercase"-- processes: "*_PROCESS"-- component instantiations: "<ENTITY_>I_<#|FUNC>"------------------------------------------------------------------------------library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;library proc_common_v2_00_a;use proc_common_v2_00_a.proc_common_pkg.all;use proc_common_v2_00_a.ipif_pkg.all;library interrupt_control_v2_00_a;use interrupt_control_v2_00_a.interrupt_control;library plbv46_slave_single_v1_00_a;use plbv46_slave_single_v1_00_a.plbv46_slave_single;library plb_npi_vga_controller_v1_02_a;use plb_npi_vga_controller_v1_02_a.user_logic;-------------------------------------------------------------------------------- Entity section-------------------------------------------------------------------------------- Definition of Generics:-- C_BASEADDR -- PLBv46 slave: base address-- C_HIGHADDR -- PLBv46 slave: high address-- C_SPLB_AWIDTH -- PLBv46 slave: address bus width-- C_SPLB_DWIDTH -- PLBv46 slave: data bus width-- C_SPLB_NUM_MASTERS -- PLBv46 slave: Number of masters-- C_SPLB_MID_WIDTH -- PLBv46 slave: master ID bus width-- C_SPLB_NATIVE_DWIDTH -- PLBv46 slave: internal native data bus width-- C_SPLB_P2P -- PLBv46 slave: point to point interconnect scheme-- C_SPLB_SUPPORT_BURSTS -- PLBv46 slave: support bursts-- C_SPLB_SMALLEST_MASTER -- PLBv46 slave: width of the smallest master-- C_SPLB_CLK_PERIOD_PS -- PLBv46 slave: bus clock in picoseconds-- C_FAMILY -- Xilinx FPGA family---- Definition of Ports:-- SPLB_Clk -- PLB main bus clock-- SPLB_Rst -- PLB main bus reset-- PLB_ABus -- PLB address bus-- PLB_UABus -- PLB upper address bus-- PLB_PAValid -- PLB primary address valid indicator-- PLB_SAValid -- PLB secondary address valid indicator-- PLB_rdPrim -- PLB secondary to primary read request indicator-- PLB_wrPrim -- PLB secondary to primary write request indicator-- PLB_masterID -- PLB current master identifier-- PLB_abort -- PLB abort request indicator-- PLB_busLock -- PLB bus lock-- PLB_RNW -- PLB read/not write-- PLB_BE -- PLB byte enables-- PLB_MSize -- PLB master data bus size-- PLB_size -- PLB transfer size-- PLB_type -- PLB transfer type-- PLB_lockErr -- PLB lock error indicator-- PLB_wrDBus -- PLB write data bus-- PLB_wrBurst -- PLB burst write transfer indicator-- PLB_rdBurst -- PLB burst read transfer indicator-- PLB_wrPendReq -- PLB write pending bus request indicator-- PLB_rdPendReq -- PLB read pending bus request indicator-- PLB_wrPendPri -- PLB write pending request priority-- PLB_rdPendPri -- PLB read pending request priority-- PLB_reqPri -- PLB current request priority-- PLB_TAttribute -- PLB transfer attribute-- Sl_addrAck -- Slave address acknowledge-- Sl_SSize -- Slave data bus size-- Sl_wait -- Slave wait indicator-- Sl_rearbitrate -- Slave re-arbitrate bus indicator-- Sl_wrDAck -- Slave write data acknowledge-- Sl_wrComp -- Slave write transfer complete indicator-- Sl_wrBTerm -- Slave terminate write burst transfer-- Sl_rdDBus -- Slave read data bus-- Sl_rdWdAddr -- Slave read word address-- Sl_rdDAck -- Slave read data acknowledge-- Sl_rdComp -- Slave read transfer complete indicator-- Sl_rdBTerm -- Slave terminate read burst transfer-- Sl_MBusy -- Slave busy indicator-- Sl_MWrErr -- Slave write error indicator-- Sl_MRdErr -- Slave read error indicator-- Sl_MIRQ -- Slave interrupt indicator-- IP2INTC_Irpt -- Interrupt output to processor------------------------------------------------------------------------------entity plb_npi_vga_controller is generic ( -- ADD USER GENERICS BELOW THIS LINE --------------- --USER generics added here C_PI_ADDR_WIDTH : integer := 32; -- fixed for XIL_NPI components C_PI_DATA_WIDTH : integer := 64; -- fixed for XIL_NPI components (since mpmc3 also 32 allowed) C_PI_BE_WIDTH : integer := 8; -- fixed for XIL_NPI components (since mpmc3 also 4 allowed) C_PI_RDWDADDR_WIDTH: integer := 4;-- fixed for XIL_NPI components C_NPI_PIXEL_CLK_RATIO : integer := 4; C_USE_VGA_OUT : boolean := true; C_PIXEL_CLK_GREATER_65MHZ : boolean := false; -- ADD USER GENERICS ABOVE THIS LINE --------------- -- DO NOT EDIT BELOW THIS LINE --------------------- -- Bus protocol parameters, do not add to or delete C_BASEADDR : std_logic_vector := X"FFFFFFFF"; C_HIGHADDR : std_logic_vector := X"00000000"; C_SPLB_AWIDTH : integer := 32; C_SPLB_DWIDTH : integer := 128; C_SPLB_NUM_MASTERS : integer := 8; C_SPLB_MID_WIDTH : integer := 3; C_SPLB_NATIVE_DWIDTH : integer := 32; C_SPLB_P2P : integer := 0; C_SPLB_SUPPORT_BURSTS : integer := 0; C_SPLB_SMALLEST_MASTER : integer := 32; C_SPLB_CLK_PERIOD_PS : integer := 10000; C_FAMILY : string := "virtex5" -- DO NOT EDIT ABOVE THIS LINE --------------------- ); port ( -- ADD USER PORTS BELOW THIS LINE ------------------ --USER ports added here NPI_clk : in std_logic; NPI_rst : in std_logic; -- VGA/TFT signals clk_pixel : in std_logic; tft_lcd_hsync : out std_logic; tft_lcd_vsync : out std_logic; tft_lcd_r : out std_logic_vector(5 downto 2); tft_lcd_g : out std_logic_vector(5 downto 2); tft_lcd_b : out std_logic_vector(5 downto 2); tft_lcd_data : out std_logic_vector(11 downto 0); tft_lcd_de : out std_logic; tft_lcd_clk_n : out std_logic; tft_lcd_clk_p : out std_logic; tft_lcd_reset : out std_logic; tft_lcd_sda : out std_logic; tft_lcd_scl : out std_logic; -- MPMC Port Interface - Bus is prefixed with XIL_NPI_ XIL_NPI_Addr : out std_logic_vector(C_PI_ADDR_WIDTH-1 downto 0); XIL_NPI_AddrReq : out std_logic; XIL_NPI_AddrAck : in std_logic; XIL_NPI_RNW : out std_logic; XIL_NPI_Size : out std_logic_vector(3 downto 0); XIL_NPI_InitDone : in std_logic; XIL_NPI_WrFIFO_Data : out std_logic_vector(C_PI_DATA_WIDTH-1 downto 0); XIL_NPI_WrFIFO_BE : out std_logic_vector(C_PI_BE_WIDTH-1 downto 0); XIL_NPI_WrFIFO_Push : out std_logic; XIL_NPI_RdFIFO_Data : in std_logic_vector(C_PI_DATA_WIDTH-1 downto 0); XIL_NPI_RdFIFO_Pop : out std_logic; XIL_NPI_RdFIFO_RdWdAddr: in std_logic_vector(C_PI_RDWDADDR_WIDTH-1 downto 0); XIL_NPI_WrFIFO_AlmostFull: in std_logic; XIL_NPI_WrFIFO_Flush: out std_logic; XIL_NPI_RdFIFO_Empty: in std_logic; XIL_NPI_RdFIFO_Latency: in std_logic_vector(1 downto 0); XIL_NPI_RdFIFO_Flush: out std_logic; -- ADD USER PORTS ABOVE THIS LINE ------------------ -- DO NOT EDIT BELOW THIS LINE --------------------- -- Bus protocol ports, do not add to or delete SPLB_Clk : in std_logic; SPLB_Rst : in std_logic; PLB_ABus : in std_logic_vector(0 to 31); PLB_UABus : in std_logic_vector(0 to 31); PLB_PAValid : in std_logic; PLB_SAValid : in std_logic; PLB_rdPrim : in std_logic; PLB_wrPrim : in std_logic; PLB_masterID : in std_logic_vector(0 to C_SPLB_MID_WIDTH-1); PLB_abort : in std_logic; PLB_busLock : in std_logic; PLB_RNW : in std_logic; PLB_BE : in std_logic_vector(0 to C_SPLB_DWIDTH/8-1); PLB_MSize : in std_logic_vector(0 to 1); PLB_size : in std_logic_vector(0 to 3); PLB_type : in std_logic_vector(0 to 2); PLB_lockErr : in std_logic; PLB_wrDBus : in std_logic_vector(0 to C_SPLB_DWIDTH-1); PLB_wrBurst : in std_logic; PLB_rdBurst : in std_logic; PLB_wrPendReq : in std_logic; PLB_rdPendReq : in std_logic; PLB_wrPendPri : in std_logic_vector(0 to 1); PLB_rdPendPri : in std_logic_vector(0 to 1); PLB_reqPri : in std_logic_vector(0 to 1); PLB_TAttribute : in std_logic_vector(0 to 15); Sl_addrAck : out std_logic; Sl_SSize : out std_logic_vector(0 to 1); Sl_wait : out std_logic; Sl_rearbitrate : out std_logic; Sl_wrDAck : out std_logic; Sl_wrComp : out std_logic; Sl_wrBTerm : out std_logic; Sl_rdDBus : out std_logic_vector(0 to C_SPLB_DWIDTH-1); Sl_rdWdAddr : out std_logic_vector(0 to 3); Sl_rdDAck : out std_logic; Sl_rdComp : out std_logic; Sl_rdBTerm : out std_logic; Sl_MBusy : out std_logic_vector(0 to C_SPLB_NUM_MASTERS-1); Sl_MWrErr : out std_logic_vector(0 to C_SPLB_NUM_MASTERS-1); Sl_MRdErr : out std_logic_vector(0 to C_SPLB_NUM_MASTERS-1); Sl_MIRQ : out std_logic_vector(0 to C_SPLB_NUM_MASTERS-1); IP2INTC_Irpt : out std_logic -- DO NOT EDIT ABOVE THIS LINE --------------------- ); attribute SIGIS : string; attribute SIGIS of SPLB_Clk : signal is "CLK"; attribute SIGIS of SPLB_Rst : signal is "RST"; attribute SIGIS of IP2INTC_Irpt : signal is "INTR_LEVEL_HIGH";end entity plb_npi_vga_controller;-------------------------------------------------------------------------------- Architecture section------------------------------------------------------------------------------architecture IMP of plb_npi_vga_controller is ------------------------------------------ -- Array of base/high address pairs for each address range ------------------------------------------ constant ZERO_ADDR_PAD : std_logic_vector(0 to 31) := (others => '0'); constant USER_SLV_BASEADDR : std_logic_vector := C_BASEADDR or X"00000000"; constant USER_SLV_HIGHADDR : std_logic_vector := C_BASEADDR or X"000000FF"; constant INTR_BASEADDR : std_logic_vector := C_BASEADDR or X"00000100"; constant INTR_HIGHADDR : std_logic_vector := C_BASEADDR or X"000001FF"; constant IPIF_ARD_ADDR_RANGE_ARRAY : SLV64_ARRAY_TYPE := ( ZERO_ADDR_PAD & USER_SLV_BASEADDR, -- user logic slave space base address ZERO_ADDR_PAD & USER_SLV_HIGHADDR, -- user logic slave space high address ZERO_ADDR_PAD & INTR_BASEADDR, -- interrupt control space base address ZERO_ADDR_PAD & INTR_HIGHADDR -- interrupt control space high address ); ------------------------------------------ -- Array of desired number of chip enables for each address range ------------------------------------------ constant USER_SLV_NUM_REG : integer := 11; constant USER_NUM_REG : integer := USER_SLV_NUM_REG; constant INTR_NUM_CE : integer := 16; constant IPIF_ARD_NUM_CE_ARRAY : INTEGER_ARRAY_TYPE := ( 0 => pad_power2(USER_SLV_NUM_REG), -- number of ce for user logic slave space 1 => INTR_NUM_CE -- number of ce for interrupt control space ); ------------------------------------------ -- Ratio of bus clock to core clock (for use in dual clock systems) -- 1 = ratio is 1:1 -- 2 = ratio is 2:1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -