⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 top.vhdl

📁 FPGA向CY7C68013接收发送数据的代码,可以用LED显示
💻 VHDL
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;

entity top is
  port( clk  : in std_logic;
        slwr: buffer std_logic;
	   pktend: out std_logic;
	   fifoaddr: out std_logic_vector(1 downto 0);
	   fifodata: out std_logic_vector(7 downto 0);
        full_flag : in std_logic	  -- FLAGB pin
	   ) ;       
end top;

architecture Behavioral of top is

signal  i   : std_logic_vector(7 downto 0):="00000000";

signal  inclk: std_logic;
signal flag,inslwr:   std_logic;

begin

process(clk)
  begin
    	if clk'event and clk='1' then
	  inclk<=not inclk; 
	end if;
end process;

fifoaddr<="10";	-- EP6
slwr<=inclk and inslwr;

pktend<='1';	
flag<=full_flag; 	--and start;

process(inclk)
begin
    if(inclk'event and inclk='0') then

     if flag='1' then	   -- check full flag

		fifodata<=i;	   -- not full, drive data to bus
		inslwr<='1';      -- assert then deassert SLWR
		i<=i+'1';
			 
     else 
	  	inslwr<='0';
     end if;

    end if;
end process;
end 	 Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -