ruby: Fix initial weight in weighted LRU
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Wed, 6 Jun 2018 10:00:55 +0000 (12:00 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Tue, 12 Jun 2018 20:07:25 +0000 (20:07 +0000)
Initial weight was using the timestamp instead of the weight.

Change-Id: I61d3c8424f85fd6856957087c477afda111f8ca7
Reviewed-on: https://gem5-review.googlesource.com/10801
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

src/mem/ruby/system/WeightedLRUPolicy.cc

index 20ae5ad67603b23eac1c5f5b841fdc21771b64bd..2899f73a7cb404b10fad90679327c93a720e1f23 100644 (file)
@@ -92,7 +92,7 @@ WeightedLRUPolicy::getVictim(int64_t set) const
 
     smallest_index = 0;
     smallest_time = m_last_ref_ptr[set][0];
-    int smallest_weight = m_last_ref_ptr[set][0];
+    int smallest_weight = m_last_occ_ptr[set][0];
 
     for (unsigned i = 1; i < m_assoc; i++) {