Skip to content

Commit

Permalink
PrintModuleName: must run after wiring transform
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwljwljwljw committed Oct 24, 2020
1 parent 10fe830 commit 903af6a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
5 changes: 2 additions & 3 deletions debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ disassemble-xv6:
cp $(XV6_HOME)/build/code.txt ./d-xv6.log


P = 4
SUITE = xiangshan.backend.exu.AluTest
SUITE = cache.L2CacheTest

unit-test:
cd .. && mill XiangShan.test.testOnly -o -s $(SUITE) -P$(P)
cd .. && mill XiangShan.test.testOnly -o -s $(SUITE)

unit-test-all:
cd .. && mill XiangShan.test.test -P$(P)
Expand Down
4 changes: 4 additions & 0 deletions src/main/scala/xstransforms/PrintModuleName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ package xstransforms

import firrtl._
import firrtl.ir._
import firrtl.options.Dependency
import firrtl.passes.wiring.WiringTransform
import firrtl.stage.TransformManager.TransformDependency
import utils.XSLog

class PrintModuleName extends Transform with DependencyAPIMigration {

// avoid print's check
override def prerequisites = firrtl.stage.Forms.Checks
override def invalidates(a: Transform) = false
override def optionalPrerequisites = Seq(Dependency[WiringTransform])

override protected def execute(state: CircuitState): CircuitState = {

Expand Down
17 changes: 7 additions & 10 deletions src/test/scala/cache/L2CacheTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ class L2CacheTest extends FlatSpec with ChiselScalatestTester with Matchers{

top.Parameters.set(top.Parameters.debugParameters)

val annos = Seq(
VerilatorBackendAnnotation,
RunFirrtlTransformAnnotation(new PrintModuleName)
)

it should "run" in {

implicit val p = Parameters((site, up, here) => {
Expand All @@ -264,16 +269,8 @@ class L2CacheTest extends FlatSpec with ChiselScalatestTester with Matchers{
L3CacheTestParams()
})

/*
test(LazyModule(new L2TestTopWrapper()).module)
.withAnnotations(Seq(
VerilatorBackendAnnotation,
RunFirrtlTransformAnnotation(new PrintModuleName)
)){ c =>
*/

test(LazyModule(new L2TestTopWrapper()).module)
.withAnnotations(Seq(VerilatorBackendAnnotation)){ c =>
test(LazyModule(new L2TestTopWrapper()).module)
.withAnnotations(annos){ c =>

c.io.in.initSource().setSourceClock(c.clock)
c.io.out.initSink().setSinkClock(c.clock)
Expand Down

0 comments on commit 903af6a

Please sign in to comment.