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

时间:2025-11-01  作者:Diven  阅读:0

1 概述

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

本设计已实用于国家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位的数据输出宽度。可以节约一定的成本,具有相当的灵活性和实用性。

猜您喜欢

LED灯以其节能、环保和长寿命的特点,已经成为现代照明的主流选择。然而,即使是寿命最长的LED灯,其电源驱动器也可能会出现故障。这时,与其直接更换整个灯具,不如...
2024-10-06 00:00:00


1、约束的目的介绍FPGA约束原理,理解约束的目的为设计服务,是为了保证设计满足时序要求,指导FPGA工具进行综合和实现,约束是Vivado等工具努力实现的目...
2018-06-25 09:14:00

贴片电阻的检测方法主要分为人工目测和机器检测两种类型。人工目测主要依靠肉眼和放大镜观察电阻的外观,例如检查是否有裂纹、缺损、变色等缺陷,以及标识是否清晰完整。这...
2024-11-29 10:26:10

贴片电阻,由于其小巧的体积,在电子电路中应用广泛。很多人好奇,这种小小的元件,它的阻值上限究竟是多少呢?一般来说,常见的贴片电阻阻值范围从几毫欧到几百兆欧不等。...
2024-11-26 11:29:59

贴片电容(MLCC)是应用于电子产品中的无极性电容器,其规格尺寸因应用需求而异。常见的贴片电容尺寸有0402、0603、0805、1206等,其中数字代表电容的...
2012-12-14 00:00:00

很多朋友发现自己的苹果手机充电出现问题后,都会担心是不是充电管理芯片坏了。的确,充电管理芯片掌管着手机充电的各个环节,一旦出现故障,就会出现各种充电问题。那么,...
2024-04-25 00:00:00

采样电阻作为电流检测的重要元件,是关键配件。捷比信作为业内知名品牌,其采样电阻产品以高精度和稳定性,应用于电源管理、电机驱动和电池监测等领域。本文将围绕“捷比信...
2014-12-04 17:49:30

电阻器作为基础元件,有着着非常重要的作用。随着电子技术的不断发展,对电阻器的性能要求也越来越高。融欣(JACKCON)作为一家知名的电子元器件制造商,其推出的四...
2013-09-23 10:32:30

贴片电阻,因其体积小巧,常被应用于各种电子电路中。如何快速识别这些微小的元件并理解其型号含义,对于电子爱好者和专业人士都至关重要。本文将简要介绍贴片电阻的识别方...
2024-11-26 11:29:23