From ee14e966cc1880f6316422e030fd610e7689a8e9 Mon Sep 17 00:00:00 2001 From: Clo91eaf Date: Sat, 5 Oct 2024 20:39:34 +0800 Subject: [PATCH] [nix] make trace and cover orthogonal --- nix/t1/conversion/sv-to-vcs-simulator.nix | 16 ++++++++++++---- nix/t1/run/run-vcs-emu.nix | 9 ++++++--- script/emu/src/Main.scala | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nix/t1/conversion/sv-to-vcs-simulator.nix b/nix/t1/conversion/sv-to-vcs-simulator.nix index 7d9b700d1..90a1e2989 100644 --- a/nix/t1/conversion/sv-to-vcs-simulator.nix +++ b/nix/t1/conversion/sv-to-vcs-simulator.nix @@ -21,6 +21,7 @@ stdenv.mkDerivation rec { # require license __noChroot = true; dontPatchELF = true; + enableCover = !enableTrace; src = rtl; @@ -30,6 +31,8 @@ stdenv.mkDerivation rec { "-timescale=1ns/1ps" "-file" "filelist.f" + ] + ++ lib.optionals (enableCover) [ "-cm" "line+cond+fsm+tgl+branch+assert" "-cm_dir" @@ -69,16 +72,21 @@ 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 + ${lib.optionalString enableCover '' + cp -r ./cm.vdb $out/lib + ''} # We need to carefully handle string escape here, so don't use makeWrapper tee $out/bin/$mainProgram <