\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
//
// DECODER.V
// 
// Decoder is used to decode the first quadlet. 
// The decoder determines the packet type, header length, data payload.
// It is also used to check the destination & broadcast address of the packet.
// The module instantiate 'tcodetable.v'
//
//

[Up: alhamdulillah D1]
module decoderIndex(		 //Input
                     BCLK, 
                     dec, //used to signal the decoder to decode the packet
		     		 receive_or_transmit, //to determine the mode ('1' for transmitter)
		     		 reset_n,
           	     	 DATA_IR, //Input from Internal Registers
		             DATA_DECODE, //Data to be decoded
					 //Output
                     data_payload, //determines whether a data payload is with the packet
                     header_length, //the length of the packet header
                     decode_error, //high in case of invalid 'tcode' or destination address
								   // mismatch
                     decode_complete, //operation complete signal
                     ADDR_IR,
                     oenable, //output enable to the Internal Register module
					 data_dec_out, 
					 broadcast //high when the packet is a broadcast
					 );									

input BCLK,dec,receive_or_transmit,reset_n;
input [31:0] DATA_DECODE;
input [15:0]DATA_IR;
wire d_error;

output data_payload,decode_error,decode_complete, oenable, broadcast;
output[2:0] header_length;
output [7:0]ADDR_IR;
reg decode, broadcast, decode_complete, decode_error;
wire BCLK,dec,reset_n,data_payload,dec_complete;
wire[2:0] header_length;
wire [31:0] DATA_DECODE;
wire [3:0]data_decode1;
wire [15:0]dest_id;
reg    oenable;
reg [7:0]ADDR_IR;
reg 	dest_error, data_flag,decode_en,decode_flag;
reg[15:0]source_ID;
output [3:0]data_dec_out;

assign data_decode1 = DATA_DECODE[7:4]; //
assign dest_id = DATA_DECODE[31:16]; //

//Instantiate the 'tcodetable' module used for the tcode decoding
//tcode determines the possible values of header_length and data_payload
tcodetable t1(dec_complete, d_error, header_length, data_payload, reset_n,decode, data_decode1,data_dec_out);

parameter SOURCEID_ = 8'h 40; //address of Internal Register for source ID 
							  //(bus number, node number)

always @(negedge BCLK)
begin
	decode_complete <= dec_complete; //
end		

//generation of decode signal to the tcodetable module.
always @(posedge BCLK)
begin
     if(decode)
     	decode <= 1'b0;
     else if(decode_en)
        decode <= 1'b1;
end

// Diable the decoder to respond to further requests after receiving a request to decode,
always @(posedge oenable or negedge dec)
begin
	if(!dec)
		decode_flag <= 1'b0;
	else
		decode_flag <= 1'b1;
end


// Data from internal registers is available.
always @(negedge BCLK)
begin
	if(decode_en)
		decode_en <= 1'b0;
	else if(oenable)
		decode_en <= 1'b1;
end
	 

// Generation of address and oenable signals to internal registers.
always@(posedge BCLK or negedge reset_n)
begin
   if(!reset_n)
   begin
     ADDR_IR <= 8'h00;
     oenable  <= 1'b0;
     
     source_ID <= 16'h0000;
	 data_flag <=1'b0;
   end   

   else if(dec && !decode_flag) ///////////////
   begin
     ADDR_IR <= SOURCEID_; //address of IR for source ID value
     oenable <= 1;
     
     source_ID <= 16'h0000;
     data_flag <= 1'b0;
   end
   else if(oenable)
   begin
     ADDR_IR <= 8'h00;     
     oenable <= 1'b0;
     
     source_ID <= DATA_IR;
     data_flag <= 1'b1;
   end
end

// Checking of destination and broadcast address.
// Generation of error if there is a mismatch.
always @(data_flag or dest_error or dest_id or source_ID or d_error or reset_n or receive_or_transmit)
begin
	if(!reset_n)
	begin
		dest_error <= 0;
		broadcast <=0;
	end
    else if(!data_flag)
    begin
	    dest_error <= 0;
		 broadcast <=0;
  	end
    else if(data_flag)
    begin 
       if(dest_id == 16'hffff)
	   begin		
			 dest_error <= 0;
			 broadcast  <= 1;
	   end
	   else if((source_ID != dest_id) && (dest_id != 16'hffff))
       begin     
			dest_error <= 1;
			broadcast <=0;
		end
       	else  
		begin
			dest_error<=0;
			broadcast <=0;
		end  	
	end

	else 
	begin	
		dest_error <= 0;
		broadcast <=0;
	end
	decode_error = d_error | (~receive_or_transmit & dest_error); //receive_or_transmit = 0 for receive mode
end


endmodule










                                                                                                                                                            













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

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































Hosted by www.Geocities.ws

1