Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

InputChannel.h

Go to the documentation of this file.
00001 
00002 /*
00003  * InputChannel.h
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License,
00007  * version 2, as published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License along
00015  * with this program; if not, write to the Free Software Foundation, Inc.,
00016  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Author: Lavina Jain
00019  *
00020  */
00021 
00026 
00027 #ifndef _IP_CHANNEL_
00028 #define _IP_CHANNEL_
00029 
00030 #include "fifo.h"
00031 #include "systemc.h"
00032 #include "credit.h"
00033 #include "flit.h"
00034 #include <string>
00035 #include <iostream>
00036 #include <fstream>
00037 
00039 using namespace std;
00040 
00044 struct  VC {
00045         sc_uint<VCS_BITSIZE>    id;             
00046         sc_uint<VCS_BITSIZE+1>  vc_next_id;     
00047         sc_uint<BUF_BITSIZE>    num_buf;        
00048         sc_uint<3>              vc_route;       
00049         fifo                    vcQ;            
00050 };
00051 
00057 template<UI num_op = NUM_OC>
00058 struct InputChannel : public sc_module {
00059 
00060         // PORTS //////////////////////////////////////////////////////////////////////////////////
00061         sc_in<bool> switch_cntrl;       
00062         sc_in<flit> inport;             
00063         sc_out<flit> outport[num_op];   
00064         
00065         sc_in<bool>  outReady[num_op];  
00066         sc_out<bool> vcRequest;         
00067         sc_in<bool> vcReady;            
00068         sc_out<sc_uint<2> >  opRequest; 
00069         sc_in<sc_uint<VCS_BITSIZE+1> >  nextVCID;       
00070         sc_out<creditLine> credit_out[NUM_VCS];         
00071         
00072         sc_out<request_type> rtRequest;                 
00073         sc_in<bool> rtReady;                            
00074         sc_out<sc_uint<ADDR_SIZE> > destRequest;        
00075         sc_out<sc_uint<ADDR_SIZE> > sourceAddress;      
00076         sc_in<sc_uint<3> > nextRt;                      
00077         // PORTS END //////////////////////////////////////////////////////////////////////////////
00078         
00080         SC_CTOR(InputChannel);
00081 
00082         // FUNCTIONS /////////////////////////////////////////////////////////////////////////////
00083         void read_flit();               
00084         void store_flit_VC(flit*);      
00085         void route_flit();              
00086         void routing_src(flit*);        
00087         void routing_dst(flit*);        
00088 
00089         void transmit_flit();           
00090 
00091         void setTileID(UI tileID, UI portN, UI portS, UI portE, UI portW);
00092         void resetCounts();             
00093         void closeLogs();               
00094 
00095         int reverse_route(int);         
00096         // FUNCTIONS END /////////////////////////////////////////////////////////////////////////
00097         
00098         // VARIABLES /////////////////////////////////////////////////////////////////////////////
00099         VC      vc[NUM_VCS];    
00100         UI      cntrlID;        
00101         UI      tileID;         
00102         UI      portN;          
00103         UI      portS;          
00104         UI      portE;          
00105         UI      portW;          
00106         UI      numBufReads;    
00107         UI      numBufWrites;   
00108         UI      numBufsOcc;     
00109         UI      numVCOcc;       
00110         ULL     sim_count;      
00111         // VARIABLES END /////////////////////////////////////////////////////////////////////////
00112 };
00113 
00114 #endif
00115 

Generated on Mon May 7 19:03:19 2007 for NIRGAM by  doxygen 1.3.9.1