MemoryMappedComponent.cc Source File
Back to the index.
Go to the documentation of this file.
32 const string& visibleClassName)
34 , m_memoryMappedBase(0)
35 , m_memoryMappedSize(0)
36 , m_memoryMappedAddrMul(1)
38 AddVariable(
"memoryMappedBase", &m_memoryMappedBase);
39 AddVariable(
"memoryMappedSize", &m_memoryMappedSize);
40 AddVariable(
"memoryMappedAddrMul", &m_memoryMappedAddrMul);
52 if (memoryMappedBase != NULL && memoryMappedSize != NULL) {
53 if (!ss.str().empty())
56 uint64_t nBytes = memoryMappedSize->
ToInteger();
57 if (nBytes >= (1 << 30))
58 ss << (nBytes >> 30) <<
" GB";
59 else if (nBytes >= (1 << 20))
60 ss << (nBytes >> 20) <<
" MB";
61 else if (nBytes >= (1 << 10))
62 ss << (nBytes >> 10) <<
" KB";
64 ss << nBytes <<
" bytes";
66 ss << nBytes <<
" byte";
69 ss.flags(std::ios::hex | std::ios::showbase);
72 if (memoryMappedAddrMul != NULL &&
74 ss <<
", addrmul " << memoryMappedAddrMul->
ToInteger();
string GenerateDetails() const
Generate details about the component.
virtual string GenerateDetails() const
Generate details about the component.
bool AddVariable(const string &name, T *variablePointer)
Adds a state variable of type T to the Component.
StateVariables make up the persistent state of Component objects.
uint64_t ToInteger() const
Returns the variable as an unsignedinteger value.
MemoryMappedComponent(const string &className, const string &visibleClassName)
Constructs a MemoryMappedComponent.
A Component is a node in the configuration tree that makes up an emulation setup.
StateVariable * GetVariable(const string &name)
Gets a pointer to a state variable.
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17