test: 增加部件测试
This commit is contained in:
parent
401149f111
commit
347def990a
|
@ -2,14 +2,15 @@ BUILD_DIR = ./build
|
||||||
|
|
||||||
export PATH := $(PATH):$(abspath ./utils)
|
export PATH := $(PATH):$(abspath ./utils)
|
||||||
|
|
||||||
test:
|
|
||||||
mill -i __.test
|
|
||||||
|
|
||||||
verilog:
|
verilog:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
mkdir -p $(BUILD_DIR)
|
mkdir -p $(BUILD_DIR)
|
||||||
mill -i __.test.runMain Elaborate -td $(BUILD_DIR)
|
mill -i __.test.runMain Elaborate -td $(BUILD_DIR)
|
||||||
|
|
||||||
|
test:
|
||||||
|
@echo "make test"
|
||||||
|
mill -i __.test.runMain TestMain -td $(BUILD_DIR)
|
||||||
|
|
||||||
help:
|
help:
|
||||||
mill -i __.test.runMain Elaborate --help
|
mill -i __.test.runMain Elaborate --help
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import cpu._
|
||||||
|
import circt.stage._
|
||||||
|
import cache.CacheAXIInterface
|
||||||
|
|
||||||
|
object TestMain extends App {
|
||||||
|
implicit val config = new CpuConfig()
|
||||||
|
def top = new CacheAXIInterface()
|
||||||
|
val useMFC = false // use MLIR-based firrtl compiler
|
||||||
|
val generator = Seq(chisel3.stage.ChiselGeneratorAnnotation(() => top))
|
||||||
|
if (useMFC) {
|
||||||
|
(new ChiselStage).execute(args, generator :+ CIRCTTargetAnnotation(CIRCTTarget.Verilog))
|
||||||
|
} else {
|
||||||
|
(new chisel3.stage.ChiselStage).execute(args, generator)
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,18 +0,0 @@
|
||||||
// package cpu
|
|
||||||
|
|
||||||
// import chisel3.stage.ChiselGeneratorAnnotation
|
|
||||||
|
|
||||||
// import cpu.CpuConfig
|
|
||||||
// import cpu.pipeline.execute._
|
|
||||||
// import cpu.pipeline.memory.DataMemoryAccess
|
|
||||||
// import cpu.pipeline.memory.MemoryUnit
|
|
||||||
// import cpu.pipeline.writeback.WriteBackUnit
|
|
||||||
// import cpu.pipeline.fetch.PreDecoder
|
|
||||||
|
|
||||||
// object testMain extends App {
|
|
||||||
// implicit val config = new CpuConfig()
|
|
||||||
// (new chisel3.stage.ChiselStage).execute(
|
|
||||||
// Array("--target-dir", "generated"),
|
|
||||||
// Seq(ChiselGeneratorAnnotation(() => new PreDecoder())),
|
|
||||||
// )
|
|
||||||
// }
|
|
Loading…
Reference in New Issue