本文整理汇总了C++中MemoryManager::getMemoryArea方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryManager::getMemoryArea方法的具体用法?C++ MemoryManager::getMemoryArea怎么用?C++ MemoryManager::getMemoryArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryManager
的用法示例。
在下文中一共展示了MemoryManager::getMemoryArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: configure
void CycleCounter::configure()
{
if (emulationLevel >= EMEX_EXTRA_SMALL_5XX)
{
MemoryManager* mm = deviceHandle->getMemoryManager();
EemMemoryAccess* ema = (EemMemoryAccess*)mm->getMemoryArea("EEM");
cycleCounterControl = defaultMode;
ema->writeEemRegister(CCNT0CTL, cycleCounterControl) && ema->sync();
}
}
示例2: read
uint64_t CycleCounter::read()
{
if (emulationLevel >= EMEX_EXTRA_SMALL_5XX)
{
MemoryManager* mm = deviceHandle->getMemoryManager();
EemMemoryAccess* ema = (EemMemoryAccess*)mm->getMemoryArea("EEM");
union CycleCount { struct { uint32_t low, high; }; uint64_t value; };
CycleCount cycleCount;
ema->readEemRegister(CCNT0L, &cycleCount.low) && ema->sync();
ema->readEemRegister(CCNT0H, &cycleCount.high) && ema->sync();
counterValue = 0;
uint32_t factor = 1;
uint32_t lsfr2hex[16] = {0x0, 0x1, 0x2, 0x7, 0x5, 0x3, 0x8, 0xb, 0xe, 0x6, 0x4, 0xa, 0xd, 0x9, 0xc, 0};
for (int i = 0; i < 10; ++i)
{
counterValue += factor * lsfr2hex[(cycleCount.value & 0xf)];
cycleCount.value >>= 4;
factor *= 15;
}
}
示例3: HalExecElement
bool DebugManagerV3::run (uint16_t controlMask, DebugEventTarget * cb, bool releaseJtag)
{
MemoryManager* mm = this->parent->getMemoryManager();
MemoryArea* cpu = mm->getMemoryArea("CPU");
if (!cpu)
{
return false;
}
lpm5WakeupDetected = false;
if(cb!=0)
{
cbx=cb;
}
uint32_t pc, sr;
cpu->read(0, &pc, 1);
cpu->read(2, &sr, 1);
if(mm->flushAll()==false)
{
return false;
}
cycleCounter_.reset();
ConfigManager *cm = parent->getFetHandle()->getConfigManager();
const uint16_t mdb = parent->getEmulationManager()->getSoftwareBreakpoints()->getSwbpManager()->getInstructionAt(pc);
if (mdb != 0)
{
mdbPatchValue = mdb;
}
HalExecElement* el = new HalExecElement(this->parent->checkHalId(ID_RestoreContext_ReleaseJtag));
this->parent->getWatchdogControl()->addParamsTo(el);
el->appendInputData32(pc);
el->appendInputData16(sr);
el->appendInputData16(controlMask!=0? 0x0007: 0x0006); // eem control bits
el->appendInputData16(mdbPatchValue); // mdb
el->appendInputData16(releaseJtag ? 1 : 0);
el->appendInputData16(cm->ulpDebugEnabled() ? 1 : 0);
mdbPatchValue = 0;
HalExecCommand cmd;
cmd.elements.push_back(el);
if (!this->parent->send(cmd))
{
return false;
}
// handle lpmx5 polling
if (releaseJtag)
{
pausePolling();
}
else
{
this->resumePolling();
}
if (controlMask!=0 && !releaseJtag)
{
if (!activatePolling(controlMask))
{
return false;
}
}
resetCycleCounterBeforeNextStep = true;
return true;
}