Merge pull request #219 from ucb-bar/enable-j-make
Make parallel support
This commit is contained in:
commit
95793babf4
|
@ -23,7 +23,7 @@ if [ ! -d "$LOCAL_VERILATOR_DIR" ]; then
|
||||||
run "mkdir -p $REMOTE_CHIPYARD_DIR"
|
run "mkdir -p $REMOTE_CHIPYARD_DIR"
|
||||||
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
|
copy $LOCAL_CHIPYARD_DIR/ $SERVER:$REMOTE_CHIPYARD_DIR
|
||||||
|
|
||||||
run "make -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR verilator_install"
|
run "make -j$NPROC -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR verilator_install"
|
||||||
|
|
||||||
# copy so that circleci can cache
|
# copy so that circleci can cache
|
||||||
mkdir -p $LOCAL_CHIPYARD_DIR
|
mkdir -p $LOCAL_CHIPYARD_DIR
|
||||||
|
|
|
@ -17,6 +17,9 @@ clean () {
|
||||||
run "rm -rf $REMOTE_WORK_DIR"
|
run "rm -rf $REMOTE_WORK_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# make parallelism
|
||||||
|
NPROC=8
|
||||||
|
|
||||||
# remote variables
|
# remote variables
|
||||||
REMOTE_WORK_DIR=$CI_DIR/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_SHA1-$CIRCLE_JOB
|
REMOTE_WORK_DIR=$CI_DIR/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_SHA1-$CIRCLE_JOB
|
||||||
REMOTE_RISCV_DIR=$REMOTE_WORK_DIR/riscv-tools-install
|
REMOTE_RISCV_DIR=$REMOTE_WORK_DIR/riscv-tools-install
|
||||||
|
|
|
@ -41,7 +41,7 @@ fi
|
||||||
|
|
||||||
# enter the verilator directory and build the specific config on remote server
|
# enter the verilator directory and build the specific config on remote server
|
||||||
run "make -C $REMOTE_SIM_DIR clean"
|
run "make -C $REMOTE_SIM_DIR clean"
|
||||||
run "export RISCV=\"$TOOLS_DIR\"; export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR/install/share/verilator; make -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR JAVA_ARGS=\"-Xmx8G -Xss8M\" ${mapping[$1]}"
|
run "export RISCV=\"$TOOLS_DIR\"; export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; export VERILATOR_ROOT=$REMOTE_VERILATOR_DIR/install/share/verilator; make -j$NPROC -C $REMOTE_SIM_DIR VERILATOR_INSTALL_DIR=$REMOTE_VERILATOR_DIR JAVA_ARGS=\"-Xmx8G -Xss8M\" ${mapping[$1]}"
|
||||||
run "rm -rf $REMOTE_CHIPYARD_DIR/project"
|
run "rm -rf $REMOTE_CHIPYARD_DIR/project"
|
||||||
|
|
||||||
# copy back the final build
|
# copy back the final build
|
||||||
|
|
|
@ -12,11 +12,11 @@ source $SCRIPT_DIR/defaults.sh
|
||||||
export VERILATOR_ROOT=$LOCAL_VERILATOR_DIR/install/share/verilator
|
export VERILATOR_ROOT=$LOCAL_VERILATOR_DIR/install/share/verilator
|
||||||
|
|
||||||
run_bmark () {
|
run_bmark () {
|
||||||
make run-bmark-tests-fast -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
make run-bmark-tests-fast -j$NPROC -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
||||||
}
|
}
|
||||||
|
|
||||||
run_asm () {
|
run_asm () {
|
||||||
make run-asm-tests-fast -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
make run-asm-tests-fast -j$NPROC -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR $@
|
||||||
}
|
}
|
||||||
|
|
||||||
run_both () {
|
run_both () {
|
||||||
|
@ -44,7 +44,7 @@ case $1 in
|
||||||
export RISCV=$LOCAL_ESP_DIR
|
export RISCV=$LOCAL_ESP_DIR
|
||||||
export LD_LIBRARY_PATH=$LOCAL_ESP_DIR/lib
|
export LD_LIBRARY_PATH=$LOCAL_ESP_DIR/lib
|
||||||
export PATH=$RISCV/bin:$PATH
|
export PATH=$RISCV/bin:$PATH
|
||||||
make run-rv64uv-p-asm-tests -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR ${mapping[$1]}
|
make run-rv64uv-p-asm-tests -j$NPROC -C $LOCAL_SIM_DIR VERILATOR_INSTALL_DIR=$LOCAL_VERILATOR_DIR ${mapping[$1]}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "No set of tests for $1. Did you spell it right?"
|
echo "No set of tests for $1. Did you spell it right?"
|
||||||
|
|
16
common.mk
16
common.mk
|
@ -38,7 +38,9 @@ $(sim_files): $(call lookup_scala_srcs,$(base_dir)/generators/utilities/src/main
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# create firrtl file rule and variables
|
# create firrtl file rule and variables
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
$(FIRRTL_FILE) $(ANNO_FILE): $(SCALA_SOURCES) $(sim_files)
|
.INTERMEDIATE: generator_temp
|
||||||
|
$(FIRRTL_FILE) $(ANNO_FILE): generator_temp
|
||||||
|
generator_temp: $(SCALA_SOURCES) $(sim_files)
|
||||||
mkdir -p $(build_dir)
|
mkdir -p $(build_dir)
|
||||||
cd $(base_dir) && $(SBT) "project $(SBT_PROJECT)" "runMain $(GENERATOR_PACKAGE).Generator $(build_dir) $(MODEL_PACKAGE) $(MODEL) $(CONFIG_PACKAGE) $(CONFIG)"
|
cd $(base_dir) && $(SBT) "project $(SBT_PROJECT)" "runMain $(GENERATOR_PACKAGE).Generator $(build_dir) $(MODEL_PACKAGE) $(MODEL) $(CONFIG_PACKAGE) $(CONFIG)"
|
||||||
|
|
||||||
|
@ -51,16 +53,22 @@ HARNESS_CONF_FLAGS = -thconf $(HARNESS_SMEMS_CONF)
|
||||||
TOP_TARGETS = $(TOP_FILE) $(TOP_SMEMS_CONF) $(TOP_ANNO) $(TOP_FIR) $(sim_top_blackboxes)
|
TOP_TARGETS = $(TOP_FILE) $(TOP_SMEMS_CONF) $(TOP_ANNO) $(TOP_FIR) $(sim_top_blackboxes)
|
||||||
HARNESS_TARGETS = $(HARNESS_FILE) $(HARNESS_SMEMS_CONF) $(HARNESS_ANNO) $(HARNESS_FIR) $(sim_harness_blackboxes)
|
HARNESS_TARGETS = $(HARNESS_FILE) $(HARNESS_SMEMS_CONF) $(HARNESS_ANNO) $(HARNESS_FIR) $(sim_harness_blackboxes)
|
||||||
|
|
||||||
$(TOP_TARGETS) $(HARNESS_TARGETS): $(FIRRTL_FILE) $(ANNO_FILE)
|
.INTERMEDIATE: firrtl_temp
|
||||||
|
$(TOP_TARGETS) $(HARNESS_TARGETS): firrtl_temp
|
||||||
|
firrtl_temp: $(FIRRTL_FILE) $(ANNO_FILE)
|
||||||
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateTopAndHarness -o $(TOP_FILE) -tho $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tdf $(sim_top_blackboxes) -tsf $(TOP_FIR) -thaof $(HARNESS_ANNO) -hdf $(sim_harness_blackboxes) -thf $(HARNESS_FIR) $(REPL_SEQ_MEM) $(HARNESS_CONF_FLAGS) -td $(build_dir)"
|
cd $(base_dir) && $(SBT) "project tapeout" "runMain barstools.tapeout.transforms.GenerateTopAndHarness -o $(TOP_FILE) -tho $(HARNESS_FILE) -i $(FIRRTL_FILE) --syn-top $(TOP) --harness-top $(VLOG_MODEL) -faf $(ANNO_FILE) -tsaof $(TOP_ANNO) -tdf $(sim_top_blackboxes) -tsf $(TOP_FIR) -thaof $(HARNESS_ANNO) -hdf $(sim_harness_blackboxes) -thf $(HARNESS_FIR) $(REPL_SEQ_MEM) $(HARNESS_CONF_FLAGS) -td $(build_dir)"
|
||||||
|
|
||||||
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
# This file is for simulation only. VLSI flows should replace this file with one containing hard SRAMs
|
||||||
MACROCOMPILER_MODE ?= --mode synflops
|
MACROCOMPILER_MODE ?= --mode synflops
|
||||||
$(TOP_SMEMS_FILE) $(TOP_SMEMS_FIR): $(TOP_SMEMS_CONF)
|
.INTERMEDIATE: top_macro_temp
|
||||||
|
$(TOP_SMEMS_FILE) $(TOP_SMEMS_FIR): top_macro_temp
|
||||||
|
top_macro_temp: $(TOP_SMEMS_CONF)
|
||||||
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(TOP_SMEMS_CONF) -v $(TOP_SMEMS_FILE) -f $(TOP_SMEMS_FIR) $(MACROCOMPILER_MODE)"
|
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(TOP_SMEMS_CONF) -v $(TOP_SMEMS_FILE) -f $(TOP_SMEMS_FIR) $(MACROCOMPILER_MODE)"
|
||||||
|
|
||||||
HARNESS_MACROCOMPILER_MODE = --mode synflops
|
HARNESS_MACROCOMPILER_MODE = --mode synflops
|
||||||
$(HARNESS_SMEMS_FILE) $(HARNESS_SMEMS_FIR): $(HARNESS_SMEMS_CONF)
|
.INTERMEDIATE: harness_macro_temp
|
||||||
|
$(HARNESS_SMEMS_FILE) $(HARNESS_SMEMS_FIR): harness_macro_temp
|
||||||
|
harness_macro_temp: $(HARNESS_SMEMS_CONF)
|
||||||
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(HARNESS_SMEMS_CONF) -v $(HARNESS_SMEMS_FILE) -f $(HARNESS_SMEMS_FIR) $(HARNESS_MACROCOMPILER_MODE)"
|
cd $(base_dir) && $(SBT) "project barstoolsMacros" "runMain barstools.macros.MacroCompiler -n $(HARNESS_SMEMS_CONF) -v $(HARNESS_SMEMS_FILE) -f $(HARNESS_SMEMS_FIR) $(HARNESS_MACROCOMPILER_MODE)"
|
||||||
|
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|
|
@ -97,12 +97,11 @@ $(model_mk_debug): $(sim_vsrcs) $(sim_common_files) $(INSTALLED_VERILATOR)
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# invoke make to make verilator sim rules
|
# invoke make to make verilator sim rules
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
VERILATOR_MAKEFLAGS=-j8
|
|
||||||
$(sim): $(model_mk)
|
$(sim): $(model_mk)
|
||||||
$(MAKE) $(VERILATOR_MAKEFLAGS) VM_PARALLEL_BUILDS=1 -C $(model_dir) -f V$(VLOG_MODEL).mk
|
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir) -f V$(VLOG_MODEL).mk
|
||||||
|
|
||||||
$(sim_debug): $(model_mk_debug)
|
$(sim_debug): $(model_mk_debug)
|
||||||
$(MAKE) $(VERILATOR_MAKEFLAGS) VM_PARALLEL_BUILDS=1 -C $(model_dir_debug) -f V$(VLOG_MODEL).mk
|
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir_debug) -f V$(VLOG_MODEL).mk
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
# create a verilator vpd rule
|
# create a verilator vpd rule
|
||||||
|
|
Loading…
Reference in New Issue