Ruby Port: Add a list of cpu ports attached to this port
authorNilay Vaish <nilay@cs.wisc.edu>
Wed, 11 Jan 2012 19:39:58 +0000 (13:39 -0600)
committerNilay Vaish <nilay@cs.wisc.edu>
Wed, 11 Jan 2012 19:39:58 +0000 (13:39 -0600)
src/mem/ruby/system/RubyPort.cc
src/mem/ruby/system/RubyPort.hh

index f7bde739eda17d2550d5b8f350d5111fb5ddfb67..d5f21c312c3ce61ad1a7c53d7aad010838ac3bee 100644 (file)
@@ -66,8 +66,10 @@ Port *
 RubyPort::getPort(const std::string &if_name, int idx)
 {
     if (if_name == "port") {
-        return new M5Port(csprintf("%s-port%d", name(), idx), this,
-                          ruby_system, access_phys_mem);
+        M5Port* cpuPort = new M5Port(csprintf("%s-port%d", name(), idx),
+                                     this, ruby_system, access_phys_mem);
+        cpu_ports.push_back(cpuPort);
+        return cpuPort;
     }
 
     if (if_name == "pio_port") {
index 88e865766f6cafd054eea36d915a6ab5da27a3df..0160d8fc86a4a0a709606c2d1e9b15dd155c689b 100644 (file)
@@ -148,6 +148,10 @@ class RubyPort : public MemObject
 
     M5Port* physMemPort;
 
+    /*! Vector of CPU Port attached to this Ruby port. */
+    typedef std::vector<M5Port*>::iterator CpuPortIter;
+    std::vector<M5Port*> cpu_ports;
+
     PhysicalMemory* physmem;
     RubySystem* ruby_system;