genericVcAllocator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _genericvcallocator_h_INC
00020 #define _genericvcallocator_h_INC
00021
00022 #include "../interfaces/networkComponent.h"
00023 #include "../../../util/genericData.h"
00024 #include <algorithm>
00025
00026 using namespace std;
00027
00028 struct VCA_unit
00029 {
00030 uint vc;
00031 uint out_port;
00032 uint in_port;
00033 };
00034 typedef struct VCA_unit VCA_unit;
00035
00043 class GenericVcAllocator
00044 {
00045 public:
00046
00047 GenericVcAllocator ();
00048 ~GenericVcAllocator ();
00049 void setup(uint p, uint v);
00050 bool request(uint out_port, uint out_vc, uint in_port, uint in_vc);
00051
00052
00053 bool is_empty( void );
00054 bool is_empty( uint i );
00055 void pick_winner( void );
00056 void set_request_matrix( void );
00057 void do_round_robin_arbitration ( void );
00058 void clear_winner( uint op, uint ovc, uint ip, uint ivc);
00059 void squash_requests( uint op, uint ovc, uint ip, uint ivc);
00060 string toString() const;
00061 bool is_requested ( uint op, uint ovc, uint ip, uint ivc);
00062 vector < uint > current_winners;
00063 uint address;
00064 uint node_ip;
00065
00066 private:
00067 uint ports;
00068 uint vcs;
00069 string name;
00070 vector < bool > done;
00071 vector < bool > locked;
00072 vector < uint > last_winner;
00073 vector < vector < bool > >requested;
00074 vector < vector < uint > >last_inport_winner;
00075 vector < vector < vector <short int > > > requestor_inport;
00076
00077 };
00078
00079 #endif
00080