Bläddra i källkod

More embarrasing errors fixed

master
peteraa 6 år sedan
förälder
incheckning
daf8ea247b
4 ändrade filer med 12 tillägg och 6 borttagningar
  1. +4
    -1
      src/test/scala/Manifest.scala
  2. +1
    -0
      src/test/scala/RISCV/printUtils.scala
  3. +5
    -3
      src/test/scala/RISCV/testRunner.scala
  4. +2
    -2
      theory2.org

+ 4
- 1
src/test/scala/Manifest.scala Visa fil

@@ -61,8 +61,11 @@ class ProfileBranching extends FlatSpec with Matchers {


class ProfileCache extends FlatSpec with Matchers { class ProfileCache extends FlatSpec with Matchers {
it should "profile a cache" in { 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( TestRunner.profileCache(
Manifest.singleTestOptions.copy(testName = "convolution.s", maxSteps = 50000)
Manifest.singleTestOptions.copy(testName = "convolution.s", maxSteps = 150000)
) should be(true) ) should be(true)
} }
} }


+ 1
- 0
src/test/scala/RISCV/printUtils.scala Visa fil

@@ -101,6 +101,7 @@ object PrintUtils {
def binary: String = String.format("%" + 32 + "s", i.toBinaryString) def binary: String = String.format("%" + 32 + "s", i.toBinaryString)
.replace(' ', '0').grouped(4) .replace(' ', '0').grouped(4)
.map(x => x + " ").mkString .map(x => x + " ").mkString
def binary(n: Int): String = String.format("%" + n + "s", i.toBinaryString).replace(' ', '0')
} }






+ 5
- 3
src/test/scala/RISCV/testRunner.scala Visa fil

@@ -150,9 +150,9 @@ object TestRunner {
// called an if guard. // called an if guard.
case Taken(from, to) :: t if( predictionTable(from)) => helper(t, predictionTable) 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 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) helper(events, initState)
} }

say(OneBitInfiniteSlots(events)) say(OneBitInfiniteSlots(events))
} }



true true
} }




+ 2
- 2
theory2.org Visa fil

@@ -172,8 +172,8 @@
// called an if guard. // called an if guard.
case Taken(from, to) :: t if( predictionTable(from)) => helper(t, predictionTable) 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 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 case _ => 0
} }
} }


Laddar…
Avbryt
Spara