Skip to content

Commit e85be18

Browse files
committed
fpga_diff: fix FpgaDiffTop generation and renaming
This change generates FpgaDiffTop as extend instead of wrapper. Also, when use `make verilog BOARD=fpgadiff`, the top sv file is SimTop.sv rather than FpgaDiffTop.sv, this change also revert previous naming error.
1 parent c347b0a commit e85be18

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
TOP = TopMain
22
SIM_TOP = SimTop
3-
FPGA_DIFF_TOP = FpgaDiffTop
43
FPGATOP = Top
54
# REAL_TOP selection:
6-
# - if BOARD is exactly "fpgadiff" -> use FPGA_DIFF_TOP
7-
# - else if BOARD starts with "sim" -> use SIM_TOP
5+
# - if BOARD is exactly "fpgadiff" or "sim" -> use SIM_TOP
86
# - otherwise use FPGATOP
9-
REAL_TOP = $(if $(filter fpgadiff,$(BOARD)),$(FPGA_DIFF_TOP),$(if $(filter sim,$(BOARD)),$(SIM_TOP),$(FPGATOP)))
7+
REAL_TOP = $(if $(filter fpgadiff sim,$(BOARD)),$(SIM_TOP),$(FPGATOP))
108

119
BUILD_DIR = $(abspath ./build)
1210

src/test/scala/TopMain.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@ class Top extends Module {
3636
dontTouch(vga.io)
3737
}
3838

39-
class FpgaDiffTop extends Module with HasDiffTestInterfaces {
40-
lazy val config = NutCoreConfig(FPGADifftest = true)
41-
val soc = Module(new NutShell()(config))
42-
val io = IO(soc.io.cloneType)
43-
soc.io <> io
44-
39+
class FpgaDiffTop extends NutShell()(NutCoreConfig(FPGADifftest = true)) with HasDiffTestInterfaces {
40+
override def desiredName: String = "NutShell"
4541
override def cpuName: Option[String] = Some("NutShell")
4642
override def connectTopIOs(difftest: DifftestTopIO): Unit = {
4743
val io = IO(chiselTypeOf(this.io))

0 commit comments

Comments
 (0)