Line 48... |
Line 48... |
//----------------------------------
|
//----------------------------------
|
//----Input
|
//----Input
|
//----------------------------------
|
//----------------------------------
|
input wire [FPW-1:0] tail ,
|
input wire [FPW-1:0] tail ,
|
input wire [(FPW*32)-1:0] d_in ,
|
input wire [(FPW*32)-1:0] d_in ,
|
input wire [FPW-1:0] valid ,
|
|
|
|
//----------------------------------
|
//----------------------------------
|
//----Output
|
//----Output
|
//----------------------------------
|
//----------------------------------
|
output reg [31:0] crc_out
|
output reg [31:0] crc_out
|
Line 74... |
Line 73... |
|
|
`ifdef ASYNC_RES
|
`ifdef ASYNC_RES
|
always @(posedge clk or negedge res_n) `else
|
always @(posedge clk or negedge res_n) `else
|
always @(posedge clk) `endif
|
always @(posedge clk) `endif
|
begin
|
begin
|
|
`ifdef RESET_ALL
|
if (!res_n) begin
|
if (!res_n) begin
|
crc_out <= 32'h0;
|
crc_out <= 32'h0;
|
crc_temp[0] <= 32'h0;
|
end else
|
end
|
`endif
|
else begin
|
begin
|
crc_out <= 32'h0;
|
crc_out <= 32'h0;
|
|
|
for(i_f=0;i_f<FPW;i_f=i_f+1) begin
|
for(i_f=0;i_f<FPW;i_f=i_f+1) begin
|
if(tail[i_f]) begin
|
if(tail[i_f]) begin
|
crc_out <= crc_temp[i_f+1];
|
crc_out <= crc_temp[i_f+1];
|
end
|
end
|
end
|
end
|
|
|
if(|tail) begin
|
|
crc_temp[0] <= 32'h0;
|
|
end else begin
|
|
crc_temp[0] <= crc_temp[FPW];
|
|
end
|
end
|
end
|
end
|
|
|
|
`ifdef ASYNC_RES
|
|
always @(posedge clk or negedge res_n) `else
|
|
always @(posedge clk) `endif
|
|
begin
|
|
if (!res_n)
|
|
crc_temp[0] <= 32'h0;
|
|
else
|
|
crc_temp[0] <= |tail ? 32'h0 : crc_temp[FPW];
|
end
|
end
|
|
|
always @(*)
|
always @(*)
|
begin
|
begin
|
for(i_f=0;i_f<FPW;i_f=i_f+1) begin
|
for(i_f=0;i_f<FPW;i_f=i_f+1) begin
|