OpenCores
URL https://opencores.org/ocsvn/can/can/trunk

Subversion Repositories can

[/] [can/] [trunk/] [rtl/] [verilog/] [can_fifo.v] - Diff between revs 137 and 152

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 137 Rev 152
Line 48... Line 48...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.26  2004/02/08 14:30:57  mohor
 
// Header changed.
 
//
// Revision 1.25  2003/10/23 16:52:17  mohor
// Revision 1.25  2003/10/23 16:52:17  mohor
// Active high/low problem when Altera devices are used. Bug fixed by
// Active high/low problem when Altera devices are used. Bug fixed by
// Rojhalat Ibrahim.
// Rojhalat Ibrahim.
//
//
// Revision 1.24  2003/10/17 05:55:20  markom
// Revision 1.24  2003/10/17 05:55:20  markom
Line 262... Line 265...
  if (rst)
  if (rst)
    wr_info_pointer <= 6'h0;
    wr_info_pointer <= 6'h0;
  else if (write_length_info & (~info_full) | initialize_memories)
  else if (write_length_info & (~info_full) | initialize_memories)
    wr_info_pointer <=#Tp wr_info_pointer + 1'b1;
    wr_info_pointer <=#Tp wr_info_pointer + 1'b1;
  else if (reset_mode)
  else if (reset_mode)
    wr_info_pointer <=#Tp 6'h0;
    wr_info_pointer <=#Tp rd_info_pointer;
end
end
 
 
 
 
 
 
// rd_info_pointer
// rd_info_pointer
always @ (posedge clk or posedge rst)
always @ (posedge clk or posedge rst)
begin
begin
  if (rst)
  if (rst)
    rd_info_pointer <= 6'h0;
    rd_info_pointer <= 6'h0;
  else if (reset_mode)
 
    rd_info_pointer <=#Tp 6'h0;
 
  else if (release_buffer & (~fifo_empty))
  else if (release_buffer & (~fifo_empty))
    rd_info_pointer <=#Tp rd_info_pointer + 1'b1;
    rd_info_pointer <=#Tp rd_info_pointer + 1'b1;
end
end
 
 
 
 
Line 286... Line 287...
begin
begin
  if (rst)
  if (rst)
    rd_pointer <= 5'h0;
    rd_pointer <= 5'h0;
  else if (release_buffer & (~fifo_empty))
  else if (release_buffer & (~fifo_empty))
    rd_pointer <=#Tp rd_pointer + {2'h0, length_info};
    rd_pointer <=#Tp rd_pointer + {2'h0, length_info};
  else if (reset_mode)
 
    rd_pointer <=#Tp 5'h0;
 
end
end
 
 
 
 
// wr_pointer
// wr_pointer
always @ (posedge clk or posedge rst)
always @ (posedge clk or posedge rst)
begin
begin
  if (rst)
  if (rst)
    wr_pointer <= 5'h0;
    wr_pointer <= 5'h0;
 
  else if (reset_mode)
 
    wr_pointer <=#Tp rd_pointer;
  else if (wr & (~fifo_full))
  else if (wr & (~fifo_full))
    wr_pointer <=#Tp wr_pointer + 1'b1;
    wr_pointer <=#Tp wr_pointer + 1'b1;
  else if (reset_mode)
 
    wr_pointer <=#Tp 5'h0;
 
end
end
 
 
 
 
// latch_overrun
// latch_overrun
always @ (posedge clk or posedge rst)
always @ (posedge clk or posedge rst)
Line 320... Line 319...
// Counting data in fifo
// Counting data in fifo
always @ (posedge clk or posedge rst)
always @ (posedge clk or posedge rst)
begin
begin
  if (rst)
  if (rst)
    fifo_cnt <= 7'h0;
    fifo_cnt <= 7'h0;
 
  else if (reset_mode)
 
    fifo_cnt <=#Tp 7'h0;
  else if (wr & (~release_buffer) & (~fifo_full))
  else if (wr & (~release_buffer) & (~fifo_full))
    fifo_cnt <=#Tp fifo_cnt + 1'b1;
    fifo_cnt <=#Tp fifo_cnt + 1'b1;
  else if ((~wr) & release_buffer & (~fifo_empty))
  else if ((~wr) & release_buffer & (~fifo_empty))
    fifo_cnt <=#Tp fifo_cnt - {3'h0, length_info};
    fifo_cnt <=#Tp fifo_cnt - {3'h0, length_info};
  else if (wr & release_buffer & (~fifo_full) & (~fifo_empty))
  else if (wr & release_buffer & (~fifo_full) & (~fifo_empty))
    fifo_cnt <=#Tp fifo_cnt - {3'h0, length_info} + 1'b1;
    fifo_cnt <=#Tp fifo_cnt - {3'h0, length_info} + 1'b1;
  else if (reset_mode)
 
    fifo_cnt <=#Tp 7'h0;
 
end
end
 
 
assign fifo_full = fifo_cnt == 7'd64;
assign fifo_full = fifo_cnt == 7'd64;
assign fifo_empty = fifo_cnt == 7'd0;
assign fifo_empty = fifo_cnt == 7'd0;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.