首页 > 技术 > 内容

采用CPLD器件XC95288XL-7TQ144I芯片实现Flash读取控制设计

时间:2025-12-02  作者:Diven  阅读:0

1 概述

本设计已实用于国家863计划“可扩展到T比特的高性能IPv4/v6路由器基础平台及实验系统”项目中。其主要功能是对主控部分的FPGA读取Flash进行控制。

在本项目中,主控部分的FPGA在重启时需要从Flash中下载初始化程序。当下载完成后,FPGA仍会根据需要从Flash相应地址读取数据。这就要求在FPGA和Flash之间有一块控制逻辑来控制对Flash的读取。本设计就是完成的对这块控制逻辑的具体实现。

本文用VHDL语言在CPLD内部编程将其实现。本文第2节给出用VHDL语言在CPLD内部编程实现Flash读取的过程,第3节对全文进行概括。

2 实现

2.1 器件的选择

我们选用Xilinx公司XC9500XL 3.3V ISP 系列XC95288XL-7TQ144I芯片。XC95288xl是一个3.3V的低电压、高效的CPLD,在通信和计算机系统中的有的应用。包含16个54V18个功能块,提供了6400个可用的门电路,这些门电路的传播延时为6ns.

对于Flash,项目中选择了Intel公司的Intel StrataFlash系列的256-Mbit J3型Flash.其数据宽度可分别支持8位或者16位。

2.2 实现中的问题及解决方法

项目中选用的Flash的输出为16位,而向FPGA输出的数据为32位,因此产了数据宽度不匹配的问题,解决的方法有两种:

第一 使用两块相同的Flash,分别将其输出的数据送入FPGA接口的高16位和低16位;其缺点是需要增加一块Flash,从而成本增加。

第二 采用降低读取速度的方法,把从一块Flash中连续两次读取的16位数据拼接起来,组成一组32位的数据后送入FPGA接口。

出于对成本和复杂度的考虑,在此设计中我们采取了第二种方法加以实现。

2.3 基本设计模块图

2.4 用VHDL进行实现(注:实体部分定义可分别参见模块图中的划分)

Flash control 1

process(reset,gclk)

begin

if reset =‘0’ then

count_reset 《=‘0’;

elsif gclk‘event and gclk =’1‘ then

count_reset 《= not(count(4) and count(3) and count(2));

end if;

end process;

process(count_reset,gclk)

begin

if count_reset =’0‘ then

count 《=(others =》’0‘);

elsif gclk’event and gclk =‘1’ then

count 《=count +1;

end if;

end process;

process(count_reset,reset,enable)

begin

if reset =‘0’ then

F_CS 《=‘1’;

F_OE 《=‘1’;

F_WE 《=‘1’;

elsif count_reset =‘0’ then

F_CS 《= ‘1’;

F_OE 《= ‘1’;

F_WE 《= ‘1’;

elsif enable‘event and enable =’1‘ then

F_Abus 《= C_Abus;

F_CS 《= ’0‘;

F_OE 《= ’0‘;

F_WE 《= ’1‘;

C_Dbus 《= F_Dbus;

end if;

end process;

Flash control 2

d_count_rst 《= not(d_count(1) and (not d_count(0)) and empty);

sig_WD 《= not(d_count(1) and (not d_count(0)));

WR_DATA 《= sig_WD;

process(gclk,d_count)

begin

if reset =’0‘ then

d_count 《= ’1‘;

elsif F_CS = ’1‘ then

d_count1 《= not d_count1 ;

if gclk’event and gclk =‘1’ then

d_count2 《= d_count1;

d_count 《= d_count2;

end if;

end if;

end process;

process(reset,d_count,C_Dbus)

begin

if reset = ‘0’ then

data_adder 《= (others =》‘0’);

elsif d_count‘event and d_count = ’0‘ then

data_adder(31 downto 16) 《= C_Dbus;

elsif d_count’event and d_count = ‘1’ then

data_adder(15 downto 0) 《= C_Dbus;

