From 12db50c89584938839e035da47d206250cbfd7c2 Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Mon, 13 Mar 2017 18:19:08 +0000 Subject: ruby: Add support for address ranges in the directory Previously the directory covered a flat address range that always started from address 0. This change adds a vector of address ranges with interleaving and hashing that each directory keeps track of and the necessary flexibility to support systems with non continuous memory ranges. Change-Id: I6ea1c629bdf4c5137b7d9c89dbaf6c826adfd977 Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2903 Reviewed-by: Bradford Beckmann Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- src/mem/slicc/symbols/Type.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mem/slicc') diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py index bd92e20c9..e62758305 100644 --- a/src/mem/slicc/symbols/Type.py +++ b/src/mem/slicc/symbols/Type.py @@ -459,6 +459,7 @@ out << "${{dm.ident}} = " << printAddress(m_${{dm.ident}}) << " ";''') code('#include "mem/protocol/AccessPermission.hh"') if self.isMachineType: + code('#include ') code('#include "base/misc.hh"') code('#include "mem/ruby/common/Address.hh"') code('#include "mem/ruby/common/TypeDefines.hh"') @@ -498,6 +499,20 @@ std::string ${{self.c_ident}}_to_string(const ${{self.c_ident}}& obj); ${{self.c_ident}} &operator++(${{self.c_ident}} &e); ''') + if self.isMachineType: + code(''' + +// define a hash function for the MachineType class +namespace std { +template<> +struct hash { + std::size_t operator()(const MachineType &mtype) const { + return hash()(static_cast(mtype)); + } +}; +} + +''') # MachineType hack used to set the base component id for each Machine if self.isMachineType: code(''' -- cgit v1.2.3