diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index d52c3bcab..229ae9699 100644 --- a/script/ci/src/Main.scala +++ b/script/ci/src/Main.scala @@ -162,9 +162,8 @@ object Main: val testAttr = testType.toLowerCase() match case "verilator" => - s".#t1.$config.ip.cases.$caseName.emu-result.verilator-check" - case "vcs" => s".#t1.$config.ip.cases.$caseName.emu-result.vcs-check" - case "t1rocket" => s".#t1.t1rocketemu.cases.$caseName.emu-result.t1rocket-check" + s".#t1.$config.ip.verilator-emu.cases.$caseName.emu-result" + case "vcs" => s".#t1.$config.ip.vcs-emu.cases.$caseName.emu-result" case _ => Logger.fatal(s"Invalid test type ${testType}") val testResultPath = try @@ -187,7 +186,7 @@ object Main: os.read(testResultPath / "offline-check-status").trim() == "0" if !testSuccess then Logger.error(s"Offline check FAILED for $caseName ($config)") - allFailedTest :+ s"t1.$config.ip.cases.$caseName" + allFailedTest :+ testAttr else Logger.info(s"Offline check PASS for $caseName ($config)") allFailedTest @@ -269,8 +268,8 @@ object Main: Logger.info("Fetching CI results") val resultAttr = emuType.toLowerCase() match case "verilator" => - s".#t1.$config.ip.cases._allEmuResult" - case "vcs" => s".#t1.$config.ip.cases._allVCSEmuResult" + s".#t1.$config.verilator-emu.ip.verilator-emu.cases._allEmuResult" + case "vcs" => s".#t1.$config.vcs-emu.ip.cases.vcs-emu._allVCSEmuResult" case _ => Logger.fatal(s"Invalid test type ${emuType}") val emuResultPath = os.Path(nixResolvePath( resultAttr, @@ -360,7 +359,7 @@ object Main: import scala.util.chaining._ val testPlans: Seq[String] = emulatorConfigs.flatMap: configName => - val allCasesPath = nixResolvePath(s".#t1.$configName.ip.cases._all") + val allCasesPath = nixResolvePath(s".#t1.$configName.verilator-emu.ip.cases._all") os.walk(os.Path(allCasesPath) / "configs") .filter: path => path.ext == "json" diff --git a/t1rocketemu/nix/rtl.nix b/t1rocketemu/nix/rtl.nix index 93b41a309..35284df49 100644 --- a/t1rocketemu/nix/rtl.nix +++ b/t1rocketemu/nix/rtl.nix @@ -22,5 +22,8 @@ stdenvNoCC.mkDerivation { mkdir -p $out firtool ${mlirbc} ${mfcArgs} -o $out + echo "Fixing generated filelist.f" + cp $out/filelist.f original.f + cat $out/firrtl_black_box_resource_files.f original.f > $out/filelist.f ''; } diff --git a/t1rocketemu/nix/vcs.nix b/t1rocketemu/nix/vcs.nix index d44360983..48758bd4f 100644 --- a/t1rocketemu/nix/vcs.nix +++ b/t1rocketemu/nix/vcs.nix @@ -2,6 +2,7 @@ , bash , stdenv , rtl +, rtlDesignMetadata , callPackage , vcs-dpi-lib , vcs-fhs-env @@ -40,7 +41,7 @@ let passthru = { inherit (vcs-dpi-lib) enable-trace; - inherit vcs-fhs-env; + inherit vcs-fhs-env rtlDesignMetadata; cases = callPackage ../../tests { configName = "t1rocket"; diff --git a/t1rocketemu/nix/verilated-c-lib.nix b/t1rocketemu/nix/verilated-c-lib.nix index 63bd7d8ec..8f6394e17 100644 --- a/t1rocketemu/nix/verilated-c-lib.nix +++ b/t1rocketemu/nix/verilated-c-lib.nix @@ -1,5 +1,4 @@ { lib -, fetchgit , stdenv , rtl , verilator @@ -7,17 +6,6 @@ , zlib }: -let - rocket-chip-v-src = fetchgit { - url = "https://github.com/chipsalliance/rocket-chip.git"; - rev = "833385404d9c722bdfad3e453c19a3ac6f40dbf0"; - fetchSubmodules = false; - sparseCheckout = [ - "src/main/resources/vsrc" - ]; - hash = "sha256-CUq9VDwb7ZtclosgOWfDZMOpH+U/yBjL5CNiXZRiB80="; - }; -in stdenv.mkDerivation { name = "t1rocket-verilated"; @@ -27,22 +15,17 @@ stdenv.mkDerivation { propagatedBuildInputs = [ zlib ]; - env.rocketChipVSrc = "${rocket-chip-v-src}/src/main/resources/vsrc/"; - buildPhase = '' runHook preBuild echo "[nix] running verilator" # FIXME: fix all the warning and remove -Wno- flag here verilator \ - -I"$rocketChipVSrc" \ ${lib.optionalString enable-trace "--trace-fst"} \ --timing \ --threads 8 \ --threads-max-mtasks 8000 \ -O1 \ - -Wno-WIDTHEXPAND \ - -Wno-LATCH \ --cc TestBench echo "[nix] building verilated C lib" @@ -63,7 +46,7 @@ stdenv.mkDerivation { hardeningDisable = [ "fortify" ]; passthru = { - inherit enable-trace rocket-chip-v-src; + inherit enable-trace; }; installPhase = ''