diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index 0fa2f6f557..e9c230fe29 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 @@ -238,8 +237,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, @@ -329,7 +328,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/default.nix b/t1rocketemu/default.nix index f74cf6046a..32d1cca458 100644 --- a/t1rocketemu/default.nix +++ b/t1rocketemu/default.nix @@ -41,7 +41,7 @@ # # Although the string is already hard-coded in lower case, the toLower function call here is to remind developer that, # when we switch OM, we should always ensure the march input is lower case. - march = lib.toLower "rv32imafcv_zve32x_zvl1024b"; + march = lib.toLower "rv32imafcv_zve32f_zvl1024b"; dlen = scope.designConfig.dLen; xlen = if (lib.hasPrefix "rv32" march) then 32 else 64; diff --git a/t1rocketemu/nix/rtl.nix b/t1rocketemu/nix/rtl.nix index 93b41a309e..35284df494 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 d44360983f..48758bd4fa 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 63bd7d8ec6..8f6394e172 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 = ''