Line 40... |
Line 40... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.2 2003/03/26 13:16:18 mihad
|
|
// Added the reset value parameter to the synchronizer flop module.
|
|
// Added resets to all synchronizer flop instances.
|
|
// Repaired initial sync value in fifos.
|
|
//
|
// Revision 1.1 2003/01/27 16:49:31 mihad
|
// Revision 1.1 2003/01/27 16:49:31 mihad
|
// Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
|
// Changed module and file names. Updated scripts accordingly. FIFO synchronizations changed.
|
//
|
//
|
// Revision 1.7 2002/11/27 20:36:10 mihad
|
// Revision 1.7 2002/11/27 20:36:10 mihad
|
// Changed the code a bit to make it more readable.
|
// Changed the code a bit to make it more readable.
|
Line 217... |
Line 222... |
// grey coded address pipeline for status generation in read clock domain
|
// grey coded address pipeline for status generation in read clock domain
|
always@(posedge rclock_in or posedge clear)
|
always@(posedge rclock_in or posedge clear)
|
begin
|
begin
|
if (clear)
|
if (clear)
|
begin
|
begin
|
rgrey_addr <= #`FF_DELAY 0 ;
|
rgrey_addr <= #1 0 ;
|
rgrey_next <= #`FF_DELAY 1 ; // this grey code is calculated from the current binary address and loaded any time data is read from fifo
|
rgrey_next <= #`FF_DELAY 1 ; // this grey code is calculated from the current binary address and loaded any time data is read from fifo
|
end
|
end
|
else if (flush_in)
|
else if (flush_in)
|
begin
|
begin
|
// when fifo is flushed, load the register values from the write clock domain.
|
// when fifo is flushed, load the register values from the write clock domain.
|
// must be no problem, because write pointers are stable for at least 3 clock cycles before flush can occur.
|
// must be no problem, because write pointers are stable for at least 3 clock cycles before flush can occur.
|
rgrey_addr <= #`FF_DELAY wgrey_addr ;
|
rgrey_addr <= #1 wgrey_addr ;
|
rgrey_next <= #`FF_DELAY wgrey_next ;
|
rgrey_next <= #`FF_DELAY wgrey_next ;
|
end
|
end
|
else if (rallow)
|
else if (rallow)
|
begin
|
begin
|
// move the pipeline when data is read from fifo and calculate new value for first stage of pipeline from current binary fifo address
|
// move the pipeline when data is read from fifo and calculate new value for first stage of pipeline from current binary fifo address
|
rgrey_addr <= #`FF_DELAY rgrey_next ;
|
rgrey_addr <= #1 rgrey_next ;
|
rgrey_next <= #`FF_DELAY {raddr[ADDR_LENGTH - 1], calc_rgrey_next} ;
|
rgrey_next <= #`FF_DELAY {raddr[ADDR_LENGTH - 1], calc_rgrey_next} ;
|
end
|
end
|
end
|
end
|
|
|
/*--------------------------------------------------------------------------------------------
|
/*--------------------------------------------------------------------------------------------
|
Line 245... |
Line 250... |
// grey coded address pipeline for status generation in write clock domain
|
// grey coded address pipeline for status generation in write clock domain
|
always@(posedge wclock_in or posedge clear)
|
always@(posedge wclock_in or posedge clear)
|
begin
|
begin
|
if (clear)
|
if (clear)
|
begin
|
begin
|
wgrey_addr <= #`FF_DELAY 0 ;
|
wgrey_addr <= #1 0 ;
|
wgrey_next <= #`FF_DELAY 1 ;
|
wgrey_next <= #`FF_DELAY 1 ;
|
end
|
end
|
else
|
else
|
if (wallow)
|
if (wallow)
|
begin
|
begin
|
wgrey_addr <= #`FF_DELAY wgrey_next ;
|
wgrey_addr <= #1 wgrey_next ;
|
wgrey_next <= #`FF_DELAY {waddr[(ADDR_LENGTH - 1)], calc_wgrey_next} ;
|
wgrey_next <= #`FF_DELAY {waddr[(ADDR_LENGTH - 1)], calc_wgrey_next} ;
|
end
|
end
|
end
|
end
|
|
|
// write address binary counter - nothing special except initial value
|
// write address binary counter - nothing special except initial value
|