10#include "sparta/memory/AddressTypes.hpp"
47 const std::string& output_type) :
48 input_type_(input_type),
49 output_type_(output_type)
100 Translation& t(trans!=
nullptr ? (*trans) : local_trans);
101 if(!tryTranslate_(addr, t)){
120 Translation& t(trans!=
nullptr ? (*trans) : local_trans);
122 if(!tryTranslate_(addr, t)){
143 virtual bool tryTranslate_(
const addr_t& addr,
Translation& trans)
const noexcept {
148 const std::string input_type_;
149 const std::string output_type_;
File that contains some exception types related to memory interfaces.
File that defines Translation classes and typedefs for addressing.
Indicates that there was an issue translating an address in the SPARTA framework.
Blocking translation interface with 1:1 translation unless subclassed.
TranslationIF()
Default Constructor.
addr_t translate(const addr_t &addr, Translation *trans=nullptr) const
Perform a translation from input-type to output-type.
const std::string & getInputType() const
gets the name of the input address type (e.g. virtual)
bool tryTranslate(const addr_t &addr, Translation *trans=nullptr) const
Perform a translation from input-type to output-type.
virtual ~TranslationIF()
Virtual Destructor.
const std::string & getOutputType() const
gets the name of the output address type (e.g. physical)
TranslationIF(const std::string &input_type, const std::string &output_type)
Constructor.
An older class used to help in encapsulate read/virtual addresses.
addr_t getOutputAddress() const
Returns output address of this translation.
uint64_t addr_t
Type for generic address representation in generic interfaces, errors and printouts within SPARTA.
Macros for handling exponential backoff.