| 280 | } |
| 281 | |
| 282 | virtual std::string ToString() const override { |
| 283 | std::string res; |
| 284 | res.append("SimCache MISSes: " + std::to_string(get_miss_counter()) + "\n"); |
| 285 | res.append("SimCache HITs: " + std::to_string(get_hit_counter()) + "\n"); |
| 286 | char buff[350]; |
| 287 | auto lookups = get_miss_counter() + get_hit_counter(); |
| 288 | snprintf(buff, sizeof(buff), "SimCache HITRATE: %.2f%%\n", |
| 289 | (lookups == 0 ? 0 : get_hit_counter() * 100.0f / lookups)); |
| 290 | res.append(buff); |
| 291 | return res; |
| 292 | } |
| 293 | |
| 294 | virtual std::string GetPrintableOptions() const override { |
| 295 | std::string ret; |