From 5a9fe54d581ef1a617c433f7bf06989efaa385f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tiago=20M=C3=BCck?= Date: Tue, 25 Feb 2020 17:26:05 -0600 Subject: [PATCH] mem-ruby: added function to check addr range MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit respondsTo checks if a controller address ranges includes a given address. Change-Id: I9a320011d93e7fd8df1ad3bda75c85d314261a99 Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31263 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Bradford Beckmann --- src/mem/ruby/slicc_interface/AbstractController.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh index 98cb0a785..cbe92c0d7 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.hh +++ b/src/mem/ruby/slicc_interface/AbstractController.hh @@ -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 * -- 2.30.2