The Sparta Modeling Framework
Loading...
Searching...
No Matches
Translation.hpp
Go to the documentation of this file.
1
8#pragma once
9
10#include "sparta/memory/AddressTypes.hpp"
11
12namespace sparta
13{
14 namespace memory
15 {
23 {
24 public:
25
32 valid_(false),
33 vaddr_(0),
34 raddr_(0)
35 { }
36
44 valid_(true),
45 vaddr_(addr),
46 raddr_(out)
47 {}
48
52 Translation& operator=(const Translation& rhp) = default;
53
54 bool isValid() const { return valid_; }
55
60 return raddr_;
61 }
62
63 addr_t getRealAddress() const {
64 return raddr_;
65 }
66
67 addr_t getVirtualAddress() const {
68 return vaddr_;
69 }
70
71 // ... TBD, other attributes
72
73 private:
74 bool valid_;
75 addr_t vaddr_;
76 addr_t raddr_;
77 };
78 }
79
80}
81
An older class used to help in encapsulate read/virtual addresses.
Translation()
Default constructor.
Translation(addr_t addr, addr_t out)
Create a Translation object containing a pair of (pre-translation, post-translation) addresses.
Translation & operator=(const Translation &rhp)=default
Assignment operator (builtin)
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.