编译错译!
[求助]编译错译!
端口的数据宽度不匹配,要看具体的代码
[求助]编译错译!
源代码如下,请小编指点,谢谢了!
library IEEE;
use IEEE.Std_logic_1164.all;
entity FIFOMXN is
generic(m, n : Positive := 8); --m is fifo depth, n is fifo width
port(RESET, WRREQ, RDREQ, CLOCK : in Std_logic;
DATAIN : in Std_logic_vector((n-1) downto 0);
DATAOUT : out Std_logic_vector((n-1) downto 0);
FULL, EMPTY : inout Std_logic);
end FIFOMXN;
architecture V2 of FIFOMXN is
type Fifo_array is array(0 to (m-1)) of Bit_vector((n-1) downto 0);
signal Fifo_memory : Fifo_array;
signal Wraddr, Rdaddr, Offset : Natural range 0 to (m-1);
signal Rdpulse, Wrpulse, Q1, Q2, Q3, Q4 : Std_logic;
signal Databuffer : Bit_vector((n-1) downto 0);
begin
sync_ffs : process
begin
wait until rising_edge(CLOCK);
Q1 <= WRREQ;
Q2 <= Q1;
Q3 <= RDREQ;
Q4 <= Q3;
end process;
Wrpulse <= Q2 and not(Q1);
Rdpulse <= Q4 and not(Q3);
Fifo_read : process
begin
wait until rising_edge(CLOCK);
if RESET = '1' then
Rdaddr <= 0;
Databuffer <= (others => '0');
elsif (Rdpulse = '1' and EMPTY = '0') then
Databuffer <= Fifo_memory(Rdaddr);
Rdaddr <= (Rdaddr + 1) mod m;
end if;
end process;
Fifo_write : process
begin
wait until rising_edge(CLOCK);
if RESET = '1' then
Wraddr <= 0;
elsif (Wrpulse = '1' and FULL = '0') then
Fifo_memory(Wraddr) <= To_Bitvector(DATAIN);
Wraddr <= (Wraddr + 1) mod m;
end if;
end process;
Offset <= (Wraddr - Rdaddr) when (Wraddr > Rdaddr)
else (m - (Rdaddr - Wraddr)) when (Rdaddr > Wraddr)
else 0;
EMPTY <= '1' when (Offset = 0) else '0';
FULL <= '1' when (Offset = (m-1)) else '0';
DATAOUT <= To_Stdlogicvector(Databuffer) when RDREQ = '0'
else (others => 'Z');
end V2;
[求助]编译错译!
再次请教小编,在我打开一VHD文件时,出现如下提示:Your project's ACF contains syntax errors--Altera recommends correcting these syntax errors before continuing work on the project.不知这是由于什么原因造成的,还有上面提到的ACF指的什么呢?
请小编赐教,谢了!
[求助]编译错译!
生成你这个程序里面用了很多行为描述语句,比如fifo的二维数组类型和mod运算符,这些东西很难综合,特别是你只用altera自带的综合器的时候。
你从网上下的这个程序比较适合仿真,但是想要综合实现还要自己写。最好直接调用altera的fifo。
acf文件是altera自己定义的一种文件格式,用来给布局布线做约束用的。
[求助]编译错译!
再次谢过小编了!
[求助]编译错译!
再问,当我对程序进行仿真时,可以实现数据的输出,但当数据输出以后,后面又跟着输出"0000",不知这是怎么造成的,该如何解决?
请教小编,谢了!