00001 /* 00002 * ===================================================================================== 00003 * 00004 * Filename: LowLevelPacket.h 00005 * 00006 * Description: This is the desription of the lower link layer protocol 00007 * class. It translates from the higher message protocol definition of the 00008 * packet to flits. Phits are further handled for the physical layer within 00009 * this definition. Assuming a link of 20 bits for phits according to QPI 00010 * specs for now. However it would be useful to have these parameters 00011 * configurable to be able to do link level modulation at some point. 00012 * 00013 * Version: 1.0 00014 * Created: 02/09/2010 08:56:39 PM 00015 * Revision: none 00016 * Compiler: gcc 00017 * 00018 * Author: Mitchelle Rasquinha (), mitchelle.rasquinha@gatech.edu 00019 * Company: Georgia Institute of Technology 00020 * 00021 * ===================================================================================== 00022 */ 00023 00024 #ifndef _lowlevelpacket_h_INC 00025 #define _lowlevelpacket_h_INC 00026 00027 #include <vector> 00028 #include <string> 00029 #include <sstream> 00030 #include <deque> 00031 #include <stdio.h> 00032 #include "../../../kernel/simulator.h" 00033 #include "../../../util/simIrisComponentHeader.h" 00034 #include "flit.h" 00035 00036 using namespace std; 00037 00038 /* 00039 * ===================================================================================== 00040 * Class: LowLevelPacket 00041 * Description: 00042 * 00043 * ===================================================================================== 00044 */ 00045 class LowLevelPacket 00046 { 00047 public: 00048 /* ==================== LIFECYCLE ======================================= */ 00049 LowLevelPacket (); /* constructor */ 00050 ~LowLevelPacket(); 00051 00052 deque<Flit*> flits; 00053 uint source; 00054 uint destination; 00055 uint pkt_cnt; //Number of requests in this 00056 uint transaction_id; 00057 message_class msg_class; 00058 /* for debug */ 00059 ullint addr; 00060 00061 /* Stats variables */ 00062 double avg_network_latency; 00063 unsigned int hop_count; 00064 unsigned int stat_memory_serviced_time; 00065 ullint req_start_time; 00066 ullint waiting_in_ni; 00067 00068 short int virtual_channel; 00069 unsigned long int sent_time; 00070 unsigned int length; /* Determines the length of the packet in terms of flits */ 00071 vector<bool> control_bits; 00072 vector<bool> payload; 00073 00074 void clear(); 00075 void add(Flit* ptr); 00076 Flit* at(uint index); 00077 Flit* get_next_flit(); /* This will pop the flit from the queue as well */ 00078 string toString() const; 00079 bool valid_packet(); 00080 uint size(); 00081 void operator=( const LowLevelPacket* p ); 00082 00083 protected: 00084 00085 private: 00086 00087 }; /* ----- end of class LowLevelPacket ----- */ 00088 00089 #endif /* ----- #ifndef _lowlevelpacket_h_INC ----- */