gem5 v24.0.0.0
Loading...
Searching...
No Matches
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
37namespace gem5
38{
39
40namespace replacement_policy
41{
42
44 : LRU(p), btp(p.btp)
45{
46}
47
48void
49BIP::reset(const std::shared_ptr<ReplacementData>& replacement_data) const
50{
51 std::shared_ptr<LRUReplData> casted_replacement_data =
52 std::static_pointer_cast<LRUReplData>(replacement_data);
53
54 // Entries are inserted as MRU if lower than btp, LRU otherwise
55 if (random_mt.random<unsigned>(1, 100) <= btp) {
56 casted_replacement_data->lastTouchTick = curTick();
57 } else {
58 // Make their timestamps as old as possible, so that they become LRU
59 casted_replacement_data->lastTouchTick = 1;
60 }
61}
62
63} // namespace replacement_policy
64} // namespace gem5
Copyright (c) 2018-2020 Inria All rights reserved.
const unsigned btp
Bimodal throtle parameter.
Definition bip_rp.hh:62
void reset(const std::shared_ptr< ReplacementData > &replacement_data) const override
Reset replacement data for an entry.
Definition bip_rp.cc:49
BIP(const Params &p)
Definition bip_rp.cc:43
Random random_mt
Definition random.cc:99
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
Bitfield< 0 > p
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Tick curTick()
The universal simulation clock.
Definition cur_tick.hh:46

Generated on Tue Jun 18 2024 16:24:05 for gem5 by doxygen 1.11.0