From 8d33bbdc662e6cb38d1418f8aeacd93efef9240d 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 | 18 ++++++++++++++---- nix/t1/run/run-vcs-emu.nix | 8 +++++--- script/emu/src/Main.scala | 2 +- 3 files changed, 20 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..4bd477d1b 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" @@ -39,6 +42,8 @@ stdenv.mkDerivation rec { "+define+T1_ENABLE_TRACE" "-debug_access+pp+dmptf+thread" "-kdb=common_elab,hgldd_all" + "-assert" + "disable" ] ++ vcsLinkLibs; @@ -69,16 +74,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 <