导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→硬件:帮忙看看,我一点信心也没有了

* 9258: 硬件:帮忙看看,我一点信心也没有了

   UIL 
UIL发表的帖子 

 硬件:帮忙看看,我一点信心也没有了
 看看这VHDL的东西吧,什么错误?
Library ieee;
use ieee.std_logic_1164.all;

Entity fifo is 
port( 
datain:in std_logic_vector(6 downto 0);
dataout:out std_logic_vector(7 downto 0);
empty,full:out std_logic;
rd,wr,en,clk,clr:in std_logic
);
end fifo;

Architecture rtl of fifo is
type mem is array (0 to 15) of std_logic_vector(7 downto 0);
signal ram:mem;
signal in_full,in_empty:std_logic;
signal a:std_logic_vector(7 downto 0);
begin 

empty<=in_empty;
full<=in_full;
dataout<=a;

process(clk,clr,rd,en,wr)
variable wp:integer;
begin

if (clk'event and clk='1') then
if en='1'then
if clr='1' then
in_empty<='1';
in_full<='0';
wp:=0;
clear: for i in 0 to 15 loop
ram(i)<="00000000";
end loop clear;
a<="XXXXXXXX";
elsif wp<=15 and wp>=0 then
if in_empty='0' and rd='1' then
a<=ram(0);
for i in 1 to 15 loop
ram(i-1)<=ram(i);
end loop;
wp:=wp-1;

elsif wr='1' and in_full='0' then 
ram(wp)<=datain;此处有问题!!!
wp:=wp+1; 
end if;
end if;
end if;
end if;
if wp=16 then
in_full<='1';
end if;

if wp=-1 then
in_empty<='0';
end if ;
end process;
end rtl;
error messages:
bounds of non-constant index addressing array
reach beyond the bounds of the array.
为什么会这样?我的数组范围没有超过定义的值呀 

 

发表时间:2002年7月22日19:00:00

  
回复该帖

本主题共有 2 帖,分页:>>>>>该主题的所有内容[2]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

  27568.[详细]问题解决没有啊?
摘要:我也出现了这样的问题!!!......(26字)
- [二极管][522次] 2008年2月18日

[上一篇帖子]:你可以自己做个元件库
[下一篇帖子]:招聘单片机开发公司正在发展中,请访问www.langjie.com.cn 招聘单片机开发人员