-----Original Message-----
From: g...@cmdmail.amd.com [mailto:g...@cmdmail.amd.com] 
Sent: Monday, November 09, 2009 10:32 AM
To: Beckmann, Brad
Subject: [PATCH 12 of 31] ruby: getPort function fix

# HG changeset patch
# User Brad Beckmann <brad.beckm...@amd.com>
# Date 1257791382 28800
# Node ID 811a6e1ab233cf229f9480de1845b5da581c68b0
# Parent  6aad467bbc1a93df1a8029aa0c8f845269092db9
ruby: getPort function fix
Fixed RubyMemory::getPort function to not pass in a -1 for the idx
parameter

diff -r 6aad467bbc1a -r 811a6e1ab233 src/mem/rubymem.cc
--- a/src/mem/rubymem.cc        Mon Nov 09 10:29:42 2009 -0800
+++ b/src/mem/rubymem.cc        Mon Nov 09 10:29:42 2009 -0800
@@ -186,10 +186,19 @@
             ruby_ports.size(),
             ruby_dma_ports.size());
 
+    //
+    // By default, getPort will be passed an idx of -1.  Of course this
is an
+    // invalid ruby port index and must be a modified
+    //
+    if (idx == -1) {
+        idx = 0;
+    }
+
     // Accept request for "functional" port for backwards compatibility
     // with places where this function is called from C++.  I'd prefer
     // to move all these into Python someday.
     if (if_name == "functional") {
+        assert(idx < ruby_ports.size());
         return new Port(csprintf("%s-functional", name()), 
                         this,
                         ruby_ports[idx]);

_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to