mem-ruby: added function to check addr range
authorTiago Mück <tiago.muck@arm.com>
Tue, 25 Feb 2020 23:26:05 +0000 (17:26 -0600)
committerTiago Mück <tiago.muck@arm.com>
Mon, 12 Oct 2020 14:09:55 +0000 (14:09 +0000)
respondsTo checks if a controller address ranges includes a given
address.

Change-Id: I9a320011d93e7fd8df1ad3bda75c85d314261a99
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31263
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bradford Beckmann <bradford.beckmann@gmail.com>
src/mem/ruby/slicc_interface/AbstractController.hh

index 98cb0a7858c8b6c77a2d6bda34b05cd3a8583ff2..cbe92c0d72fda7a792013f8ba03b90abebc2ce67 100644 (file)
@@ -153,6 +153,13 @@ class AbstractController : public ClockedObject, public Consumer
     Stats::Histogram& getDelayVCHist(uint32_t index)
     { return *(m_delayVCHistogram[index]); }
 
+    bool respondsTo(Addr addr)
+    {
+        for (auto &range: addrRanges)
+            if (range.contains(addr)) return true;
+        return false;
+    }
+
     /**
      * Map an address to the correct MachineID
      *