From daf8ea247b3a9febe1c548ea798e869800687c42 Mon Sep 17 00:00:00 2001 From: peteraa Date: Mon, 28 Oct 2019 16:21:52 +0100 Subject: [PATCH] More embarrasing errors fixed --- src/test/scala/Manifest.scala | 5 ++++- src/test/scala/RISCV/printUtils.scala | 1 + src/test/scala/RISCV/testRunner.scala | 8 +++++--- theory2.org | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/test/scala/Manifest.scala b/src/test/scala/Manifest.scala index 0186575..58b87d0 100644 --- a/src/test/scala/Manifest.scala +++ b/src/test/scala/Manifest.scala @@ -61,8 +61,11 @@ class ProfileBranching extends FlatSpec with Matchers { class ProfileCache extends FlatSpec with Matchers { it should "profile a cache" in { + say("Warning, this test takes forever to run! 2 minutes on my machine at least.") + say("This happens due to the less than optimal way of storing the update log. Sorry I guess") + say("You probably want to debug this with a smaller program") TestRunner.profileCache( - Manifest.singleTestOptions.copy(testName = "convolution.s", maxSteps = 50000) + Manifest.singleTestOptions.copy(testName = "convolution.s", maxSteps = 150000) ) should be(true) } } diff --git a/src/test/scala/RISCV/printUtils.scala b/src/test/scala/RISCV/printUtils.scala index 02b76fc..4cc61fc 100644 --- a/src/test/scala/RISCV/printUtils.scala +++ b/src/test/scala/RISCV/printUtils.scala @@ -101,6 +101,7 @@ object PrintUtils { def binary: String = String.format("%" + 32 + "s", i.toBinaryString) .replace(' ', '0').grouped(4) .map(x => x + " ").mkString + def binary(n: Int): String = String.format("%" + n + "s", i.toBinaryString).replace(' ', '0') } diff --git a/src/test/scala/RISCV/testRunner.scala b/src/test/scala/RISCV/testRunner.scala index 96e5c4b..3d9d60c 100644 --- a/src/test/scala/RISCV/testRunner.scala +++ b/src/test/scala/RISCV/testRunner.scala @@ -150,9 +150,9 @@ object TestRunner { // called an if guard. case Taken(from, to) :: t if( predictionTable(from)) => helper(t, predictionTable) case Taken(from, to) :: t if(!predictionTable(from)) => 1 + helper(t, predictionTable.updated(from, true)) - case NotTaken(addr) :: t if(!predictionTable(addr)) => 1 + helper(t, predictionTable.updated(addr, false)) - case NotTaken(addr) :: t if( predictionTable(addr)) => helper(t, predictionTable) - case _ => 0 + case NotTaken(addr) :: t if( predictionTable(addr)) => 1 + helper(t, predictionTable.updated(addr, false)) + case NotTaken(addr) :: t if(!predictionTable(addr)) => helper(t, predictionTable) + case Nil => 0 } } @@ -164,9 +164,11 @@ object TestRunner { helper(events, initState) } + say(OneBitInfiniteSlots(events)) } + true } diff --git a/theory2.org b/theory2.org index 0837bb6..bd96f6b 100644 --- a/theory2.org +++ b/theory2.org @@ -172,8 +172,8 @@ // called an if guard. case Taken(from, to) :: t if( predictionTable(from)) => helper(t, predictionTable) case Taken(from, to) :: t if(!predictionTable(from)) => 1 + helper(t, predictionTable.updated(from, true)) - case NotTaken(addr) :: t if(!predictionTable(addr)) => 1 + helper(t, predictionTable.updated(addr, false)) - case NotTaken(addr) :: t if( predictionTable(addr)) => helper(t, predictionTable) + case NotTaken(addr) :: t if( predictionTable(addr)) => 1 + helper(t, predictionTable.updated(addr, false)) + case NotTaken(addr) :: t if(!predictionTable(addr)) => helper(t, predictionTable) case _ => 0 } }