summaryrefslogtreecommitdiff
path: root/pkgs/simple-scalar/simplesim.nix
blob: 3b73267eead8ce85d64f55c7321c4f057076834a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ fetchFromGitHub, stdenv, isWattch ? false }:
stdenv.mkDerivation {
  pname = if isWattch then "wattchg7" else "SimpleSim";
  version = if isWattch then "master-2014-03-20" else "2003-10-08"; # !!!

  src =
    if isWattch
    then
      fetchFromGitHub
        {
          repo = "wattchg7";
          owner = "n-sreek";

          rev = "b1c2c1447584b7e850c6dc0743a2209c9d021a39";
          sha256 = "sha256-JMM2+6dgReSP3MKSC0ZOYt0Pcmef8DRzIkC26e4dk+Y=";
        } else
      fetchTarball {
        name = "simplesim-3.0";

        url = "https://www.cse.iitd.ac.in/~cs5070217/csl718/simplesim-3v0d.tgz";
        sha256 = "sha256:022rlniimzl30c1874765hl001dxc716vfwm40ij256h1qk2dwgw";
      };

  configurePhase = ''
    make config-pisa
  '';

  installPhase = ''
    mkdir -p $out/bin
  '' + (if isWattch then ''
    cp sim-outorder $out/bin/wattch-outorder
  '' else ''
    cp {sim-{outorder,cache,profile,bpred,eio,safe,fast},sysprobe} $out/bin/
  '');
}