diff --git a/.github/scripts/defaults.sh b/.github/scripts/defaults.sh index 6ca434fb..57fdfaa8 100755 --- a/.github/scripts/defaults.sh +++ b/.github/scripts/defaults.sh @@ -23,6 +23,11 @@ LOCAL_CHIPYARD_DIR=$GITHUB_WORKSPACE LOCAL_SIM_DIR=$LOCAL_CHIPYARD_DIR/sims/verilator LOCAL_FIRESIM_DIR=$LOCAL_CHIPYARD_DIR/sims/firesim/sim +# CI uses temp directories with very long names +# explicitly force socket creation to use /tmp to avoid name length errors +# https://github.com/sbt/sbt/pull/6887 +JAVA_TMP_DIR=$(mktemp -d -t ci-cy-XXXXXXXX) + # key value store to get the build groups declare -A grouping grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone" diff --git a/.github/scripts/remote-do-rtl-build.sh b/.github/scripts/remote-do-rtl-build.sh index 0e887e9a..b5755d01 100755 --- a/.github/scripts/remote-do-rtl-build.sh +++ b/.github/scripts/remote-do-rtl-build.sh @@ -53,5 +53,5 @@ read -a keys <<< ${grouping[$1]} for key in "${keys[@]}" do export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache - make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" ${mapping[$key]} + make -j$REMOTE_MAKE_NPROC -C $REMOTE_MAKE_DIR FIRRTL_LOGLEVEL=info JAVA_TMP_DIR=$JAVA_TMP_DIR SBT_OPTS="$REMOTE_SBT_OPTS" ${mapping[$key]} done diff --git a/.github/scripts/remote-run-firesim-scala-tests.sh b/.github/scripts/remote-run-firesim-scala-tests.sh index 6d475921..960d1706 100755 --- a/.github/scripts/remote-run-firesim-scala-tests.sh +++ b/.github/scripts/remote-run-firesim-scala-tests.sh @@ -16,4 +16,5 @@ cd $REMOTE_CHIPYARD_DIR # Run Firesim Scala Tests export FIRESIM_ENV_SOURCED=1; export COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache -make -C $REMOTE_FIRESIM_DIR JAVA_OPTS="$REMOTE_JAVA_OPTS" SBT_OPTS="$REMOTE_SBT_OPTS" TARGET_SBT_PROJECT="{file:$REMOTE_CHIPYARD_DIR}firechip" testOnly ${mapping[$1]} +JAVA_TOOL_OPTIONS="$REMOTE_JAVA_OPTS -Djava.io.tmpdir=$(mktemp -d -t cy-fsim-XXXXXXXX)" +make -C $REMOTE_FIRESIM_DIR JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS" SBT_OPTS="$REMOTE_SBT_OPTS" TARGET_SBT_PROJECT="{file:$REMOTE_CHIPYARD_DIR}firechip" testOnly ${mapping[$1]} diff --git a/.github/workflows/chipyard-full-flow.yml b/.github/workflows/chipyard-full-flow.yml index cc2168e8..22382571 100644 --- a/.github/workflows/chipyard-full-flow.yml +++ b/.github/workflows/chipyard-full-flow.yml @@ -13,6 +13,7 @@ defaults: env: REMOTE_WORK_DIR: ${{ secrets.BUILDDIR }}/cy-ci-shared/cy-${{ github.sha }} + JAVA_TMP_DIR: /tmp/cy-${{ github.sha }}-full jobs: cancel-prior-workflows: diff --git a/fpga/Makefile b/fpga/Makefile index 037b2fb9..79bdb338 100644 --- a/fpga/Makefile +++ b/fpga/Makefile @@ -90,11 +90,14 @@ fpga_common_script_dir := $(fpga_dir)/common/tcl ######################################################################################### # setup misc. sim files ######################################################################################### +SIM_FILE_REQS += \ + $(ROCKETCHIP_RSRCS_DIR)/vsrc/EICG_wrapper.v + # copy files but ignore *.h files in *.f (match vcs) -$(sim_files): $(SIM_FILE_REQS) | $(GEN_COLLATERAL_DIR) - cp -f $^ $(GEN_COLLATERAL_DIR) +$(sim_files): $(SIM_FILE_REQS) $(ALL_MODS_FILELIST) | $(GEN_COLLATERAL_DIR) + cp -f $(SIM_FILE_REQS) $(GEN_COLLATERAL_DIR) $(foreach file,\ - $^,\ + $(SIM_FILE_REQS),\ $(if $(filter %.h,$(file)),\ ,\ echo "$(addprefix $(GEN_COLLATERAL_DIR)/, $(notdir $(file)))" >> $@;)) diff --git a/sims/vcs/Makefile b/sims/vcs/Makefile index b26df843..b6f11a80 100644 --- a/sims/vcs/Makefile +++ b/sims/vcs/Makefile @@ -38,10 +38,10 @@ SIM_FILE_REQS += \ $(ROCKETCHIP_RSRCS_DIR)/vsrc/TestDriver.v # copy files but ignore *.h files in *.f since vcs has +incdir+$(build_dir) -$(sim_files): $(SIM_FILE_REQS) | $(GEN_COLLATERAL_DIR) - cp -f $^ $(GEN_COLLATERAL_DIR) +$(sim_files): $(SIM_FILE_REQS) $(ALL_MODS_FILELIST) | $(GEN_COLLATERAL_DIR) + cp -f $(SIM_FILE_REQS) $(GEN_COLLATERAL_DIR) $(foreach file,\ - $^,\ + $(SIM_FILE_REQS),\ $(if $(filter %.h,$(file)),\ ,\ echo "$(addprefix $(GEN_COLLATERAL_DIR)/, $(notdir $(file)))" >> $@;)) diff --git a/sims/verilator/Makefile b/sims/verilator/Makefile index fd171b4c..d48da28e 100644 --- a/sims/verilator/Makefile +++ b/sims/verilator/Makefile @@ -66,10 +66,10 @@ SIM_FILE_REQS += \ $(ROCKETCHIP_RSRCS_DIR)/csrc/remote_bitbang.cc # copy files and add -FI for *.h files in *.f -$(sim_files): $(SIM_FILE_REQS) | $(GEN_COLLATERAL_DIR) - cp -f $^ $(GEN_COLLATERAL_DIR) +$(sim_files): $(SIM_FILE_REQS) $(ALL_MODS_FILELIST) | $(GEN_COLLATERAL_DIR) + cp -f $(SIM_FILE_REQS) $(GEN_COLLATERAL_DIR) $(foreach file,\ - $^,\ + $(SIM_FILE_REQS),\ $(if $(filter %.h,$(file)),\ echo "-FI $(addprefix $(GEN_COLLATERAL_DIR)/, $(notdir $(file)))" >> $@;,\ echo "$(addprefix $(GEN_COLLATERAL_DIR)/, $(notdir $(file)))" >> $@;)) diff --git a/variables.mk b/variables.mk index f10cbfa9..1312cbe3 100644 --- a/variables.mk +++ b/variables.mk @@ -202,7 +202,8 @@ sim_common_files ?= $(build_dir)/sim_files.common.f # java arguments used in sbt ######################################################################################### JAVA_HEAP_SIZE ?= 8G -export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Djava.io.tmpdir=$(base_dir)/.java_tmp +JAVA_TMP_DIR ?= $(base_dir)/.java_tmp +export JAVA_TOOL_OPTIONS ?= -Xmx$(JAVA_HEAP_SIZE) -Xss8M -Djava.io.tmpdir=$(JAVA_TMP_DIR) ######################################################################################### # default sbt launch command diff --git a/vlsi/Makefile b/vlsi/Makefile index a1f850a1..ab8438d5 100644 --- a/vlsi/Makefile +++ b/vlsi/Makefile @@ -134,10 +134,10 @@ SIM_FILE_REQS += \ $(ROCKETCHIP_RSRCS_DIR)/vsrc/TestDriver.v # copy files but ignore *.h files in *.f since vcs has +incdir+$(build_dir) -$(sim_files): $(SIM_FILE_REQS) | $(build_dir) - cp -f $^ $(build_dir) +$(sim_files): $(SIM_FILE_REQS) $(ALL_MODS_FILELIST) | $(build_dir) + cp -f $(SIM_FILE_REQS) $(build_dir) $(foreach file,\ - $^,\ + $(SIM_FILE_REQS),\ $(if $(filter %.h,$(file)),\ ,\ echo "$(addprefix $(build_dir)/, $(notdir $(file)))" >> $@;))