Skip to content

Commit

Permalink
[nix] add coverpoint file in coverage flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Dec 22, 2024
1 parent 50f0031 commit 6267f42
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nix/t1/conversion/sv-to-vcs-simulator.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ stdenv.mkDerivation rec {
"assert"
"-cm_dir"
"./cm"
"-assert"
"enable_hier"
]
++ lib.optionals (!enableCover) [
"-assert"
Expand Down
2 changes: 2 additions & 0 deletions nix/t1/run/run-vcs-emu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ stdenvNoCC.mkDerivation (rec {
++ lib.optionals emulator.enableCover [
"-cm"
"assert"
"-assert"
"hier=${testCase}/${testCase.pname}.cover"
]
++ lib.optionals emulator.enableTrace [
"+t1_wave_path=${testCase.pname}.fsdb"
Expand Down
2 changes: 1 addition & 1 deletion t1/src/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ class T1(val parameter: T1Parameter)
val coverMatch = BoolSequence(
requestReg.valid && requestReg.bits.issue.instruction === BitPat("b" + instruction.encoding.toString)
)
CoverProperty(coverMatch, label = Some(s"1_${instruction.name}"))
CoverProperty(coverMatch, label = Some(s"${instruction.name}"))
}

// // coverage for two instructions
Expand Down
2 changes: 1 addition & 1 deletion tests/builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ let
mkdir -p $out/bin
cp ${pname}.elf $out/bin
cp ${pname}.cover $out
${jqBin} --null-input \
--arg name ${pname} \
--arg type ${casePrefix} \
--arg elfPath "$out/bin/${pname}.elf" \
'{ "name": $name, "elf": { "path": $elfPath } }' \
> $out/${pname}.json
Expand Down
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ let
mkdir -p $out/cases/${caseDrv.pname}
cp ${caseDrv}/bin/${caseDrv.pname}.elf $out/cases/${caseDrv.pname}/
cp ${caseDrv}/${caseDrv.pname}.json $out/configs/
cp ${caseDrv}/${caseDrv.pname}.cover $out/configs/
'')
allCases);
in
Expand Down

0 comments on commit 6267f42

Please sign in to comment.