Move HasNoLibTestGenerator out of SynFlops

This commit is contained in:
Edward Wang
2017-07-31 15:41:59 -07:00
committed by edwardcwang
parent 94b13e96fb
commit e47cf92139
2 changed files with 16 additions and 16 deletions

View File

@@ -313,6 +313,22 @@ ${generateFooter}
val output = generateOutput()
}
// Use this trait for tests that invoke the memory compiler without lib.
trait HasNoLibTestGenerator extends HasSimpleTestGenerator {
this: MacroCompilerSpec with HasSRAMGenerator =>
// If there isn't a lib, then the "lib" will become a FIRRTL "mem", which
// in turn becomes synthesized flops.
// Therefore, make "lib" width/depth equal to the mem.
override lazy val libDepth = memDepth
override lazy val libWidth = memWidth
// Do the same for port names.
override lazy val libPortPrefix = memPortPrefix
// If there is no lib, don't generate a body.
override def generateBody = ""
}
//~ class RocketChipTest extends MacroCompilerSpec {
//~ val mem = new File(macroDir, "rocketchip.json")
//~ val lib = new File(macroDir, "mylib.json")

View File

@@ -1,21 +1,5 @@
package barstools.macros
// Use this trait for tests that invoke the memory compiler without lib.
trait HasNoLibTestGenerator extends HasSimpleTestGenerator {
this: MacroCompilerSpec with HasSRAMGenerator =>
// If there isn't a lib, then the "lib" will become a FIRRTL "mem", which
// in turn becomes synthesized flops.
// Therefore, make "lib" width/depth equal to the mem.
override lazy val libDepth = memDepth
override lazy val libWidth = memWidth
// Do the same for port names.
override lazy val libPortPrefix = memPortPrefix
// If there is no lib, don't generate a body.
override def generateBody = ""
}
// Test flop synthesis of the memory compiler.
trait HasSynFlopsTestGenerator extends HasSimpleTestGenerator {