From db428184208c7a57052d4d7cc994f1e4b3664969 Mon Sep 17 00:00:00 2001 From: Wei Song Date: Mon, 13 Apr 2015 16:35:13 +0100 Subject: [PATCH] fix cache line index offset in cachesim.cc --- riscv/cachesim.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/cachesim.cc b/riscv/cachesim.cc index 9a11187..90ab5be 100644 --- a/riscv/cachesim.cc +++ b/riscv/cachesim.cc @@ -45,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](); -- 2.30.2