From 0e5e1bac15dcb064a4757966dacb4e9e444859db Mon Sep 17 00:00:00 2001 From: abejgonzalez Date: Mon, 22 Apr 2019 22:36:04 -0700 Subject: [PATCH] fix test harness builds --- README.md | 2 +- common.mk | 2 +- src/main/scala/example/TestHarness.scala | 6 ++++++ variables.mk | 19 ++++++++++--------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 887dce08..7748e53e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **This branch is under development** **It currently has many submodules** -**Please run ./scripts/init-submodules-no-riscv-tools.sh to update submodules, unless you want to spend a long time waiting for submodule to clone** +**Please run ./scripts/init-submodules-no-riscv-tools.sh to update submodules, unless you want to spend a long time waiting for submodules to clone** This is a starter template for your custom RISC-V project. It will allow you to leverage the Chisel HDL and RocketChip SoC generator to produce a diff --git a/common.mk b/common.mk index b090285d..e2603be7 100644 --- a/common.mk +++ b/common.mk @@ -53,7 +53,7 @@ $(VERILOG_FILE) $(SMEMS_CONF) $(TOP_ANNO) $(TOP_FIR) $(sim_top_blackboxes): $(FI cp $(build_dir)/firrtl_black_box_resource_files.f $(sim_top_blackboxes) $(HARNESS_FILE) $(HARNESS_ANNO) $(HARNESS_FIR) $(sim_harness_blackboxes): $(FIRRTL_FILE) $(ANNO_FILE) $(sim_top_blackboxes) - cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateHarness -o $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(MODEL) -faf $(ANNO_FILE) -thaof $(HARNESS_ANNO) -thf $(HARNESS_FIR) -td $(build_dir)" + cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateHarness -o $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(FIRRTL_MODEL) -faf $(ANNO_FILE) -thaof $(HARNESS_ANNO) -thf $(HARNESS_FIR) -td $(build_dir)" grep -v "SimSerial.cc\|SimDTM.cc\|SimJTAG.cc" $(build_dir)/firrtl_black_box_resource_files.f > $(sim_harness_blackboxes) # This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs diff --git a/src/main/scala/example/TestHarness.scala b/src/main/scala/example/TestHarness.scala index 61296545..b7120329 100644 --- a/src/main/scala/example/TestHarness.scala +++ b/src/main/scala/example/TestHarness.scala @@ -18,6 +18,9 @@ class RocketTestHarness(implicit val p: Parameters) extends Module { val success = Output(Bool()) }) + // force Chisel to rename module + override def desiredName = "TestHarness" + val dut = p(BuildRocketTop)(clock, reset.toBool, p) dut.debug := DontCare dut.connectSimAXIMem() @@ -51,6 +54,9 @@ class BoomTestHarness(implicit val p: Parameters) extends Module { val success = Output(Bool()) }) + // force Chisel to rename module + override def desiredName = "TestHarness" + val dut = p(BuildBoomTop)(clock, reset.toBool, p) dut.debug := DontCare dut.connectSimAXIMem() diff --git a/variables.mk b/variables.mk index 7b2f6ba0..baf18d6a 100644 --- a/variables.mk +++ b/variables.mk @@ -6,7 +6,8 @@ # default variables to invoke the generator for a example Rocket system # descriptions: # PROJECT = the scala package to find the MODEL/Generator in -# MODEL = the top level module of the project (normally the harness) +# MODEL = the top level module of the project in Chisel (normally the harness) +# FIRRTL_MODEL = the top level module of the project in Firrtl (normally the harness) # CONFIG = the configuration class to give the parameters for the project # CFG_PROJECT = the scala package to find the CONFIG class # SBT_PROJECT = the SBT project that you should find the Generator class in @@ -16,13 +17,14 @@ # project specific: # SUB_PROJECT = use the specific subproject default variables ######################################################################################### -PROJECT ?= example -MODEL ?= RocketTestHarness -CONFIG ?= DefaultRocketConfig -CFG_PROJECT ?= $(PROJECT) -SBT_PROJECT ?= $(PROJECT) -TB ?= TestDriver -TOP ?= RocketTop +PROJECT ?= example +MODEL ?= RocketTestHarness +FIRRTL_MODEL ?= TestHarness +CONFIG ?= DefaultRocketConfig +CFG_PROJECT ?= $(PROJECT) +SBT_PROJECT ?= $(PROJECT) +TB ?= TestDriver +TOP ?= RocketTop # make it so that you only change 1 param to change most or all of them! SUB_PROJECT ?= example @@ -36,7 +38,6 @@ ifeq ($(SUB_PROJECT),boom) # for BOOM developers (only need to provide a CONFIG) PROJECT=boom.system MODEL=TestHarness - #CONFIG: User specified CFG_PROJECT=boom.system SBT_PROJECT=boom TOP=ExampleBoomSystem