ChampSim
|
#include <cache.h>
Classes | |
struct | BLOCK |
class | Builder |
class | builder_conversion_tag |
struct | module_concept |
struct | module_model |
struct | mshr_type |
struct | tag_lookup_type |
Public Types | |
using | stats_type = cache_stats |
Public Member Functions | |
long | operate () override final |
void | initialize () override final |
void | begin_phase () override final |
void | end_phase (unsigned cpu) override final |
std::size_t | get_occupancy (uint8_t queue_type, uint64_t address) |
std::size_t | get_size (uint8_t queue_type, uint64_t address) |
std::size_t | get_mshr_occupancy () const |
std::size_t | get_mshr_size () const |
double | get_mshr_occupancy_ratio () const |
std::vector< std::size_t > | get_rq_occupancy () const |
std::vector< std::size_t > | get_rq_size () const |
std::vector< double > | get_rq_occupancy_ratio () const |
std::vector< std::size_t > | get_wq_occupancy () const |
std::vector< std::size_t > | get_wq_size () const |
std::vector< double > | get_wq_occupancy_ratio () const |
std::vector< std::size_t > | get_pq_occupancy () const |
std::vector< std::size_t > | get_pq_size () const |
std::vector< double > | get_pq_occupancy_ratio () const |
uint64_t | get_set (uint64_t address) const |
uint64_t | get_way (uint64_t address, uint64_t set) const |
uint64_t | invalidate_entry (uint64_t inval_addr) |
int | prefetch_line (uint64_t pf_addr, bool fill_this_level, uint32_t prefetch_metadata) |
int | prefetch_line (uint64_t ip, uint64_t base_addr, uint64_t pf_addr, bool fill_this_level, uint32_t prefetch_metadata) |
void | print_deadlock () override |
void | impl_prefetcher_initialize () |
uint32_t | impl_prefetcher_cache_operate (uint64_t addr, uint64_t ip, uint8_t cache_hit, bool useful_prefetch, uint8_t type, uint32_t metadata_in) |
uint32_t | impl_prefetcher_cache_fill (uint64_t addr, uint32_t set, uint32_t way, uint8_t prefetch, uint64_t evicted_addr, uint32_t metadata_in) |
void | impl_prefetcher_cycle_operate () |
void | impl_prefetcher_final_stats () |
void | impl_prefetcher_branch_operate (uint64_t ip, uint8_t branch_type, uint64_t branch_target) |
void | impl_initialize_replacement () |
uint32_t | impl_find_victim (uint32_t triggering_cpu, uint64_t instr_id, uint32_t set, const BLOCK *current_set, uint64_t ip, uint64_t full_addr, uint32_t type) |
void | impl_update_replacement_state (uint32_t triggering_cpu, uint32_t set, uint32_t way, uint64_t full_addr, uint64_t ip, uint64_t victim_addr, uint32_t type, uint8_t hit) |
void | impl_replacement_final_stats () |
template<unsigned long long P_FLAG, unsigned long long R_FLAG> | |
CACHE (Builder< P_FLAG, R_FLAG > b) | |
![]() | |
operable (double scale) | |
long | _operate () |
Public Attributes | |
std::vector< channel_type * > | upper_levels |
channel_type * | lower_level |
channel_type * | lower_translate |
uint32_t | cpu = 0 |
const std::string | NAME |
const uint32_t | NUM_SET |
const uint32_t | NUM_WAY |
const uint32_t | MSHR_SIZE |
const std::size_t | PQ_SIZE |
const uint64_t | HIT_LATENCY |
const uint64_t | FILL_LATENCY |
const unsigned | OFFSET_BITS |
set_type | block {NUM_SET * NUM_WAY} |
const long int | MAX_TAG |
const long int | MAX_FILL |
const bool | prefetch_as_load |
const bool | match_offset_bits |
const bool | virtual_prefetch |
bool | ever_seen_data = false |
const unsigned | pref_activate_mask = (1 << champsim::to_underlying(access_type::LOAD)) | (1 << champsim::to_underlying(access_type::PREFETCH)) |
stats_type | sim_stats |
stats_type | roi_stats |
std::deque< mshr_type > | MSHR |
std::deque< mshr_type > | inflight_writes |
std::unique_ptr< module_concept > | module_pimpl |
![]() | |
const double | CLOCK_SCALE |
double | leap_operation = 0 |
uint64_t | current_cycle = 0 |
bool | warmup = true |
Private Types | |
enum | FILL_LEVEL { FILL_L1 = 1 , FILL_L2 = 2 , FILL_LLC = 4 , FILL_DRC = 8 , FILL_DRAM = 16 } |
using | channel_type = champsim::channel |
using | request_type = typename channel_type::request_type |
using | response_type = typename channel_type::response_type |
using | set_type = std::vector< BLOCK > |
Private Member Functions | |
bool | try_hit (const tag_lookup_type &handle_pkt) |
bool | handle_fill (const mshr_type &fill_mshr) |
bool | handle_miss (const tag_lookup_type &handle_pkt) |
bool | handle_write (const tag_lookup_type &handle_pkt) |
void | finish_packet (const response_type &packet) |
void | finish_translation (const response_type &packet) |
void | issue_translation () |
std::pair< set_type::iterator, set_type::iterator > | get_set_span (uint64_t address) |
std::pair< set_type::const_iterator, set_type::const_iterator > | get_set_span (uint64_t address) const |
std::size_t | get_set_index (uint64_t address) const |
template<typename T > | |
bool | should_activate_prefetcher (const T &pkt) const |
template<bool > | |
auto | initiate_tag_check (champsim::channel *ul=nullptr) |
Private Attributes | |
std::deque< tag_lookup_type > | internal_PQ {} |
std::deque< tag_lookup_type > | inflight_tag_check {} |
std::deque< tag_lookup_type > | translation_stash {} |
|
private |
|
private |
|
private |
|
private |
using CACHE::stats_type = cache_stats |
|
private |
|
inlineexplicit |
|
finaloverridevirtual |
Reimplemented from champsim::operable.
|
finaloverridevirtual |
Reimplemented from champsim::operable.
|
private |
|
private |
std::size_t CACHE::get_mshr_occupancy | ( | ) | const |
double CACHE::get_mshr_occupancy_ratio | ( | ) | const |
std::size_t CACHE::get_mshr_size | ( | ) | const |
std::size_t CACHE::get_occupancy | ( | uint8_t | queue_type, |
uint64_t | address | ||
) |
std::vector< std::size_t > CACHE::get_pq_occupancy | ( | ) | const |
std::vector< double > CACHE::get_pq_occupancy_ratio | ( | ) | const |
std::vector< std::size_t > CACHE::get_pq_size | ( | ) | const |
std::vector< std::size_t > CACHE::get_rq_occupancy | ( | ) | const |
std::vector< double > CACHE::get_rq_occupancy_ratio | ( | ) | const |
std::vector< std::size_t > CACHE::get_rq_size | ( | ) | const |
uint64_t CACHE::get_set | ( | uint64_t | address | ) | const |
|
private |
|
private |
|
private |
std::size_t CACHE::get_size | ( | uint8_t | queue_type, |
uint64_t | address | ||
) |
uint64_t CACHE::get_way | ( | uint64_t | address, |
uint64_t | set | ||
) | const |
std::vector< std::size_t > CACHE::get_wq_occupancy | ( | ) | const |
std::vector< double > CACHE::get_wq_occupancy_ratio | ( | ) | const |
std::vector< std::size_t > CACHE::get_wq_size | ( | ) | const |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
finaloverridevirtual |
Reimplemented from champsim::operable.
|
private |
uint64_t CACHE::invalidate_entry | ( | uint64_t | inval_addr | ) |
|
private |
|
finaloverridevirtual |
Implements champsim::operable.
int CACHE::prefetch_line | ( | uint64_t | ip, |
uint64_t | base_addr, | ||
uint64_t | pf_addr, | ||
bool | fill_this_level, | ||
uint32_t | prefetch_metadata | ||
) |
int CACHE::prefetch_line | ( | uint64_t | pf_addr, |
bool | fill_this_level, | ||
uint32_t | prefetch_metadata | ||
) |
|
overridevirtual |
Reimplemented from champsim::operable.
|
private |
|
private |
uint32_t CACHE::cpu = 0 |
bool CACHE::ever_seen_data = false |
const uint64_t CACHE::FILL_LATENCY |
const uint64_t CACHE::HIT_LATENCY |
|
private |
std::deque<mshr_type> CACHE::inflight_writes |
|
private |
channel_type* CACHE::lower_level |
channel_type* CACHE::lower_translate |
const bool CACHE::match_offset_bits |
const long int CACHE::MAX_FILL |
const long int CACHE::MAX_TAG |
std::unique_ptr<module_concept> CACHE::module_pimpl |
std::deque<mshr_type> CACHE::MSHR |
const uint32_t CACHE::MSHR_SIZE |
const std::string CACHE::NAME |
const uint32_t CACHE::NUM_SET |
const uint32_t CACHE::NUM_WAY |
const unsigned CACHE::OFFSET_BITS |
const std::size_t CACHE::PQ_SIZE |
const unsigned CACHE::pref_activate_mask = (1 << champsim::to_underlying(access_type::LOAD)) | (1 << champsim::to_underlying(access_type::PREFETCH)) |
const bool CACHE::prefetch_as_load |
stats_type CACHE::roi_stats |
stats_type CACHE::sim_stats |
|
private |
std::vector<channel_type*> CACHE::upper_levels |
const bool CACHE::virtual_prefetch |