gem5
v20.0.0.0
|
#include <cassert>
#include <cstdint>
#include <type_traits>
#include "base/logging.hh"
#include "base/types.hh"
Go to the source code of this file.
Functions | |
uint64_t | power (uint32_t n, uint32_t e) |
template<class T > | |
std::enable_if< std::is_integral< T >::value, int >::type | floorLog2 (T 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 79 of file intmath.hh.
References floorLog2().
Referenced by DRAMCtrl::addToReadQueue(), DRAMCtrl::addToWriteQueue(), DRAMCtrl::DRAMCtrl(), TimingExprUn::eval(), DRAMCtrl::DRAMStats::regStats(), and TEST().
|
inline |
Definition at line 99 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 57 of file intmath.hh.
References ArmISA::ts, type, ULL, and MipsISA::ux.
Referenced by Histogram::add(), CheckTable::addCheck(), BankedArray::BankedArray(), ceilLog2(), DefaultBTB::DefaultBTB(), DirectoryMemory::DirectoryMemory(), SimpleIndirectPredictor::getSetIndex(), Gicv2m::Gicv2m(), StackDistProbe::handleRequest(), Prefetcher::BOP::hash(), CacheMemory::init(), RubySystem::RubySystem(), Prefetcher::Base::setCache(), and TEST().
|
inline |
Definition at line 90 of file intmath.hh.
Referenced by Prefetcher::AccessMapPatternMatching::AccessMapPatternMatching(), AssociativeSet< Prefetcher::IrregularStreamBuffer::AddressMappingEntry >::AssociativeSet(), BaseIndexingPolicy::BaseIndexingPolicy(), BaseSetAssoc::BaseSetAssoc(), BiModeBP::BiModeBP(), Prefetcher::BOP::BOP(), ChunkGenerator::ChunkGenerator(), ComputeUnit::ComputeUnit(), DefaultBTB::DefaultBTB(), DRAMCtrl::DRAMCtrl(), EmulationPageTable::EmulationPageTable(), FALRU::FALRU(), Gicv2m::Gicv2m(), StatisticalCorrector::SCThreadHistory::initLocalHistory(), Prefetcher::IrregularStreamBuffer::IrregularStreamBuffer(), LocalBP::LocalBP(), MemFootprintProbe::MemFootprintProbe(), PciDevice::PciDevice(), roundDown(), roundUp(), RubySystem::RubySystem(), SectorTags::SectorTags(), SimpleIndirectPredictor::SimpleIndirectPredictor(), Prefetcher::STeMS::STeMS(), StoreSet::StoreSet(), TEST(), TournamentBP::TournamentBP(), TreePLRURP::TreePLRURP(), and StackDistCalc::updateTree().
|
inline |
Definition at line 40 of file intmath.hh.
References ArmISA::n, type, and warn_if.
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 131 of file intmath.hh.
References isPowerOf2(), and ArmISA::mask.
Referenced by AtomicSimpleCPU::amoMem(), RiscvProcess::argsInit(), MipsProcess::argsInit(), PowerProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), TLBCoalescer::canCoalesce(), Shader::doFunctionalAccess(), SETranslatingPortProxy::fixupAddr(), MemState::fixupFault(), X86ISA::GpuTLB::handleFuncTranslationReturn(), StackDistProbe::handleRequest(), FetchUnit::initiateFetch(), TimingSimpleCPU::initiateMemAMO(), TimingSimpleCPU::initiateMemRead(), Gcn3ISA::Inst_SMEM::initMemRead(), Gcn3ISA::Inst_SMEM::initMemWrite(), X86ISA::GpuTLB::issueTLBLookup(), BaseCPU::mwaitAtomic(), Prefetcher::Base::pageAddress(), TLBCoalescer::processProbeTLBEvent(), TLBCoalescer::CpuSidePort::recvFunctional(), X86ISA::GpuTLB::CpuSidePort::recvFunctional(), X86ISA::GpuTLB::MemSidePort::recvTimingResp(), ComputeUnit::DTLBPort::recvTimingResp(), Prefetcher::Base::samePage(), TEST(), 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 114 of file intmath.hh.
References isPowerOf2(), and ArmISA::mask.
Referenced by StorageSpace::addSymbol(), MipsProcess::argsInit(), RiscvProcess::argsInit(), PowerProcess::argsInit(), SparcProcess::argsInit(), ArmProcess::argsInit(), X86ISA::X86Process::argsInit(), ArmProcess32::ArmProcess32(), ArmProcess64::ArmProcess64(), ChunkGenerator::ChunkGenerator(), HsailCode::generateHsaKernelInfo(), GuestABI::Argument< Aapcs32, Composite, typename std::enable_if< IsAapcs32Composite< Composite >::value >::type >::get(), X86ISA::I386Process::I386Process(), X86ISA::FsWorkload::initState(), GuestABI::Aapcs32ArgumentBase::loadFromStack(), MipsProcess::MipsProcess(), Shader::mmap(), mmapFunc(), mremapFunc(), munmapFunc(), PowerProcess::PowerProcess(), RiscvProcess32::RiscvProcess32(), RiscvProcess64::RiscvProcess64(), Sparc32Process::Sparc32Process(), Sparc64Process::Sparc64Process(), TEST(), Process::updateBias(), MemState::updateBrkRegion(), and X86ISA::X86_64Process::X86_64Process().