00001 /* 00002 * ===================================================================================== 00003 * 00004 * Filename: myFullyVirtualArbiter.h 00005 * 00006 * Description: 00007 * 00008 * Version: 1.0 00009 * Created: 04/27/2010 01:52:11 AM 00010 * Revision: none 00011 * Compiler: gcc 00012 * 00013 * Author: Mitchelle Rasquinha (), mitchelle.rasquinha@gatech.edu 00014 * Company: Georgia Institute of Technology 00015 * 00016 * ===================================================================================== 00017 */ 00018 00019 #ifndef _ptopswitcharbiter_h_INC 00020 #define _ptopswitcharbiter_h_INC 00021 00022 #include "../interfaces/networkComponent.h" 00023 #include "../../data_types/impl/flit.h" 00024 #include "../../../util/genericData.h" 00025 #include <vector> 00026 #include <fstream> 00027 00028 using namespace std; 00029 extern SW_ARBITRATION sw_arbitration; 00030 extern message_class priority_msg_type; 00031 class PToPSwitchArbiter 00032 { 00033 public: 00034 PToPSwitchArbiter (); /* constructor */ 00035 ~PToPSwitchArbiter(); 00036 void resize(uint p); 00037 bool is_requested(uint outp, uint inp); 00038 void request(uint p, uint inp); 00039 SA_unit pick_winner( uint p); 00040 SA_unit do_round_robin_arbitration( uint p); 00041 SA_unit do_priority_round_robin_arbitration( uint p); 00042 SA_unit do_fcfs_arbitration( uint p); 00043 void clear_winner( uint p, uint ip); 00044 void clear_requested( uint p, uint ip); 00045 void request(uint oport, uint inport, message_class m); 00046 bool is_empty(); 00047 string toString() const; 00048 uint address; 00049 string name; 00050 uint node_ip; 00051 00052 protected: 00053 00054 private: 00055 uint PORTS; 00056 uint CHANNELS; 00057 vector < bool> locked; 00058 vector < bool> done; 00059 vector < vector <bool> > requested; 00060 vector < vector <bool> > priority_reqs; 00061 vector < bool> port_locked; 00062 vector < vector<SA_unit> > requesting_inputs; 00063 vector < SA_unit > last_winner; 00064 vector < uint> last_port_winner; 00065 00066 }; /* ----- end of class PToPSwitchArbiter ----- */ 00067 00068 #endif /* ----- #ifndef ptopswitcharbiter_INC ----- */