From da6a7b1263cf624790f06a5f944366fb113dffc8 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 26 May 2006 13:48:35 -0400 Subject: Add names to memory Port objects for tracing. --HG-- extra : convert_revision : ddf30084e343e8656e4812ab20356292b35507ee --- src/mem/bus.hh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/mem/bus.hh') diff --git a/src/mem/bus.hh b/src/mem/bus.hh index 38573e514..1d3a7e528 100644 --- a/src/mem/bus.hh +++ b/src/mem/bus.hh @@ -100,8 +100,8 @@ class Bus : public MemObject public: /** Constructor for the BusPort.*/ - BusPort(Bus *_bus, int _id) - : bus(_bus), id(_id) + BusPort(const std::string &_name, Bus *_bus, int _id) + : Port(_name), bus(_bus), id(_id) { } protected: @@ -146,13 +146,7 @@ class Bus : public MemObject public: /** A function used to return the port associated with this bus object. */ - virtual Port *getPort(const std::string &if_name) - { - // if_name ignored? forced to be empty? - int id = interfaces.size(); - interfaces.push_back(new BusPort(this, id)); - return interfaces.back(); - } + virtual Port *getPort(const std::string &if_name); virtual void init(); -- cgit v1.2.3 From e533fad711fce66bf2e4a6669baeb8eaf02799e1 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 26 May 2006 14:17:33 -0400 Subject: Significant rework of Packet class interface: - new constructor guarantees initialization of most fields - flags track status of non-guaranteed fields (addr, size, src) - accessor functions (getAddr() etc.) check status on access - Command & Result classes are nested in Packet class scope - Command now built from vector of behavior bits - string version of Command for tracing - reinitFromRequest() and makeTimingResponse() encapsulate common manipulations of existing packets src/cpu/simple/atomic.cc: src/cpu/simple/base.cc: src/cpu/simple/timing.cc: src/dev/alpha_console.cc: src/dev/ide_ctrl.cc: src/dev/io_device.cc: src/dev/io_device.hh: src/dev/isa_fake.cc: src/dev/ns_gige.cc: src/dev/pciconfigall.cc: src/dev/sinic.cc: src/dev/tsunami_cchip.cc: src/dev/tsunami_io.cc: src/dev/tsunami_pchip.cc: src/dev/uart8250.cc: src/mem/bus.cc: src/mem/bus.hh: src/mem/physical.cc: src/mem/port.cc: src/mem/port.hh: src/mem/request.hh: Update for new Packet interface. --HG-- extra : convert_revision : 9973d09ea4fa61795f23772a7d3995fa4df5c269 --- src/mem/bus.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mem/bus.hh') diff --git a/src/mem/bus.hh b/src/mem/bus.hh index 1d3a7e528..5eeb07904 100644 --- a/src/mem/bus.hh +++ b/src/mem/bus.hh @@ -109,17 +109,17 @@ class Bus : public MemObject /** When reciving a timing request from the peer port (at id), pass it to the bus. */ virtual bool recvTiming(Packet *pkt) - { pkt->src = id; return bus->recvTiming(pkt); } + { pkt->setSrc(id); return bus->recvTiming(pkt); } /** When reciving a Atomic requestfrom the peer port (at id), pass it to the bus. */ virtual Tick recvAtomic(Packet *pkt) - { pkt->src = id; return bus->recvAtomic(pkt); } + { pkt->setSrc(id); return bus->recvAtomic(pkt); } /** When reciving a Functional requestfrom the peer port (at id), pass it to the bus. */ virtual void recvFunctional(Packet *pkt) - { pkt->src = id; bus->recvFunctional(pkt); } + { pkt->setSrc(id); bus->recvFunctional(pkt); } /** When reciving a status changefrom the peer port (at id), pass it to the bus. */ -- cgit v1.2.3