| @@ -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) | ||||
| } | } | ||||
| } | } | ||||
| @@ -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') | |||||
| } | } | ||||
| @@ -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 | ||||
| } | } | ||||
| @@ -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 | ||||
| } | } | ||||
| } | } | ||||