Skip to content

Commit b947dd4

Browse files
committed
sv-bugpoint: added sv-bugpoint package
1 parent 7ed8b4b commit b947dd4

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

pkgs/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
uf2conv = pkgs.callPackage ./uf2conv.nix {};
3131

3232
inherit (pkgs.callPackage ./sv-lang.nix {}) sv-lang_6 sv-lang_7;
33+
sv-bugpoint = pkgs.callPackage ./sv-bugpoint.nix {sv-lang = sv-lang_7;};
3334
veridian = pkgs.callPackage ./veridian/default.nix {inherit sv-lang_6;};
3435
peakrdl = pkgs.callPackage ./peakrdl.nix {};
3536

pkgs/sv-bugpoint.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-FileCopyrightText: lowRISC contributors
2+
# SPDX-License-Identifier: MIT
3+
{
4+
lib,
5+
stdenv,
6+
fetchFromGitHub,
7+
cmake,
8+
ninja,
9+
sv-lang,
10+
fmt_10,
11+
python3,
12+
}: let
13+
rev = "1e078fa961ac5ade9e2506ce63c091b53ad9dbdb";
14+
in
15+
stdenv.mkDerivation {
16+
pname = "sv-bugpoint";
17+
# take the first 10 characters of the revision
18+
version = builtins.head (builtins.match "(.{10}).*" rev);
19+
20+
src = fetchFromGitHub {
21+
owner = "antmicro";
22+
repo = "sv-bugpoint";
23+
inherit rev;
24+
hash = "sha256-HGWPtadi+L+cXHSWSPelOv0KOPnkjVGKchRaYfZwwFg=";
25+
};
26+
27+
cmakeFlags = [
28+
"-DFETCHCONTENT_SOURCE_DIR_SLANG=${sv-lang.src.outPath}"
29+
"-DFETCHCONTENT_SOURCE_DIR_FMT=${fmt_10.src.outPath}"
30+
"-DSLANG_USE_MIMALLOC=OFF"
31+
];
32+
33+
nativeBuildInputs = [
34+
cmake
35+
ninja
36+
python3
37+
sv-lang
38+
];
39+
40+
meta = with lib; {
41+
description = "Minimizes SystemVerilog code while preserving a user-defined property of that code.";
42+
homepage = "https://github.com/antmicro/sv-bugpoint";
43+
license = licenses.asl20;
44+
maintainers = [];
45+
mainProgram = "sv-bugpoint";
46+
platforms = platforms.all;
47+
};
48+
}

0 commit comments

Comments
 (0)