2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, pkg-config
|
|
|
|
, libuuid
|
2022-11-27 09:42:12 +00:00
|
|
|
, openjdk
|
2022-11-04 12:27:35 +00:00
|
|
|
, gperftools
|
2023-04-29 16:46:19 +00:00
|
|
|
, gtest
|
|
|
|
, uhdm
|
|
|
|
, antlr4
|
|
|
|
, capnproto
|
2023-10-19 13:55:26 +00:00
|
|
|
, nlohmann_json
|
2022-11-04 12:27:35 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-11-04 12:27:35 +00:00
|
|
|
pname = "surelog";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.83";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chipsalliance";
|
2024-07-27 06:49:29 +00:00
|
|
|
repo = "surelog";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-V4LmW4ca6KfugOu0XnGwutRqWR/9K6ESokHOB2yAVag=";
|
2023-10-09 19:29:22 +00:00
|
|
|
fetchSubmodules = false; # we use all dependencies from nix
|
2022-11-04 12:27:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
2022-11-27 09:42:12 +00:00
|
|
|
openjdk
|
2022-11-04 12:27:35 +00:00
|
|
|
(python3.withPackages (p: with p; [
|
|
|
|
psutil
|
|
|
|
orderedmultidict
|
|
|
|
]))
|
2023-04-29 16:46:19 +00:00
|
|
|
gtest
|
|
|
|
antlr4
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid
|
|
|
|
gperftools
|
2023-04-29 16:46:19 +00:00
|
|
|
uhdm
|
|
|
|
capnproto
|
|
|
|
antlr4.runtime.cpp
|
2023-10-19 13:55:26 +00:00
|
|
|
nlohmann_json
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2023-10-09 19:29:22 +00:00
|
|
|
"-DSURELOG_USE_HOST_CAPNP=On"
|
2023-04-29 16:46:19 +00:00
|
|
|
"-DSURELOG_USE_HOST_UHDM=On"
|
|
|
|
"-DSURELOG_USE_HOST_GTEST=On"
|
|
|
|
"-DSURELOG_USE_HOST_ANTLR=On"
|
2023-10-19 13:55:26 +00:00
|
|
|
"-DSURELOG_USE_HOST_JSON=On"
|
2023-04-29 16:46:19 +00:00
|
|
|
"-DANTLR_JAR_LOCATION=${antlr4.jarLocation}"
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
make -j $NIX_BUILD_CORES UnitTests
|
|
|
|
ctest --output-on-failure
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SystemVerilog 2017 Pre-processor, Parser, Elaborator, UHDM Compiler";
|
|
|
|
homepage = "https://github.com/chipsalliance/Surelog";
|
|
|
|
license = lib.licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "surelog";
|
2022-11-04 12:27:35 +00:00
|
|
|
maintainers = with lib.maintainers; [ matthuszagh ];
|
2023-04-29 16:46:19 +00:00
|
|
|
platforms = lib.platforms.all;
|
2022-11-04 12:27:35 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|