MCPcopy Create free account
hub / github.com/cvut/qtrvsim / location_status

Method location_status

src/machine/memory/cache/cache.cpp:369–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369enum LocationStatus Cache::location_status(Address address) const {
370 const CacheLocation loc = compute_location(address);
371
372 if (cache_config.enabled()) {
373 for (auto const &set : dt) {
374 auto const &block = set[loc.row];
375
376 if (block.valid && block.tag == loc.tag) {
377 if (block.dirty
378 && cache_config.write_policy() == CacheConfig::WP_BACK) {
379 return (enum LocationStatus)(
380 LOCSTAT_CACHED | LOCSTAT_DIRTY);
381 } else {
382 return LOCSTAT_CACHED;
383 }
384 }
385 }
386 }
387 return mem->location_status(address);
388}
389
390const CacheConfig &Cache::get_config() const {
391 return cache_config;

Callers

nothing calls this directly

Calls 2

write_policyMethod · 0.80
enabledMethod · 0.45

Tested by

no test coverage detected