Add cost function selection test

This commit is contained in:
Edward Wang
2017-08-01 14:19:10 -07:00
committed by edwardcwang
parent 0203aa9e7c
commit 0f4683700f
3 changed files with 116 additions and 1 deletions

View File

@@ -90,6 +90,7 @@ class ExternalMetric(path: String) extends CostMetric {
}
/** The current default metric in barstools, re-defined by Donggyu. */
// TODO: write tests for this function to make sure it selects the right things
object NewDefaultMetric extends CostMetric {
override def cost(mem: Macro, lib: Macro): Option[BigInt] = {
val memMask = mem.src.ports map (_.maskGran) find (_.isDefined) map (_.get)