用RAM 的IP核进行读写操作,要用数组将写进ram的值存储下来,下面是代码,编译不通过,出现Error (10476): VHDL error at testRam.vhd(61): type of identifier "datain" does not agree with its usage as "integer" type是我的输入的数据和地址都应该换成整数输入么?
TYPE matrix_index is array (31 downto 0) of std_logic_vector(31 downto 0);
SIGNAL men_data: matrix_index;
begin
process(clock,rst)
begin
if(clock='1'and clock'event) then
if(rst='1')then
count <=(others=>'0');
else
if wren='0'then
count <= count +1;
end if;
end if;
end if;
if(clock='1'and clock'event) then
if(rst='1')then
datain<=(others=>'0');
address1<=(others=>'0');
else
if wren='1'then --写有效
datain<=datain+1;
address1<=address1+1;
men_data(datain)<=datain;
else --读有效 读出某个地址上的数据
address1<=men_data(count);
end if;
end if;
end if;
end process;
此帖出自
小平头技术问答
一周热门 更多>