genericVcAllocator.h

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  genericVcAllocator.h
00005  *
00006  *    Description:  
00007  *
00008  *        Version:  1.0
00009  *        Created:  06/21/2010 03:22:20 PM
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  _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         /* ====================  LIFECYCLE     ======================================= */
00047         GenericVcAllocator ();                             /* \fn constructor */
00048         ~GenericVcAllocator ();                            /* \fn destructor */
00049         void setup(uint p, uint v);                        /* \fn Init. Set vcs and ports */
00050         bool request(uint out_port, uint out_vc, uint in_port, uint in_vc);            /* \fn Request output port allocation.
00051                                                             \param in_port: Requesting in_port
00052                                                             \param in_vc: Requesting in_vc.*/
00053         bool is_empty( void );                                   /* \fn Checks if the vca unit has requests */
00054         bool is_empty( uint i );                                   /* \fn Checks if the vca unit has requests for the ith row ( i=out_port*ports+out_vc) */
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);                                   /* \fn Clear winner */
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 }; /* -----  end of class GenericVcAllocator  ----- */
00078 
00079 #endif   /* ----- #ifndef _genericvcallocator_h_INC  ----- */
00080 

Generated on Tue Oct 19 17:22:00 2010 for IRIS by  doxygen 1.5.8