inter 发表于 2010-6-28 00:15:24

【请教】Compile FIFO程序时有个错误 请大家帮我看看 谢谢了

本帖最后由 fpgaw 于 2011-7-30 13:43 编辑

Compile FIFO程序时有个错误 请大家帮我看看 谢谢了# Compile of fifo failed with 1 errors.

请大家帮我看看 下面这个代码 哪里错误了 我是初学者实在看不出哪里错误了十分感谢大家了

`timescale 1 ns/100 ps
//#############################################
//# Behavioral description of FIFO with :
//# Active High write enable (WE)
//# Active High read enable (RE)
//# Active Low asynchronous clear (Aclr)
//# Rising clock edge (Clock)
//# Active High Full Flag
//# Active Low Empty Flag
//#############################################
module reg_fifo(Data, Q, Aclr, Clock, WE, RE,
FF, EF);
parameter width = 8;
parameter depth = 8;
parameter addr = 3;
input Clock, WE, RE, Aclr;
input Data;
output FF, EF;//Full & Empty Flags
output Q;
reg Q;
reg mem_data ;
reg WAddress, RAddress;
reg FF, EF;
// ############################################
// # Write Functional Section
// ############################################
// WRITE_ADDR_POINTER
always@(posedge Clock or negedge Aclr)
begin
if(!Aclr)
WAddress = #2 0;
else if (WE)
WAddress = #2 WAddress + 1;
end
// WRITE_REG
always @(posedge Clock)
begin
if(WE)
mem_data = Data;
end
//#############################################
//# Read Functional Section
//#############################################
// READ_ADDR_POINTER
always@(posedge Clock or negedge Aclr)
begin
if(!Aclr)
RAddress = #1 0;
else if (RE)
RAddress = #1 RAddress + 1;
end
// READ_REG
always @(posedge Clock)
begin
if(RE)
Q = mem_data;
end
//#############################################
//# Full Flag Functional Section : Active high
//#############################################
always@(posedge Clock or negedge Aclr)
begin
if(!Aclr)
FF = #1 1'b0;
else if ( (WE & !RE) && ( (WAddress ==
RAddress-1) ||
( (WAddress == depth-1) && (RAddress ==
1'b0) ) ) )
FF = #1 1'b1;
else
FF = #1 1'b0;
end
//#############################################
//# Empty Flag Functional Section : Active low
//#############################################
always@(posedge Clock or negedge Aclr)
begin
if(!Aclr)
EF = #1 1'b0;
else if ( (!WE & RE) && ( (WAddress ==
RAddress+1) ||
( (RAddress == depth-1) && (WAddress ==
1'b0) ) ) )
EF = #1 1'b0;
else
EF = #1 1'b1;
end
endmodule

CHANG 发表于 2010-6-28 00:30:28

把错误的描述给出来吧,否则怎么找啊

Sunlife 发表于 2015-7-4 10:07:19


把错误的描述给出来吧,否则怎么找
页: [1]
查看完整版本: 【请教】Compile FIFO程序时有个错误 请大家帮我看看 谢谢了