1
0

Provide a GeneratorApp object per user package. Extract RocketTestSuite from coreplex into rocketchip and provide GeneratorApp defaults for other target packages.

This commit is contained in:
Henry Cook 2016-09-22 15:59:29 -07:00
parent 83c08a931d
commit 411ee378de
9 changed files with 10 additions and 25 deletions

View File

@ -23,8 +23,6 @@ $(FIRRTL_JAR): $(shell find $(base_dir)/firrtl/src/main/scala -iname "*.scala")
$(MAKE) -C $(base_dir)/firrtl SBT="$(SBT)" root_dir=$(base_dir)/firrtl build-scala $(MAKE) -C $(base_dir)/firrtl SBT="$(SBT)" root_dir=$(base_dir)/firrtl build-scala
touch $(FIRRTL_JAR) touch $(FIRRTL_JAR)
CHISEL_ARGS := --targetDir $(generated_dir)
src_path = src/main/scala src_path = src/main/scala
default_submodules = . hardfloat context-dependent-environments chisel3 default_submodules = . hardfloat context-dependent-environments chisel3
chisel_srcs = $(foreach submodule,$(default_submodules) $(ROCKETCHIP_ADDONS),$(shell find $(base_dir)/$(submodule)/$(src_path) -name "*.scala")) chisel_srcs = $(foreach submodule,$(default_submodules) $(ROCKETCHIP_ADDONS),$(shell find $(base_dir)/$(submodule)/$(src_path) -name "*.scala"))

View File

@ -23,10 +23,7 @@ debug: $(emu_debug)
clean: clean:
rm -rf *.o *.a emulator-* $(generated_dir) $(generated_dir_debug) DVEfiles $(output_dir) rm -rf *.o *.a emulator-* $(generated_dir) $(generated_dir_debug) DVEfiles $(output_dir)
test: .PHONY: default all debug clean
cd $(base_dir) && $(SBT) "~make $(CURDIR) run-fast $(CHISEL_ARGS)"
.PHONY: default all debug clean test
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Run assembly tests and benchmarks # Run assembly tests and benchmarks

View File

@ -10,11 +10,11 @@ verilog_debug = $(generated_dir_debug)/$(long_name).v
$(generated_dir)/%.fir $(generated_dir)/%.prm $(generated_dir)/%.d: $(chisel_srcs) $(bootrom_img) $(generated_dir)/%.fir $(generated_dir)/%.prm $(generated_dir)/%.d: $(chisel_srcs) $(bootrom_img)
mkdir -p $(dir $@) mkdir -p $(dir $@)
cd $(base_dir) && $(SBT) "run $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" cd $(base_dir) && $(SBT) "run-main $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)"
$(generated_dir_debug)/%.fir $(generated_dir_debug)/%.prm $(generated_dir_debug)/%.d: $(chisel_srcs) $(bootrom_img) $(generated_dir_debug)/%.fir $(generated_dir_debug)/%.prm $(generated_dir_debug)/%.d: $(chisel_srcs) $(bootrom_img)
mkdir -p $(dir $@) mkdir -p $(dir $@)
cd $(base_dir) && $(SBT) "run $(generated_dir_debug) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" cd $(base_dir) && $(SBT) "run-main $(PROJECT).Generator $(generated_dir_debug) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)"
%.v: %.fir $(FIRRTL_JAR) %.v: %.fir $(FIRRTL_JAR)
mkdir -p $(dir $@) mkdir -p $(dir $@)

View File

@ -32,7 +32,7 @@ object BuildSettings extends Build {
a.split(" ") a.split(" ")
}, },
unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"), unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"),
mainClass in (Compile, run) := Some("rocketchip.RocketChipGenerator"), mainClass in (Compile, run) := Some("rocketchip.Generator"),
make := { make := {
val jobs = java.lang.Runtime.getRuntime.availableProcessors val jobs = java.lang.Runtime.getRuntime.availableProcessors
val (makeDir, target) = setMake.parsed val (makeDir, target) = setMake.parsed

View File

@ -2,11 +2,7 @@
package groundtest package groundtest
import Chisel._ object Generator extends util.GeneratorApp {
import util.Generator
object GroundtestGenerator extends Generator
{
val longName = names.topModuleProject + "." + names.configs val longName = names.topModuleProject + "." + names.configs
generateFirrtl generateFirrtl
generateTestSuiteMakefrags // TODO: Needed only for legacy make targets generateTestSuiteMakefrags // TODO: Needed only for legacy make targets

View File

@ -2,14 +2,12 @@
package rocketchip package rocketchip
import Chisel._
import rocket.{XLen, UseVM, UseAtomics, UseCompressed, FPUKey} import rocket.{XLen, UseVM, UseAtomics, UseCompressed, FPUKey}
import util.Generator
import scala.collection.mutable.LinkedHashSet import scala.collection.mutable.LinkedHashSet
/** A Generator for platforms containing Rocket Coreplexes */ /** A Generator for platforms containing Rocket Coreplexes */
object RocketChipGenerator extends Generator object Generator extends util.GeneratorApp {
{
val rv64RegrTestNames = LinkedHashSet( val rv64RegrTestNames = LinkedHashSet(
"rv64ud-v-fcvt", "rv64ud-v-fcvt",
"rv64ud-p-fdiv", "rv64ud-p-fdiv",

View File

@ -2,11 +2,7 @@
package unittest package unittest
import Chisel._ object Generator extends util.GeneratorApp {
import util.Generator
object UnitTestGenerator extends Generator
{
val longName = names.topModuleProject + "." + names.configs val longName = names.topModuleProject + "." + names.configs
generateFirrtl generateFirrtl
generateTestSuiteMakefrags // TODO: Needed only for legacy make targets generateTestSuiteMakefrags // TODO: Needed only for legacy make targets

View File

@ -60,7 +60,7 @@ trait HasGeneratorUtilities {
/** Standardized command line interface for Scala entry point */ /** Standardized command line interface for Scala entry point */
trait Generator extends App with HasGeneratorUtilities { trait GeneratorApp extends App with HasGeneratorUtilities {
lazy val names: ParsedInputNames = { lazy val names: ParsedInputNames = {
require(args.size == 5, "Usage: sbt> " + require(args.size == 5, "Usage: sbt> " +
"run TargetDir TopModuleProjectName TopModuleName " + "run TargetDir TopModuleProjectName TopModuleName " +

View File

@ -10,7 +10,7 @@ verilog = $(generated_dir)/$(long_name).v
$(generated_dir)/%.fir $(generated_dir)/%.prm $(generated_dir)/%.d: $(chisel_srcs) $(bootrom_img) $(generated_dir)/%.fir $(generated_dir)/%.prm $(generated_dir)/%.d: $(chisel_srcs) $(bootrom_img)
mkdir -p $(dir $@) mkdir -p $(dir $@)
cd $(base_dir) && $(SBT) "run $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)" cd $(base_dir) && $(SBT) "run-main $(PROJECT).Generator $(generated_dir) $(PROJECT) $(MODEL) $(CFG_PROJECT) $(CONFIG)"
$(generated_dir)/$(long_name).v $(generated_dir)/$(long_name).conf : $(firrtl) $(FIRRTL_JAR) $(generated_dir)/$(long_name).v $(generated_dir)/$(long_name).conf : $(firrtl) $(FIRRTL_JAR)
mkdir -p $(dir $@) mkdir -p $(dir $@)