From 7f14b8653f6ced5ba377e16f65a4e0001efbca68 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:39:29 +0000 Subject: [PATCH 1/5] [deps] Bump dependencies --- .../chisel/nix/pkgs/dependencies/_sources/generated.json | 8 ++++---- .../chisel/nix/pkgs/dependencies/_sources/generated.nix | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/chisel/nix/pkgs/dependencies/_sources/generated.json b/templates/chisel/nix/pkgs/dependencies/_sources/generated.json index fa2ace9..879ca38 100644 --- a/templates/chisel/nix/pkgs/dependencies/_sources/generated.json +++ b/templates/chisel/nix/pkgs/dependencies/_sources/generated.json @@ -1,7 +1,7 @@ { "chisel": { "cargoLocks": null, - "date": "2024-10-12", + "date": "2024-10-15", "extract": null, "name": "chisel", "passthru": null, @@ -13,10 +13,10 @@ "name": null, "owner": "chipsalliance", "repo": "chisel", - "rev": "dd2f57ede872afc2e2b9c00dcdbcd397400bcdfd", - "sha256": "sha256-InQ6Xm9ssQRFyM7AsvxDdw8N2HdyhRCvl4ckXaNXcG0=", + "rev": "e20cb96a0c5f50f3a27e2a727a3fa094a3dcc13f", + "sha256": "sha256-5DRUvVWl9id85Htw1oDZYoOrSjI+wYxSEV51qZB/qs0=", "type": "github" }, - "version": "dd2f57ede872afc2e2b9c00dcdbcd397400bcdfd" + "version": "e20cb96a0c5f50f3a27e2a727a3fa094a3dcc13f" } } \ No newline at end of file diff --git a/templates/chisel/nix/pkgs/dependencies/_sources/generated.nix b/templates/chisel/nix/pkgs/dependencies/_sources/generated.nix index 1ff12ba..9251c09 100644 --- a/templates/chisel/nix/pkgs/dependencies/_sources/generated.nix +++ b/templates/chisel/nix/pkgs/dependencies/_sources/generated.nix @@ -3,14 +3,14 @@ { chisel = { pname = "chisel"; - version = "dd2f57ede872afc2e2b9c00dcdbcd397400bcdfd"; + version = "e20cb96a0c5f50f3a27e2a727a3fa094a3dcc13f"; src = fetchFromGitHub { owner = "chipsalliance"; repo = "chisel"; - rev = "dd2f57ede872afc2e2b9c00dcdbcd397400bcdfd"; + rev = "e20cb96a0c5f50f3a27e2a727a3fa094a3dcc13f"; fetchSubmodules = false; - sha256 = "sha256-InQ6Xm9ssQRFyM7AsvxDdw8N2HdyhRCvl4ckXaNXcG0="; + sha256 = "sha256-5DRUvVWl9id85Htw1oDZYoOrSjI+wYxSEV51qZB/qs0="; }; - date = "2024-10-12"; + date = "2024-10-15"; }; } From a4983733b787f3ad46dad326c2c1ea843df54b5e Mon Sep 17 00:00:00 2001 From: unlsycn Date: Tue, 15 Oct 2024 02:39:06 +0000 Subject: [PATCH 2/5] [build] eliminate compilation warnings Signed-off-by: unlsycn --- templates/chisel/common.sc | 9 ++++++++- templates/chisel/elaborator/src/GCD.scala | 2 +- templates/chisel/elaborator/src/GCDFormal.scala | 2 +- templates/chisel/elaborator/src/GCDTestBench.scala | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/templates/chisel/common.sc b/templates/chisel/common.sc index c970582..6575e3e 100644 --- a/templates/chisel/common.sc +++ b/templates/chisel/common.sc @@ -13,7 +13,14 @@ trait HasChisel extends ScalaModule { def chiselPluginJar: T[Option[PathRef]] override def scalacOptions = T( - super.scalacOptions() ++ chiselPluginJar().map(path => s"-Xplugin:${path.path}") ++ Seq("-Ymacro-annotations") + super.scalacOptions() ++ chiselPluginJar().map(path => s"-Xplugin:${path.path}") ++ Seq( + "-Ymacro-annotations", + "-deprecation", + "-feature", + "-language:reflectiveCalls", + "-language:existentials", + "-language:implicitConversions" + ) ) override def scalacPluginClasspath: T[Agg[PathRef]] = T(super.scalacPluginClasspath() ++ chiselPluginJar()) diff --git a/templates/chisel/elaborator/src/GCD.scala b/templates/chisel/elaborator/src/GCD.scala index 778b69a..8988d15 100644 --- a/templates/chisel/elaborator/src/GCD.scala +++ b/templates/chisel/elaborator/src/GCD.scala @@ -43,5 +43,5 @@ object GCDMain extends SerializableModuleElaborator { os.write.over(targetDir / s"${topName}.anno.json", annos) } - def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args) + def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) } diff --git a/templates/chisel/elaborator/src/GCDFormal.scala b/templates/chisel/elaborator/src/GCDFormal.scala index e417cac..0e404f9 100644 --- a/templates/chisel/elaborator/src/GCDFormal.scala +++ b/templates/chisel/elaborator/src/GCDFormal.scala @@ -44,5 +44,5 @@ object GCDFormalMain extends SerializableModuleElaborator { os.write.over(targetDir / s"${topName}.anno.json", annos) } - def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args) + def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) } diff --git a/templates/chisel/elaborator/src/GCDTestBench.scala b/templates/chisel/elaborator/src/GCDTestBench.scala index cf9a426..abd4540 100644 --- a/templates/chisel/elaborator/src/GCDTestBench.scala +++ b/templates/chisel/elaborator/src/GCDTestBench.scala @@ -70,5 +70,5 @@ object GCDTestBenchMain extends SerializableModuleElaborator { os.write.over(targetDir / s"${topName}.anno.json", annos) } - def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args) + def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args.toIndexedSeq) } From 0470f1202f0b43dbaa529502b105de52f39938a0 Mon Sep 17 00:00:00 2001 From: unlsycn Date: Tue, 15 Oct 2024 02:40:30 +0000 Subject: [PATCH 3/5] [nix] add envs required by mill to dev shell Signed-off-by: unlsycn --- templates/chisel/flake.nix | 2 +- templates/chisel/nix/gcd/gcd.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/chisel/flake.nix b/templates/chisel/flake.nix index db27558..7457674 100644 --- a/templates/chisel/flake.nix +++ b/templates/chisel/flake.nix @@ -29,6 +29,6 @@ nativeBuildInputs = [ pkgs.cargo pkgs.rustfmt pkgs.rust-analyzer ]; RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; - } // pkgs.gcd.tb-dpi-lib.env); + } // pkgs.gcd.tb-dpi-lib.env // pkgs.gcd.gcd-compiled.env); }); } diff --git a/templates/chisel/nix/gcd/gcd.nix b/templates/chisel/nix/gcd/gcd.nix index 9faad53..a3dc54f 100644 --- a/templates/chisel/nix/gcd/gcd.nix +++ b/templates/chisel/nix/gcd/gcd.nix @@ -56,6 +56,7 @@ let }); inherit target; + inherit env; }; shellHook = '' From 29bd971105d1b9e91e25be068c18c79d48aa351b Mon Sep 17 00:00:00 2001 From: unlsycn Date: Tue, 15 Oct 2024 02:40:47 +0000 Subject: [PATCH 4/5] [chore] update gitignore Signed-off-by: unlsycn --- templates/chisel/.gitignore | 2 ++ templates/chisel/.scalafmt.conf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/chisel/.gitignore b/templates/chisel/.gitignore index 338f9fc..6f30eab 100644 --- a/templates/chisel/.gitignore +++ b/templates/chisel/.gitignore @@ -4,6 +4,8 @@ .mill-jvm-opts .metals/ .vscode/ +.envrc +.direnv/ out/ result* diff --git a/templates/chisel/.scalafmt.conf b/templates/chisel/.scalafmt.conf index 0310aaa..2d9aedc 100644 --- a/templates/chisel/.scalafmt.conf +++ b/templates/chisel/.scalafmt.conf @@ -12,7 +12,7 @@ danglingParentheses.preset = true align.tokens."+" = [ { - code = ":" + code = ":" } ] From f33a407c936b2ffda9e91df1caa20dedf9639e55 Mon Sep 17 00:00:00 2001 From: unlsycn Date: Tue, 15 Oct 2024 03:01:57 +0000 Subject: [PATCH 5/5] [nix] run vcs wrapper in result dir Signed-off-by: unlsycn --- templates/chisel/nix/gcd/scripts/vcs-wrapper.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/chisel/nix/gcd/scripts/vcs-wrapper.sh b/templates/chisel/nix/gcd/scripts/vcs-wrapper.sh index 3173262..5496205 100755 --- a/templates/chisel/nix/gcd/scripts/vcs-wrapper.sh +++ b/templates/chisel/nix/gcd/scripts/vcs-wrapper.sh @@ -24,25 +24,25 @@ cp -r "$_VCS_SIM_DAIDIR" "$_CURRENT/" if [ -n "$_VCS_COV_DIR" ]; then cp -vr "$_LIB/$_VCS_COV_DIR" "$_CURRENT/" - _CM_ARG="-cm assert -cm_dir $_CURRENT/$_VCS_COV_DIR" + _CM_ARG="-cm assert -cm_dir ./$_VCS_COV_DIR" # vcs runs in $_CURRENT fi chmod -R +w "$_CURRENT" +pushd "$_CURRENT" >/dev/null _emu_name=$(basename "$_VCS_SIM_BIN") _daidir=$(basename "$_VCS_SIM_DAIDIR") -export LD_LIBRARY_PATH="$_CURRENT/$_daidir:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH="$PWD/$_daidir:$LD_LIBRARY_PATH" -"$_VCS_FHS_ENV" -c "$_CURRENT/$_emu_name $_CM_ARG $_EXTRA_ARGS" &> >(tee $_CURRENT/vcs-emu-journal.log) +"$_VCS_FHS_ENV" -c "./$_emu_name $_CM_ARG $_EXTRA_ARGS" &> >(tee $./vcs-emu-journal.log) if [ -n "$_VCS_COV_DIR" ]; then - "$_VCS_FHS_ENV" -c "urg -dir "$_CURRENT/$_VCS_COV_DIR" -format text" - cp -vr ./urgReport "$_CURRENT/" + "$_VCS_FHS_ENV" -c "urg -dir "./$_VCS_COV_DIR" -format text" fi if ((${DATA_ONLY:-0})); then - rm -f "$_CURRENT/$_emu_name" + rm -f "./$_emu_name" fi set -e _emu_name _daidir