DecodeTest.scala (8241cb85f7d34397435cf2810442754e2a0f477d) DecodeTest.scala (e3da8bad334fc71ba0d72f0607e2e93245ddaece)
1package xiangshan
2
3import chisel3._
4import chisel3.stage.ChiselGeneratorAnnotation
5import chiseltest._
6import chiseltest.VerilatorBackendAnnotation
7import chiseltest.simulator.VerilatorFlags
8import top.ArgParser
9import xiangshan.backend.decode.DecodeUnit
10import xiangshan.backend.regfile.IntPregParams
1package xiangshan
2
3import chisel3._
4import chisel3.stage.ChiselGeneratorAnnotation
5import chiseltest._
6import chiseltest.VerilatorBackendAnnotation
7import chiseltest.simulator.VerilatorFlags
8import top.ArgParser
9import xiangshan.backend.decode.DecodeUnit
10import xiangshan.backend.regfile.IntPregParams
11import types.ChiselStage
12import xiangshan.test.types._
11import circt.stage.ChiselStage
12import firrtl2.options.TargetDirAnnotation
13import xiangshan.transforms.PrintModuleName
14
15object DecodeMain extends App {
16 val (config, firrtlOpts, firtoolOpts) = ArgParser.parse(args)
17 // //val soc = DisableMonitors(p => LazyModule(new XSTop()(p)))(config)
18 // If Complex Params are needed, wrap it with a Top Module to do dirty works,
19 // and use "chisel3.aop.Select.collectDeep[ModuleWanted](WrapperModule){case a: ModuleWanted => a}.head.Params"
20 val defaultConfig = config.alterPartial({

--- 12 unchanged lines hidden (view full) ---

33 )))
34// // Generate files when compiling. Used by ChiselDB.
35// FileRegisters.write("./build")
36}
37
38class DecodeUnitTest extends XSTester {
39 behavior of "DecodeUnit"
40 it should "pass" in {
13import xiangshan.transforms.PrintModuleName
14
15object DecodeMain extends App {
16 val (config, firrtlOpts, firtoolOpts) = ArgParser.parse(args)
17 // //val soc = DisableMonitors(p => LazyModule(new XSTop()(p)))(config)
18 // If Complex Params are needed, wrap it with a Top Module to do dirty works,
19 // and use "chisel3.aop.Select.collectDeep[ModuleWanted](WrapperModule){case a: ModuleWanted => a}.head.Params"
20 val defaultConfig = config.alterPartial({

--- 12 unchanged lines hidden (view full) ---

33 )))
34// // Generate files when compiling. Used by ChiselDB.
35// FileRegisters.write("./build")
36}
37
38class DecodeUnitTest extends XSTester {
39 behavior of "DecodeUnit"
40 it should "pass" in {
41 val printModuleNameAnno = chisel3.BuildInfo.version match {
42 case "3.6.0" => Seq(RunFirrtlTransformAnnotation(new PrintModuleName))
43 case _ => Seq()
44 }
45
46 test(new DecodeUnit()(config)).withAnnotations(Seq(
47 VerilatorBackendAnnotation,
48 VerilatorFlags(Seq()),
49 WriteVcdAnnotation,
50 TargetDirAnnotation("./build")
41 test(new DecodeUnit()(config)).withAnnotations(Seq(
42 VerilatorBackendAnnotation,
43 VerilatorFlags(Seq()),
44 WriteVcdAnnotation,
45 TargetDirAnnotation("./build")
51 ) ++ printModuleNameAnno){ dut =>
46 )){ dut =>
52 dut.clock.step(10)
53 }
54 }
55}
47 dut.clock.step(10)
48 }
49 }
50}