The Sparta Modeling Framework
Loading...
Searching...
No Matches
MemoryExceptions.hpp
Go to the documentation of this file.
1
7#pragma once
8
10#include "sparta/memory/AddressTypes.hpp"
11
12namespace sparta
13{
14 namespace memory
15 {
25 {
26 public:
28 const std::string& why) :
29 SpartaException(((std::stringstream&)(std::stringstream() << "Invalid translation from " << std::hex
30 << addr << " : " << why)).str())
31 { }
32 };
33
43 {
44 public:
46 addr_t size,
47 const std::string& access,
48 const std::string& why) :
49 SpartaException(((std::stringstream&)(std::stringstream() << "Invalid " << access << " access at 0x" << std::hex
50 << addr << " of size: " << std::dec << size << ": " << why)).str())
51 { }
52 };
53
58 {
59 public:
61 addr_t size,
62 const std::string& why) :
63 MemoryAccessError(addr, size, "read", why)
64 { }
65 };
66
71 {
72 public:
74 addr_t size,
75 const std::string& why) :
76 MemoryAccessError(addr, size, "write", why)
77 { }
78 };
79
84 {
85 public:
87 addr_t size,
88 const std::string& why) :
89 MemoryAccessError(addr, size, "peek", why)
90 { }
91 };
92
97 {
98 public:
100 addr_t size,
101 const std::string& why) :
102 MemoryAccessError(addr, size, "poke", why)
103 { }
104 };
105
106 } // namespace memory
107} // namespace sparta
Exception class for all of Sparta.
Used to construct and throw a standard C++ exception. Inherits from std::exception.
SpartaException()
Construct a SpartaException object with empty reason.
Indicates that there was an issue accessing a SPARTA memory object or interface.
Error while attempting to peek some memory object or interface.
Error while attempting to poke some memory object or interface.
Error while attempting to read some memory object or interface.
Indicates that there was an issue translating an address in the SPARTA framework.
Error while attempting to write some memory object or interface.
uint64_t addr_t
Type for generic address representation in generic interfaces, errors and printouts within SPARTA.
Macros for handling exponential backoff.