Commit d9d2749c authored by Qiming Chu's avatar Qiming Chu Committed by Austin Seipp
Browse files

verilator: 5.028 -> 5.034



Signed-off-by: default avatarQiming Chu <cchuqiming@gmail.com>
parent a7beac60
Loading
Loading
Loading
Loading
+36 −19
Original line number Diff line number Diff line
@@ -14,11 +14,12 @@
  git,
  numactl,
  coreutils,
  gdb,
}:

stdenv.mkDerivation rec {
  pname = "verilator";
  version = "5.028";
  version = "5.034";

  # Verilator gets the version from this environment variable
  # if it can't do git describe while building.
@@ -28,7 +29,7 @@ stdenv.mkDerivation rec {
    owner = "verilator";
    repo = "verilator";
    rev = "v${version}";
    hash = "sha256-YgK60fAYG5575uiWmbCODqNZMbRfFdOVcJXz5h5TLuE=";
    hash = "sha256-1o9Qf6avdiRgIYUgBS/S0W2GLSi/HdO9Xgs78oW6VJE=";
  };

  enableParallelBuilding = true;
@@ -38,36 +39,52 @@ stdenv.mkDerivation rec {
    systemc
    # ccache
  ];
  nativeBuildInputs = [
  nativeBuildInputs =
    [
      makeWrapper
      flex
      bison
      autoconf
      help2man
      git
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      gdb
    ];
  nativeCheckInputs = [

  nativeCheckInputs =
    [
      which
    numactl
      coreutils
      # cmake
      python3
    ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      numactl
    ];

  doCheck = stdenv.hostPlatform.isLinux; # darwin tests are broken for now...
  doCheck = true;
  checkTarget = "test";

  preConfigure = "autoconf";

  postPatch = ''
    patchShebangs bin/* src/* nodist/* docs/bin/* examples/xml_py/* \
    test_regress/{driver.pl,t/*.{pl,pf}} \
    test_regress/{driver.py,t/*.{pl,pf}} \
    test_regress/t/t_a1_first_cc.py \
    test_regress/t/t_a2_first_sc.py \
    ci/* ci/docker/run/* ci/docker/run/hooks/* ci/docker/buildenv/build.sh
    # verilator --gdbbt uses /bin/echo to test if gdb works.
    sed -i 's|/bin/echo|${coreutils}\/bin\/echo|' bin/verilator
    substituteInPlace bin/verilator --replace-fail "/bin/echo" "${coreutils}/bin/echo"
  '';
  # grep '^#!/' -R . | grep -v /nix/store | less
  # (in nix-shell after patchPhase)

  # This is needed to ensure that the check phase can find the verilator_bin_dbg.
  preCheck = ''
    export PATH=$PWD/bin:$PATH
  '';

  env = {
    SYSTEMC_INCLUDE = "${lib.getDev systemc}/include";
    SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib";