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

📄 genericbr.vhd

📁 NAND FLASH 读写控制以及ECC的VHDL源程序
💻 VHD
字号:

-----------------------------------------------------
--		Begin BlockRAM
-----------------------------------------------------

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL;

 
 
-- Only XST supports RAM inference
-- Infers Single Port Block Ram 
 
entity BRgenericByte is

	generic( 


		AddressWIDTH : natural := 12;

		addressability : natural := 8;

		NumElements : natural := 2112);



	port (

		clk : in std_logic; 
		we  : in std_logic; 
		ADDR   : in std_logic_vector(AddressWIDTH - 1 downto 0); 
 		di  : in std_logic_vector(addressability - 1 downto 0); 
 		do  : out std_logic_vector(addressability - 1 downto 0)); 
end BRgenericByte; 
 
architecture syn of BRgenericByte is 



	type ram_type is array (NumElements - 1 downto 0) of std_logic_vector (addressability - 1 downto 0);

	signal RAM : ram_type;

	signal read_a : std_logic_vector(AddressWIDTH - 1 downto 0); 
 
begin

	process (clk) 
	begin 
		if (clk'event and clk = '1') then  
			if (we = '1') then 
 				RAM(conv_integer(ADDR)) <= di; 
 			end if; 
 			read_a <= ADDR; 
 		end if; 
	end process; 
 
	do <= RAM(conv_integer(read_a));

 
end syn;
 
-----------------------------------------------------
--		 End BlockRAM
-----------------------------------------------------

⌨️ 快捷键说明

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