gem5
v19.0.0.0
|
Go to the source code of this file.
Functions | |
uint64_t | power (uint32_t n, uint32_t e) |
int | floorLog2 (unsigned x) |
int | floorLog2 (unsigned long x) |
int | floorLog2 (unsigned long long x) |
int | floorLog2 (int x) |
int | floorLog2 (long x) |
int | floorLog2 (long long x) |
template<class T > | |
int | ceilLog2 (const T &n) |
template<class T > | |
bool | isPowerOf2 (const T &n) |
template<class T , class U > | |
T | divCeil (const T &a, const U &b) |
template<class T , class U > | |
T | roundUp (const T &val, const U &align) |
This function is used to align addresses in memory. More... | |
template<class T , class U > | |
T | roundDown (const T &val, const U &align) |
This function is used to align addresses in memory. More... | |
|
inline |
Definition at line 135 of file intmath.hh.
References floorLog2().
Referenced by DRAMCtrl::addToReadQueue(), DRAMCtrl::addToWriteQueue(), DRAMCtrl::DRAMCtrl(), TimingExprUn::eval(), isPowerOf2(), DRAMCtrl::DRAMStats::regStats(), and TEST().
|
inline |
Definition at line 153 of file intmath.hh.
References ArmISA::b.
Referenced by DRAMCtrl::activateBank(), Process::allocateMem(), BaseXBar::calcPacketTiming(), DRAMCtrl::doDRAMAccess(), QoS::MemCtrl::escalateQueues(), DRAMCtrl::Rank::flushCmdList(), DRAMPower::getDataRate(), DRAMPower::getTimingParams(), Gicv3Distributor::Gicv3Distributor(), TrafficGen::parseConfig(), DRAMCtrl::Rank::powerDownSleep(), DRAMCtrl::prechargeBank(), QoS::MemSinkCtrl::processNextReqEvent(), DRAMCtrl::Rank::processRefreshEvent(), DRAMSim2::readComplete(), SerialLink::SerialLinkSlavePort::recvTimingReq(), QoS::MemSinkCtrl::recvTimingReq(), DRAMCtrl::recvTimingReq(), SerialLink::SerialLinkMasterPort::recvTimingResp(), Clocked::resetClock(), DRAMCtrl::Rank::resetStats(), DRAMCtrl::Rank::scheduleWakeUpEvent(), DRAMCtrl::startup(), ComputeUnit::startWavefront(), TEST(), AtomicSimpleCPU::tick(), Clocked::ticksToCycles(), SerialLink::SerialLinkSlavePort::trySendTiming(), SerialLink::SerialLinkMasterPort::trySendTiming(), Clocked::update(), DRAMCtrl::Rank::updatePowerStats(), GpuDispatcher::write(), and DRAMSim2::writeComplete().
|
inline |
Definition at line 61 of file intmath.hh.
Referenced by Histogram::add(), CheckTable::addCheck(), BankedArray::BankedArray(), ceilLog2(), DefaultBTB::DefaultBTB(), DirectoryMemory::DirectoryMemory(), floorLog2(), SimpleIndirectPredictor::getSetIndex(), Gicv2m::Gicv2m(), StackDistProbe::handleRequest(), BOPPrefetcher::hash(), CacheMemory::init(), isPowerOf2(), StridePrefetcher::PCTable::pcHash(), RubySystem::RubySystem(), BasePrefetcher::setCache(), and TEST().
|
inline |
Definition at line 77 of file intmath.hh.
References ULL.
|
inline |
Definition at line 96 of file intmath.hh.
References ULL.
|
inline |
Definition at line 113 of file intmath.hh.
References floorLog2().
|
inline |
Definition at line 120 of file intmath.hh.
References floorLog2().
|
inline |
Definition at line 127 of file intmath.hh.
References floorLog2().
|
inline |
Definition at line 146 of file intmath.hh.
References ceilLog2(), and floorLog2().
Referenced by AccessMapPatternMatching::AccessMapPatternMatching(), AssociativeSet< SignaturePathPrefetcher::SignatureEntry >::AssociativeSet(), BaseIndexingPolicy::BaseIndexingPolicy(), BaseSetAssoc::BaseSetAssoc(), BiModeBP::BiModeBP(), BOPPrefetcher::BOPPrefetcher(), ChunkGenerator::ChunkGenerator(), ComputeUnit::ComputeUnit(), DefaultBTB::DefaultBTB(), DRAMCtrl::DRAMCtrl(), EmulationPageTable::EmulationPageTable(), FALRU::FALRU(), Gicv2m::Gicv2m(), StatisticalCorrector::SCThreadHistory::initLocalHistory(), IrregularStreamBufferPrefetcher::IrregularStreamBufferPrefetcher(), LocalBP::LocalBP(), MemFootprintProbe::MemFootprintProbe(), PciDevice::PciDevice(), roundDown(), roundUp(), RubySystem::RubySystem(), SectorTags::SectorTags(), SimpleIndirectPredictor::SimpleIndirectPredictor(), STeMSPrefetcher::STeMSPrefetcher(), StoreSet::StoreSet(), StridePrefetcher::StridePrefetcher(), TEST(), TournamentBP::TournamentBP(), TreePLRURP::TreePLRURP(), and StackDistCalc::updateTree().
|
inline |
Definition at line 40 of file intmath.hh.
References ArmISA::e, ArmISA::n, warn, and X86ISA::x.
Referenced by PowerModel::getDynamicPower(), ThermalDomain::getEquation(), PowerModel::getStaticPower(), Sp804::Timer::read(), CpuLocalTimer::Timer::read(), Sp804::Timer::restartCounter(), CpuLocalTimer::Timer::restartTimerCounter(), CpuLocalTimer::Timer::restartWatchdogCounter(), and TEST().
|
inline |
This function is used to align addresses in memory.
val | is the address to be aligned. |
align | is the alignment. Can only be a power of 2. |
align | which is less than or equal to |
val. |
Definition at line 185 of file intmath.hh.
References isPowerOf2(), and ArmISA::mask.
Referenced by AtomicSimpleCPU::amoMem(), AlphaProcess::argsInit(), RiscvProcess::argsInit(), MipsProcess::argsInit(), PowerProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), brkFunc(), TLBCoalescer::canCoalesce(), Shader::doFunctionalAccess(), Process::fixupStackFault(), X86ISA::GpuTLB::handleFuncTranslationReturn(), StackDistProbe::handleRequest(), FetchUnit::initiateFetch(), TimingSimpleCPU::initiateMemAMO(), TimingSimpleCPU::initiateMemRead(), X86ISA::GpuTLB::issueTLBLookup(), BaseCPU::mwaitAtomic(), BasePrefetcher::pageAddress(), TLBCoalescer::processProbeTLBEvent(), TLBCoalescer::CpuSidePort::recvFunctional(), X86ISA::GpuTLB::CpuSidePort::recvFunctional(), X86ISA::GpuTLB::MemSidePort::recvTimingResp(), ComputeUnit::DTLBPort::recvTimingResp(), BasePrefetcher::samePage(), TEST(), SETranslatingPortProxy::tryMemsetBlob(), SETranslatingPortProxy::tryWriteBlob(), ComputeUnit::updatePageDivergenceDist(), TLBCoalescer::updatePhysAddresses(), and TimingSimpleCPU::writeMem().
|
inline |
This function is used to align addresses in memory.
val | is the address to be aligned. |
align | is the alignment. Can only be a power of 2. |
align | which is greater than or equal to |
val. |
Definition at line 168 of file intmath.hh.
References isPowerOf2(), and ArmISA::mask.
Referenced by StorageSpace::addSymbol(), AlphaProcess::AlphaProcess(), AlphaProcess::argsInit(), MipsProcess::argsInit(), RiscvProcess::argsInit(), PowerProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), ArmProcess32::ArmProcess32(), ArmProcess64::ArmProcess64(), brkFunc(), ChunkGenerator::ChunkGenerator(), HsailCode::generateHsaKernelInfo(), X86ISA::I386Process::I386Process(), X86System::initState(), MipsProcess::MipsProcess(), Shader::mmap(), mmapFunc(), mremapFunc(), PowerProcess::PowerProcess(), RiscvProcess32::RiscvProcess32(), RiscvProcess64::RiscvProcess64(), Sparc32Process::Sparc32Process(), Sparc64Process::Sparc64Process(), TEST(), Process::updateBias(), and X86ISA::X86_64Process::X86_64Process().