diff --git a/nix/t1/conversion/sv-to-vcs-simulator.nix b/nix/t1/conversion/sv-to-vcs-simulator.nix index 69f012679..e6c29a23c 100644 --- a/nix/t1/conversion/sv-to-vcs-simulator.nix +++ b/nix/t1/conversion/sv-to-vcs-simulator.nix @@ -8,6 +8,7 @@ { mainProgram , rtl , enableTrace ? false +, enableCover ? false , vcsLinkLibs ? [ ] }: @@ -36,6 +37,16 @@ stdenv.mkDerivation rec { "-debug_access+pp+dmptf+thread" "-kdb=common_elab,hgldd_all" ] + ++ lib.optionals (enableCover) [ + "-cm" + "line+cond+fsm+tgl+branch+assert" + "-cm_dir" + "./cm" + ] + ++ lib.optionals (!enableCover) [ + "-assert" + "disable_cover" + ] ++ vcsLinkLibs; buildPhase = '' @@ -65,13 +76,16 @@ stdenv.mkDerivation rec { mkdir -p $out/bin $out/lib cp $mainProgram $out/lib cp -r $mainProgram.daidir $out/lib + cp -r ./cm.vdb $out/lib # We need to carefully handle string escape here, so don't use makeWrapper tee $out/bin/$mainProgram < + val issueMatch = Sequence.BoolSequence(issue.instruction === BitPat("b" + instruction.encoding.toString)) + CoverProperty(issueMatch, label = Some(s"t1_cover_issue_${instruction.name}")) + } }