diff --git a/nix/t1/run/default.nix b/nix/t1/run/default.nix index 9c0ee5d51..7ab75253b 100644 --- a/nix/t1/run/default.nix +++ b/nix/t1/run/default.nix @@ -6,6 +6,7 @@ , vcs-emu , vcs-emu-rtlink , vcs-emu-cover +, vcs-emu-cover-full , vcs-emu-trace , vcs-dpi-lib , cases @@ -40,6 +41,7 @@ let verilator-emu-trace = runVerilatorEmu verilator-emu-trace case; vcs-emu = runVCSEmu vcs-emu-rtlink case; vcs-emu-cover = runVCSEmu vcs-emu-cover case; + vcs-emu-cover-full = runVCSEmu vcs-emu-cover-full case; vcs-emu-trace = runVCSEmu vcs-emu-trace case; vcs-prof-vcd = runFsdb2vcd (runVCSEmu vcs-emu-trace case); }; @@ -92,7 +94,7 @@ let in runCommand "catch-${configName}-all-emu-result-for-ci" { } script; - _vcsEmuResult = runCommand "get-vcs-emu-result" { __noChroot = true; emuOutput = _getAllResult "vcs-emu-cover"; } '' + _vcsEmuResult = runCommand "get-vcs-emu-result" { __noChroot = true; emuOutput = _getAllResult "vcs-emu-cover-full"; } '' cp -vr $emuOutput $out chmod -R u+w $out diff --git a/script/ci/src/Main.scala b/script/ci/src/Main.scala index e998fa9b5..c03c24a4e 100644 --- a/script/ci/src/Main.scala +++ b/script/ci/src/Main.scala @@ -165,7 +165,7 @@ object Main: val testAttr = emuLib.toLowerCase() match case "verilator" => s".#t1.$config.$top.run.$caseName.verilator-emu" // TODO: should not be cover for every test case - case "vcs" => s".#t1.$config.$top.run.$caseName.vcs-emu-cover" + case "vcs" => s".#t1.$config.$top.run.$caseName.vcs-emu-cover-full" case _ => Logger.fatal(s"Invalid test type ${emuLib}") val testResultPath = try @@ -280,23 +280,38 @@ object Main: Logger.info("Filtering urg report") val finalMdPath = os.Path(urgReportFilePath.get, os.pwd) val urgAssertFile = emuResultPath / "urgReport" / "asserts.txt" - val summaryHeading = "^Summary for Cover Properties$".r + val urgSummaryFile = emuResultPath / "urgReport" / "tests.txt" + + val summaryHeading = "^Total Coverage Summary$".r + val summaryStr = + os.read(urgSummaryFile) + .lines() + .dropWhile(!summaryHeading.matches(_)) + .takeWhile(!_.trim.isEmpty) + .toArray + .mkString("\n") + + val coverSummaryHeading = "^Summary for Cover Properties$".r val coverSummaryStr = os.read(urgAssertFile) .lines() - .dropWhile(!summaryHeading.matches(_)) + .dropWhile(!coverSummaryHeading.matches(_)) .takeWhile(_.distinct != "-") .toArray .mkString("\n") - val detailHeading = "^Detail Report for Cover Properties$".r + + val copverDetailHeading = "^Detail Report for Cover Properties$".r val coverDetailStr = os.read(urgAssertFile) .lines() - .dropWhile(!detailHeading.matches(_)) + .dropWhile(!copverDetailHeading.matches(_)) .toArray .mkString("\n") + os.write.append(finalMdPath, s"### Coverage for $config \n") os.write.append(finalMdPath, "```text\n") + os.write.append(finalMdPath, summaryStr) + os.write.append(finalMdPath, "----------------------\n") os.write.append(finalMdPath, coverSummaryStr) os.write.append(finalMdPath, "----------------------\n") os.write.append(finalMdPath, coverDetailStr)