end if;

end process;

enable 《= enable1 and enable2;

process(reset,d_count,F_CS)

begin

if reset = ‘0’ or F_CS = ‘0’ then

enable1 《= ‘1’;

enable2 《= ‘1’;

elsif d_count‘event then

if gclk’event and gclk =‘1’ then

enable1 《= ‘0’;

enable2 《= not enable1;

end if;

end if;

end process;

process(reset,F_CS)

begin

if reset = ‘0’ then

address《= X“400000”;

elsif F_CS = ‘1’ then

C_Abus 《= address;

address 《= adderss +1;

end if;

end process;

process(reset,F_CS)

begin

if reset = ‘0’ then

address《= X“400000”;

data_adder 《=(others =》‘0’);

elsif F_CS = ‘1’;

address 《= adderss +1;

end if;

end process;

process(d_count2,F_CS)

begin

if F_CS = ‘0’ then

enable1 《= ‘1’;

enable 《= ‘1’;

elsif d_count2 = “00” or d_count2 = “01” then

enable 《= ‘0’;

end if;

end process;

process(gclk,sig_WD)

begin

if sig_WD = ‘1’ then

Pulse_RW 《=‘1’;

elsif gclk‘event and gclk =’1‘ then

W_D1 《= sig_WD;

W_D2 《= W_D1;

if empty =’0‘ then

data_adder1 《= data_adder;

Pulse_RW 《= (W_D1 or (not W_D2));

end if;

end if;

end process;

(注:此程序在Xilinx公司的ISE6.2i环境下用VHDL编程实现,其仿真波形见下图)

3 结束语

在实际应用中,以此CPLD对Flash的读取进行控制。仿真结果及最后的实际调试都表明该设计符合项目的要求。在程序中通过对读取的记数控制,本设计可以在不增加Flash片数的情况下支持16/32/64位的数据输出宽度。可以节约一定的成本,具有相当的灵活性和实用性。

猜您喜欢


2023-06-22 22:59:50
电阻器作为基础且关键的元件,其性能直接影响着电子设备的稳定性和寿命。升功率电阻因其能够承受较大功率负载,应用于电源、电机控制、功率放大等领域。ROYALOHM(...
2020-03-10 01:50:30
采样电阻作为关键的电子元件,应用于电流检测、电源管理以及信号调节等领域。随着市场上采样电阻品牌的不断增多,SEI(世达柏科技)作为一个专业的电子元器件制造商,其...
2015-02-24 19:11:30
隔离式栅极驱动器是现代电子设备中不可少的组件,应用于电力电子和工业控制领域。其主要参数决定了驱动器的性能和适用性。输出电压范围是关键参数,通常在15V到30V之...
2020-08-07 00:00:00
耦合器作为连接两个系统或组件的重要装置,其种类繁多,各具特色。按照工作原理的不同,耦合器可以分为机械耦合器和电气耦合器。机械耦合器主要用于传递旋转动力,如联轴器...
2008-06-07 00:00:00
贴片电阻,电子产品中很重要的小元件,的阻值大小就由标称来表示。别被那些数字和字母吓到,理解起来其实很简单!对于常见的三位数标称,例如102,前两位数字代表有效数...
2024-11-29 10:25:37
IGBT管/模块是现代电力电子技术中不可少的关键组件,其性能参数直接影响到电路的效率和可靠性。主要参数包括:1. **额定电压**:指IGBT能够承受的最大电压...
2008-03-20 00:00:00
对电阻器的性能和规格要求也日益提高。作为国内知名的电子元器件制造商,智宝(TEAPO)在升功率电阻领域拥有丰富的产品线和技术优势。本文将围绕“智宝(TEAPO)...
2023-12-13 01:56:44
贴片电阻上的「4303」并不是直接表示阻值,而是采用数字编码表示法。其中,前两位数字「43」代表有效数字,后两位数字「03」代表10的幂次方。具体来说,「43」...
2024-11-26 11:29:58