00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
00056
00058 SC_CTOR(ipcore);
00059
00060
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
00099
00100
00101 UI tileID;
00102 ULL sim_count;
00103 RNG *ran_var;
00104
00105 };
00106
00107 #endif