Skip to content

Commit

Permalink
[nix] add vcs-prof-vcd derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
FanShupei committed Oct 30, 2024
1 parent 0581cbb commit ed25d58
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nix/t1/run/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
let
runVerilatorEmu = callPackage ./run-verilator-emu.nix { };
runVCSEmu = callPackage ./run-vcs-emu.nix { };
runFsdb2vcd = callPackage ./run-fsdb2vcd.nix { };

# cases is now { mlir = { hello = ...; ... }; ... }
emuAttrs = lib.pipe cases [
Expand All @@ -32,6 +33,7 @@ let
verilator-emu-trace = runVerilatorEmu verilator-emu-trace case;
vcs-emu = runVCSEmu vcs-emu case;
vcs-emu-trace = runVCSEmu vcs-emu-trace case;
vcs-prof-vcd = runFsdb2vcd (runVCSEmu vcs-emu-trace case);
};
in
# Now we have { caseName = "hello", case = <derivation> }
Expand Down
22 changes: 22 additions & 0 deletions nix/t1/run/run-fsdb2vcd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, stdenvNoCC, vcs-fhs-env }:
vcs-emu-trace:

let
caseName = vcs-emu-trace.caseName;
in
stdenvNoCC.mkDerivation (finalAttr: {
name = "${caseName}-vcs-prof-vcd";

__noChroot = true;

dontUnpack = true;

buildCommand = ''
mkdir -p "$out"
fhsEnv="${vcs-fhs-env}/bin/vcs-fhs-env"
"$fhsEnv" -c "fsdb2vcd ${vcs-emu-trace}/*.fsdb -o ${caseName}.prof.vcd -s /TestBench/verification/profData"
cp -t "$out" "${caseName}.prof.vcd"
'';
})

0 comments on commit ed25d58

Please sign in to comment.