diff options
Diffstat (limited to 'mem/bus.hh')
-rw-r--r-- | mem/bus.hh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mem/bus.hh b/mem/bus.hh index e26065295..54de8aa1e 100644 --- a/mem/bus.hh +++ b/mem/bus.hh @@ -45,6 +45,13 @@ class Bus : public MemObject { + struct DevMap { + int portId; + Range<Addr> range; + }; + std::vector<DevMap> portList; + + /** Function called by the port when the bus is recieving a Timing transaction.*/ bool recvTiming(Packet &pkt, int id); @@ -60,6 +67,16 @@ class Bus : public MemObject /** Function called by the port when the bus is recieving a status change.*/ void recvStatusChange(Port::Status status, int id); + /** Find which port connected to this bus (if any) should be given a packet + * with this address. + * @param addr Address to find port for. + * @param id Id of the port this packet was received from (to prevent + * loops) + * @return pointer to port that the packet should be sent out of. + */ + Port * + Bus::findPort(Addr addr, int id); + /** Decleration of the buses port type, one will be instantiated for each of the interfaces connecting to the bus. */ class BusPort : public Port @@ -104,6 +121,10 @@ class Bus : public MemObject // the 'owned' address ranges of all the other interfaces on // this bus... virtual void addressRanges(AddrRangeList &range_list, bool &owner); + + // Hack to make translating port work without changes + virtual int deviceBlockSize() { return 32; } + }; /** A count of the number of interfaces connected to this bus. */ @@ -116,13 +137,16 @@ class Bus : public MemObject public: /** A function used to return the port associated with this bus object. */ - virtual Port *getPort(const char *if_name) + virtual Port *getPort(const std::string &if_name) { // if_name ignored? forced to be empty? int id = num_interfaces++; interfaces[id] = new BusPort(this, id); return interfaces[id]; } + Bus(const std::string &n) + : MemObject(n), num_interfaces(0) {} + }; #endif //__MEM_BUS_HH__ |