| 367 | } |
| 368 | |
| 369 | enum 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 | |
| 390 | const CacheConfig &Cache::get_config() const { |
| 391 | return cache_config; |
nothing calls this directly
no test coverage detected