gem5  v22.0.0.2
bip_rp.cc
Go to the documentation of this file.
1 
30 
31 #include <memory>
32 
33 #include "base/random.hh"
34 #include "params/BIPRP.hh"
35 #include "sim/cur_tick.hh"
36 
37 namespace gem5
38 {
39 
40 GEM5_DEPRECATED_NAMESPACE(ReplacementPolicy, replacement_policy);
41 namespace replacement_policy
42 {
43 
44 BIP::BIP(const Params &p)
45  : LRU(p), btp(p.btp)
46 {
47 }
48 
49 void
50 BIP::reset(const std::shared_ptr<ReplacementData>& replacement_data) const
51 {
52  std::shared_ptr<LRUReplData> casted_replacement_data =
53  std::static_pointer_cast<LRUReplData>(replacement_data);
54 
55  // Entries are inserted as MRU if lower than btp, LRU otherwise
56  if (random_mt.random<unsigned>(1, 100) <= btp) {
57  casted_replacement_data->lastTouchTick = curTick();
58  } else {
59  // Make their timestamps as old as possible, so that they become LRU
60  casted_replacement_data->lastTouchTick = 1;
61  }
62 }
63 
64 } // namespace replacement_policy
65 } // namespace gem5
gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
bip_rp.hh
Copyright (c) 2018-2020 Inria All rights reserved.
gem5::replacement_policy::BIP::BIP
BIP(const Params &p)
Definition: bip_rp.cc:44
gem5::replacement_policy::Base::Params
BaseReplacementPolicyParams Params
Definition: base.hh:58
cur_tick.hh
random.hh
gem5::Random::random
std::enable_if_t< std::is_integral_v< T >, T > random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
Definition: random.hh:90
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::GEM5_DEPRECATED_NAMESPACE
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
gem5::replacement_policy::BIP::btp
const unsigned btp
Bimodal throtle parameter.
Definition: bip_rp.hh:63
gem5::replacement_policy::LRU
Definition: lru_rp.hh:49
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::random_mt
Random random_mt
Definition: random.cc:99
gem5::replacement_policy::BIP::reset
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data for an entry.
Definition: bip_rp.cc:50

Generated on Thu Jul 28 2022 13:32:34 for gem5 by doxygen 1.8.17