\n'; Text += '
'; Text += ' \n'; Text += '
'; Text += '\n'; for (var i=0;i<(extra_info[extra_info_index].length-1);i++) { Text += hbutton(sig_buttons[i], 'opener.location=loc[sel.selectedIndex]['+i+'];', bnum++); } Text += hbutton("Search Backwards", 'opener.search(sel.options[ sel.selectedIndex ].text,' + '0,opener.last_link,-1,0);',bnum++); Text += hbutton("Search Forwards", 'opener.search(sel.options[ sel.selectedIndex ].text,' + '0,opener.last_link, 1,0);',bnum++); Text += hbutton("Close","window.close();",bnum++); Text += '
\n'; Text += '
Hosted by www.Geocities.ws

\n'; w.document.open(); w.document.write(Text); w.document.close(); w.document.forms[0].elements[0].options[0].text = linkText; w.sel = w.document.forms[0].elements[0]; for (j=0;j<10;j++) w.loc[j] = new Array(sig_buttons.length); copy_into_loc0(w,extra_info_index); } else { if ((window.location.pathname.substring(0,window.location.pathname.lastIndexOf(dirSep)))!= (w.location.pathname.substring(0,w.location.pathname.lastIndexOf(dirSep)))) { w.close(); if (is_nav4up) return qs(e,t,extra_info_index); else return false; } var opts = w.document.forms[0].elements[0].options; if ( opts.length<10 ) { w.loc[opts.length] = new Array; opts.length++; } for (i=opts.length-2;i>=0;i--) { opts[i+1].text=opts[i].text; for (var j=0;j' + ' '+text+'\n'; } function copy_into_loc0 (w,extra_info_index) { for (var i=1;i=0;i+=inc) { linkText = is_nav4up ? document.links[i].text : document.links[i].innerText; linkY = is_nav4up ? document.links[i].y : document.links[i].offsetTop; if ((linkText == text) && (linkY != y)) { window.status=""; if (is_nav4up) if (relative) window.scrollBy(0,linkY - y); else window.scrollTo(0,linkY); else if (is_ie4up) document.links[i].scrollIntoView(true); last_link=i; last_class=document.links[i].className; document.links[i].className='HI'; return false; } } nextpage = (inc==1) ? next_page() : prev_page(); wrappage = (inc==1) ? first_page() : last_page(); if (nextpage!="" || wrappage!="") { if (nextpage=="") { if (!confirm(text + " not found. Search again from "+((inc==1)?"first":"last")+" page?")) return false; nextpage=wrappage; } location=nextpage+ "?" + escape(text) + "&" + ( y - window.pageYOffset ) + "&" + inc; return false; } if (confirm(text + " not found. Search again from "+((inc==1)?"start":"end")+"?")) { if (inc==1) i=-1; else i=document.links.length; } else return false; } return true; } function loadqs() { var opt=location.search, text="", s="", y=0, si=0, inc=1; if (opt.length==0) return true; for (var i=1;i
//
// fifologic.V
// 
// FIFOLOGIC provides the interface to interact with the FIFO module.
// FIFO module is actually a 16*32 bits RAM. 
// The module instantiate 'FIFO.v'
// FIFOLOGIC has the ability to handle push and pop signals, even if 
// they occur simultaneously.

[Up: bismillah FIFOLOGIC1]
module fifologicIndex(
             FCLK,             //Clock with frequency twice that of BCLK(200 MHz).
             FIFO_MODE,        //High for reception mode. 
             push,             //Write signal to FIFO
             pop,              //Read signal to FIFO.
             reset_n,          //
             TCL_IN,           //Input from transaction control logic
             TCL_OUT,          //Output to transaction  control logic.
             RT_IN,			   //Input from receiver
			 RT_OUT,           //Output to transmitter
			 status,		   //High when FIFO is not empty,			
			 fmode			   //High for reception mode.            
            );


input [31:0] TCL_IN,RT_IN;
wire  [31:0] TCL_IN,RT_IN;
output[31:0] TCL_OUT,RT_OUT;
wire   [31:0] TCL_OUT,RT_OUT;

input FCLK, push, pop, FIFO_MODE, reset_n;
wire  FCLK, push, pop, FIFO_MODE, reset_n;

output status;

reg [3:0] counter_W,counter_R;


output fmode;
reg status;
reg    fmode,RE,WE,WE_disable,push_save;
reg	[31:0] latch;
reg		  latch_signal;		

wire [3:0] Address;
wire [31:0] Q,Data;
assign Address = (WE) ? counter_W : counter_R;
assign Data = (fmode) ? RT_IN : TCL_IN;


// Instiation of FIFO RAM.
fifo f1(Address, FCLK, FCLK,WE, Data, Q);


always @(posedge FCLK or negedge reset_n)
begin
   if(!reset_n)
     status <= 1'b0;
   else 
    if(counter_W != counter_R)
		status <= 1'b1; 
	else if( (counter_R == counter_W) && !push_save )
	 	status <= 1'b0;
	 		
end

// Address of the current available empty location.
always @(negedge WE or negedge reset_n)
begin
   if(!reset_n)
     counter_W <= 4'h0;
   else 
     counter_W <= counter_W + 1;
end

// Generation of read enable signal to FIFO. 
always @(negedge FCLK or negedge reset_n)
begin
   if(!reset_n)
     RE <= 1'b0;
   else if(pop)
     RE <= 1'b1;
   else
     RE <= 1'b0;
end

//Address of the location first written. 
always @(negedge RE or negedge reset_n)
begin
   if(!reset_n)
     counter_R <= 4'h0; 
   else
     counter_R <= counter_R + 1;
end

// Latch the requested data until another pop signal.
always @(negedge FCLK)
begin
	if(latch_signal)
	begin
		latch_signal <= 1'b0;
		latch <= Q;
	end
	else if(pop)
		latch_signal <= 1'b1;
end

// Disable write signal if push and pop occur simultaneously.
always @(pop)
begin
   if(pop)
     WE_disable <= 1'b1;
   else
     WE_disable <= 1'b0;
end

// Write enable signal to FIFO.
always @(negedge FCLK)
begin
   if(push_save && !WE_disable)
     WE <= 1'b1;
   else
     WE <= 1'b0;
end

// Save the push request for simultaneous push and pop operations. 
always @(posedge push or posedge WE)
begin
   if(WE)
     push_save <= 1'b0;
   else
     push_save <= 1'b1;
end

// Save the fifo mode until reception of packet is complete.
always @(negedge FCLK or negedge reset_n)
begin
	if(!reset_n)
		fmode <= 1'b0;
	else if(FIFO_MODE == 0 && status == 0)
		fmode <= 1'b0;
	else if(FIFO_MODE)
		fmode <= FIFO_MODE;
end

// Routing of requested data according to fifo mode.
assign TCL_OUT = fmode ? latch : 32'h00000000 ;
assign RT_OUT  = fmode ? 32'h00000000  : latch; 


endmodule


This page: Maintained by: [email protected]
Created:Sun Mar 11 19:18:59 2001
From: /mnt/c/windows/desktop/floppy/commen~1/fifologic.v

Verilog converted to html by v2html 6.0 (written by Costas Calamvokis).Help































Hosted by www.Geocities.ws

1