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

ipcore.h

Go to the documentation of this file.
00001 
00002 /*
00003  * ipcore.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 _IPCORE_
00028 #define _IPCORE_
00029 
00030 #include "systemc.h"
00031 #include "../config/constants.h"
00032 #include "flit.h"
00033 #include "credit.h"
00034 #include "rng.h"
00035 
00036 #include <fstream>
00037 #include <string>
00038 #include <math.h>
00039 #include <dlfcn.h>
00040 
00041 using namespace std;
00042 
00048 struct ipcore : public sc_module {
00049 
00050         // PORTS //////////////////////////////////////////////////////////////////////////////////
00051         sc_in_clk clock;                        
00052         sc_in<flit> flit_inport;                
00053         sc_out<flit> flit_outport;              
00054         sc_in<creditLine> credit_in[NUM_VCS];   
00055         // PORTS END //////////////////////////////////////////////////////////////////////////////
00056         
00058         SC_CTOR(ipcore);
00059 
00060         // FUNCTIONS /////////////////////////////////////////////////////////////////////////////
00061         void entry();                   
00062         virtual void recv() = 0;        
00063         virtual void send() = 0;        
00064         
00065         void setID(UI tileID);          
00066 
00067         flit* create_hdt_flit(int pkt_id, int flit_id, UI route_info);
00069         flit* create_head_flit(int pkt_id, int flit_id, UI route_info);
00071         flit* create_data_flit(int pkt_id, int flit_id);
00073         flit* create_tail_flit(int pkt_id, int flit_id);        
00074         
00076         void set_cmd(flit*, int cmd_value);
00078         void set_data(flit*, int data_int_value);
00080         void set_data(flit*, string data_string_value);
00082         void set_payload(flit*, int cmd_value, int data_int_value);
00084         void set_payload(flit*, int cmd_value, string data_string_value);
00085 
00087         void get_cmd(flit, int &cmd_value);
00089         void get_data(flit, int &data_int_value);
00091         void get_data(flit, string &data_string_value);
00093         void get_payload(flit, int &cmd_value, int &data_int_value);
00095         void get_payload(flit, int &cmd_value, string &data_string_value);
00097         int get_random_dest();
00098         // FUNCTIONS END /////////////////////////////////////////////////////////////////////////
00099         
00100         // VARIABLES /////////////////////////////////////////////////////////////////////////////
00101         UI tileID;      
00102         ULL sim_count;  
00103         RNG *ran_var;   
00104         // VARIABLES END /////////////////////////////////////////////////////////////////////////
00105 };
00106 
00107 #endif

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