interconnect_interface.hh

00001 
00002 #ifndef __INTERCONNECT_INTERFACE_HH__
00003 #define __INTERCONNECT_INTERFACE_HH__
00004 
00005 #include <iostream>
00006 
00007 #include "base/range.hh"
00008 #include "targetarch/isa_traits.hh" // for Addr
00009 #include "mem/bus/base_interface.hh"
00010 
00011 #include "interconnect.hh"
00012         
00013 class Interconnect;
00014 
00025 class InterconnectInterface : public BaseInterface
00026 {
00027 
00028     protected:
00029         int interfaceID;
00030         Interconnect* thisInterconnect;
00031         bool trace_on;
00032         
00033         int dataSends;
00034         int instSends;
00035         int coherenceSends;
00036         int totalSends;
00037         bool doProfiling;
00038     
00039     public:
00040         
00050         InterconnectInterface(Interconnect* _interconnect,
00051                               const std::string &name,
00052                               HierParams *hier)
00053             : BaseInterface(name, hier)
00054         {
00055             blocked = false;
00056             thisInterconnect = _interconnect;
00057             trace_on = false;
00058             
00059             dataSends = 0;
00060             instSends = 0;
00061             coherenceSends = 0;
00062             totalSends = 0;
00063             doProfiling = false;
00064         }
00065         
00069         void setBlocked();
00070     
00074         void clearBlocked();
00075 
00083         virtual MemAccessResult access(MemReqPtr &req) = 0;
00084     
00090         virtual void request(Tick time) = 0;
00091     
00098         virtual void respond(MemReqPtr &req, Tick time) = 0;
00099     
00107         bool grantAddr(){
00108             fatal("CrossbarInterface grantAddr() method not implemented\n");
00109             return false;
00110         }
00111     
00117         virtual bool grantData() = 0;
00118     
00125         void snoop(MemReqPtr &req){
00126             fatal("CrossbarInterface snoop not implemented");
00127         }
00128     
00135         void snoopResponse(MemReqPtr &req){
00136             fatal("CrossbarInterface snoopResponse not implemented");
00137         }
00138         
00145         void snoopResponseCall(MemReqPtr &req){
00146             fatal("CrossbarInterface snoopResponse not implemented");
00147         }
00148         
00158         Tick sendProbe(MemReqPtr &req, bool update){
00159             fatal("CrossbarSlave sendProbe() method not implemented");
00160             return -1;
00161         }
00162     
00172         Tick probe(MemReqPtr &req, bool update){
00173             fatal("CrossbarSlave probe() method not implemented");
00174             return -1;
00175         }
00176     
00183         void collectRanges(std::list<Range<Addr> > &range_list){
00184             fatal("CrossbarSlave collectRanges() method not implemented");
00185         }
00186     
00192         void getRange(std::list<Range<Addr> > &range_list);
00193         
00197         void rangeChange();
00198     
00205         void setAddrRange(std::list<Range<Addr> > &range_list);
00206            
00212         void addAddrRange(const Range<Addr> &range);
00213         
00231         void getSendSample(int* dataSends,
00232                            int* instSends,
00233                            int* coherenceSends,
00234                            int* totalSends);
00235         
00244         void updateProfileValues(MemReqPtr &req);
00245         
00253         virtual void deliver(MemReqPtr &req) = 0;
00254         
00261         virtual bool isMaster() = 0;
00262         
00276         virtual std::pair<Addr, int> getTargetAddr() = 0;
00277         
00285         virtual int getTargetId() = 0;
00286         
00293         virtual std::string getCacheName() = 0;
00294 
00295 //         virtual InterfaceType getInterfaceType(){
00296 //             return INTERCONNECT;
00297 //         }
00298         
00299 //         virtual void setCurrentRequestAddr(Addr address) = 0;
00300         
00301 //         virtual void addRequest(Addr address, int fromID, MemReqPtr &req) = 0;
00302         
00303 };
00304 
00305 #endif // INTERCONNECT_INTERFACE_HH__

Generated on Tue Jun 5 12:55:20 2007 for M5InterconnectExtensions by  doxygen 1.4.7