用EEPROM對(duì)大容量FPGA芯片數(shù)據(jù)實(shí)現(xiàn)串行加載
雖然該程序是針對(duì)XCV100芯片及AT29C010A EEPROM設(shè)計(jì)的,但對(duì)于其他FPGA及EEPROM芯片同樣適用,不同的是針對(duì)不同容量的EEPROM,應(yīng)改變其地址計(jì)數(shù)器的位數(shù)。
Library IEEE;
Use IEEE.Std_logic_1164.a(chǎn)ll;
Use ieee.Std_logic_arith.all;
Use ieee.Std_logic_unsigned.all;
Entity v10sload is
port
pDATA in STD_LOGIC_VECTOR 7 downto 0
Paddress inout STD_LOGIC_VECTOR 16
Downto 0
CCLKIN in STD_LOGIC
RESET in STD_LOGIC
DATAINout STD_LOGIC
end v10sload
architecture v10sload_arch of v10sload is
signal loadin CE Nce CCLK8 Nreset nCCLK aDATAIN
bDATAIN std_logic
signal clkenable CCLK std_logic
signal ppDATA std_logic_vector 7 downto 0
component clk_div8
PORT
CLOCKASYNC_CTRL IN std_logic
CLK_OUT OUT std_logic
end component
component R_shift8
PORT
D_IN IN std_logic_vector 7 DOWNTO 0
LOAD IN std_logic
CLK_EN IN std_logic
CLOCK IN std_logic
LS_OUT OUT std_logic
end component
component BUFG
port I in std_logic O out std_logic
end component
begin
-------------------------------
--data-loading function statements here
nRESET<=not RESET
init_dataprocessRESET
begin
if RESET='0' then
ppDATA<=″00000000″
else ppDATA<=pDATA
end if
end process init_data
L0 BUFG port mapI=>CCLKIN O=>CCLK
nCCLK<=not CCLK
L1counter17 portmap
CLOCK=>CCLK8ASYNC_CTRL=>nRESET
Q_OUT=>pADDRESS
L2 clk_div8 portmap
CLOCK=>nCCLKASYNC_CTRL=>nRESET
CLK_OUT=>CCLK8
nCE<=not pADDRESS0
CE<=pADDRESS0
clkenable<='1'
L3R_shift8 portmap
D_IN=>ppDATALOAD=>nCECLK_EN=>
clkenableCLOCK=>nCCLK
LS_OUT=>aDATAIN
L4R_shift8 portmap
D_IN=>ppDATALOAD=>CECLK_EN=>
clkenableCLOCK=>nCCLK
LS_OUT=>bDATAIN
Process Adatain bDATAIN CE
begin
if CE='1' then DATAIN<=dDATAIN
else DATAIN<=bDATAIN
end if
end process
end v10sload_arch
參考文獻(xiàn)
1 XILINX 公司DATABOOK,199954~56
2 XILINX公司網(wǎng)站www.xilinx.com
3 王小軍.VHDL 簡(jiǎn)明教程.北京:清華大學(xué)出版社,1997
評(píng)論