Update README
[riscv-isa-sim.git] / riscv / cachesim.cc
index cd33ca11f58328ee3e5f26d7fbc86f33f820a858..90ab5be3d9ff168db3cbc769e3ac550d6b2b41ea 100644 (file)
@@ -1,3 +1,5 @@
+// See LICENSE for license details.
+
 #include "cachesim.h"
 #include "common.h"
 #include <cstdlib>
@@ -43,7 +45,7 @@ void cache_sim_t::init()
     help();
 
   idx_shift = 0;
-  for (size_t x = linesz; x; x >>= 1)
+  for (size_t x = linesz; x>1; x >>= 1)
     idx_shift++;
 
   tags = new uint64_t[sets*ways]();