s3esk_lcd.vhd
来自「基于spartan3e的LCD显示程序,可直接将其bit文件烧写到spartan」· VHDL 代码 · 共 466 行 · 第 1/2 页
VHD
466 行
-------------------------------------------------------------------------------- opb_lcd.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-2006 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: opb_lcd.vhd-- Version: 1.00.a-- Description: Top level design, instantiates IPIF and user logic.-- Date: Fri Jun 23 10:28:48 2006 (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 opb_ipif_v3_01_c;use opb_ipif_v3_01_c.all;library s3esk_lcd_v1_00_a;use s3esk_lcd_v1_00_a.all;-------------------------------------------------------------------------------- Entity section-------------------------------------------------------------------------------- Definition of Generics:-- C_BASEADDR -- User logic base address-- C_HIGHADDR -- User logic high address-- C_OPB_AWIDTH -- OPB address bus width-- C_OPB_DWIDTH -- OPB data bus width-- C_USER_ID_CODE -- User ID to place in MIR/Reset register-- C_FAMILY -- Target FPGA architecture---- Definition of Ports:-- OPB_Clk -- OPB Clock-- OPB_Rst -- OPB Reset-- Sl_DBus -- Slave data bus-- Sl_errAck -- Slave error acknowledge-- Sl_retry -- Slave retry-- Sl_toutSup -- Slave timeout suppress-- Sl_xferAck -- Slave transfer acknowledge-- OPB_ABus -- OPB address bus-- OPB_BE -- OPB byte enable-- OPB_DBus -- OPB data bus-- OPB_RNW -- OPB read/not write-- OPB_select -- OPB select-- OPB_seqAddr -- OPB sequential address-- IP2INTC_Irpt -- Interrupt output to processor------------------------------------------------------------------------------entity s3esk_lcd is generic ( -- ADD USER GENERICS BELOW THIS LINE --------------- --USER generics added here -- 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"00000000"; C_HIGHADDR : std_logic_vector := X"0000FFFF"; C_OPB_AWIDTH : integer := 32; C_OPB_DWIDTH : integer := 32; C_USER_ID_CODE : integer := 3; C_FAMILY : string := "virtex2p" -- DO NOT EDIT ABOVE THIS LINE --------------------- ); port ( -- ADD USER PORTS BELOW THIS LINE ------------------ --USER ports added here lcd_DATA :out std_logic_vector(7 downto 4);--inout std_logic_vector ( 7 downto 4 ); lcd_E :out std_logic; lcd_RS :out std_logic; lcd_RW :out std_logic; strata_CE :out std_logic; led :out std_logic_vector (7 downto 0); -- ADD USER PORTS ABOVE THIS LINE ------------------ -- DO NOT EDIT BELOW THIS LINE --------------------- -- Bus protocol ports, do not add to or delete OPB_Clk : in std_logic; OPB_Rst : in std_logic; Sl_DBus : out std_logic_vector(0 to C_OPB_DWIDTH-1); Sl_errAck : out std_logic; Sl_retry : out std_logic; Sl_toutSup : out std_logic; Sl_xferAck : out std_logic; OPB_ABus : in std_logic_vector(0 to C_OPB_AWIDTH-1); OPB_BE : in std_logic_vector(0 to C_OPB_DWIDTH/8-1); OPB_DBus : in std_logic_vector(0 to C_OPB_DWIDTH-1); OPB_RNW : in std_logic; OPB_select : in std_logic; OPB_seqAddr : in std_logic; IP2INTC_Irpt : out std_logic -- DO NOT EDIT ABOVE THIS LINE --------------------- ); attribute SIGIS : string; attribute SIGIS of OPB_Clk : signal is "Clk"; attribute SIGIS of OPB_Rst : signal is "Rst"; attribute SIGIS of IP2INTC_Irpt : signal is "INTR_LEVEL_HIGH";end entity s3esk_lcd;-------------------------------------------------------------------------------- Architecture section------------------------------------------------------------------------------architecture IMP of s3esk_lcd is ------------------------------------------ -- Constant: array of address range identifiers ------------------------------------------ constant ARD_ID_ARRAY : INTEGER_ARRAY_TYPE := ( 0 => USER_00, -- user logic S/W register address space 1 => IPIF_RST, -- include IPIF S/W Reset/MIR service 2 => IPIF_INTR -- include IPIF Interrupt service ); ------------------------------------------ -- Constant: array of address pairs for each address range ------------------------------------------ constant ZERO_ADDR_PAD : std_logic_vector(0 to 64-C_OPB_AWIDTH-1) := (others => '0'); constant USER_BASEADDR : std_logic_vector := C_BASEADDR or X"00000000"; constant USER_HIGHADDR : std_logic_vector := C_BASEADDR or X"000000FF"; constant RST_BASEADDR : std_logic_vector := C_BASEADDR or X"00000100"; constant RST_HIGHADDR : std_logic_vector := C_BASEADDR or X"000001FF"; constant INTR_BASEADDR : std_logic_vector := C_BASEADDR or X"00000200"; constant INTR_HIGHADDR : std_logic_vector := C_BASEADDR or X"000002FF"; constant ARD_ADDR_RANGE_ARRAY : SLV64_ARRAY_TYPE := ( ZERO_ADDR_PAD & USER_BASEADDR, -- user logic base address ZERO_ADDR_PAD & USER_HIGHADDR, -- user logic high address ZERO_ADDR_PAD & RST_BASEADDR, -- MIR/Reset register base address ZERO_ADDR_PAD & RST_HIGHADDR, -- MIR/Reset register high address ZERO_ADDR_PAD & INTR_BASEADDR, -- interrupt register base address ZERO_ADDR_PAD & INTR_HIGHADDR -- interrupt register high address ); ------------------------------------------ -- Constant: array of data widths for each target address range ------------------------------------------ constant USER_DWIDTH : integer := 32; constant ARD_DWIDTH_ARRAY : INTEGER_ARRAY_TYPE := ( 0 => USER_DWIDTH, -- user logic data width 1 => C_OPB_DWIDTH, -- MIR/Reset register data width 2 => C_OPB_DWIDTH -- interrupt register data width ); ------------------------------------------ -- Constant: array of desired number of chip enables for each address range ------------------------------------------ constant USER_NUM_CE : integer := 2; constant ARD_NUM_CE_ARRAY : INTEGER_ARRAY_TYPE := ( 0 => pad_power2(USER_NUM_CE), -- user logic number of CEs 1 => 1, -- MIR/Reset register - 1 CE 2 => 16 -- interrupt register - 16 CEs ); ------------------------------------------ -- Constant: array of unique properties for each address range ------------------------------------------ constant USER_INCLUDE_DEV_ISC : boolean := false; constant USER_INCLUDE_DEV_PENCODER : boolean := false; constant ARD_DEPENDENT_PROPS_ARRAY : DEPENDENT_PROPS_ARRAY_TYPE := ( 0 => (others => 0), -- user logic slave space dependent properties (none defined) 1 => (others => 0), -- IPIF reset/mir dependent properties (none defined) 2 => ( -- IPIF interrupt dependent properties EXCLUDE_DEV_ISC => 1-boolean'pos(USER_INCLUDE_DEV_ISC),
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?