Line 40... |
Line 40... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.4 2003/08/14 13:06:03 simons
|
|
// synchronizer_flop replaced with pci_synchronizer_flop, artisan ram instance updated.
|
|
//
|
// Revision 1.3 2003/07/29 08:20:11 mihad
|
// Revision 1.3 2003/07/29 08:20:11 mihad
|
// Found and simulated the problem in the synchronization logic.
|
// Found and simulated the problem in the synchronization logic.
|
// Repaired the synchronization logic in the FIFOs.
|
// Repaired the synchronization logic in the FIFOs.
|
//
|
//
|
// Revision 1.2 2003/03/26 13:16:18 mihad
|
// Revision 1.2 2003/03/26 13:16:18 mihad
|
Line 94... |
Line 97... |
full_out,
|
full_out,
|
empty_out,
|
empty_out,
|
waddr_out,
|
waddr_out,
|
raddr_out,
|
raddr_out,
|
rallow_out,
|
rallow_out,
|
wallow_out
|
wallow_out,
|
|
half_full_out ////Robert, burst issue
|
);
|
);
|
|
|
parameter ADDR_LENGTH = 7 ;
|
parameter ADDR_LENGTH = 7 ;
|
|
|
// independent clock inputs - rclock_in = read clock, wclock_in = write clock
|
// independent clock inputs - rclock_in = read clock, wclock_in = write clock
|
Line 124... |
Line 128... |
output [(ADDR_LENGTH - 1):0] waddr_out, raddr_out;
|
output [(ADDR_LENGTH - 1):0] waddr_out, raddr_out;
|
|
|
// read and write allow outputs
|
// read and write allow outputs
|
output rallow_out, wallow_out ;
|
output rallow_out, wallow_out ;
|
|
|
|
output half_full_out;
|
|
|
// read address register
|
// read address register
|
reg [(ADDR_LENGTH - 1):0] raddr ;
|
reg [(ADDR_LENGTH - 1):0] raddr ;
|
|
|
// write address register
|
// write address register
|
reg [(ADDR_LENGTH - 1):0] waddr;
|
reg [(ADDR_LENGTH - 1):0] waddr;
|
Line 160... |
Line 166... |
|
|
// at any clock edge that rallow is high, this register provides next read address, so wait cycles are not necessary
|
// at any clock edge that rallow is high, this register provides next read address, so wait cycles are not necessary
|
// when FIFO is empty, this register provides actual read address, so first location can be read
|
// when FIFO is empty, this register provides actual read address, so first location can be read
|
reg [(ADDR_LENGTH - 1):0] raddr_plus_one ;
|
reg [(ADDR_LENGTH - 1):0] raddr_plus_one ;
|
|
|
|
|
|
wire [ADDR_LENGTH :0] fifo_fullness; //Robert, burst issue
|
|
|
|
//Robert, burst issue
|
|
assign fifo_fullness = (waddr > raddr) ? ({1'b0, waddr} - {1'b0, raddr}) : ({1'b1, waddr} - {1'b0, raddr});
|
|
assign half_full_out = fifo_fullness[(ADDR_LENGTH - 1)] ;
|
|
//Robert, burst issue
|
|
|
|
|
// address output mux - when FIFO is empty, current actual address is driven out, when it is non - empty next address is driven out
|
// address output mux - when FIFO is empty, current actual address is driven out, when it is non - empty next address is driven out
|
// done for zero wait state burst
|
// done for zero wait state burst
|
assign raddr_out = rallow_out ? raddr_plus_one : raddr ;
|
assign raddr_out = rallow_out ? raddr_plus_one : raddr ;
|
|
|
always@(posedge rclock_in or posedge clear)
|
always@(posedge rclock_in or posedge clear)
|