Skip to content

Commit

Permalink
sail-riscv-*: init at 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
GenericNerdyUsername committed Feb 3, 2023
1 parent 3220cc5 commit 42452b1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
54 changes: 54 additions & 0 deletions pkgs/applications/virtualization/sail-riscv/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{ stdenv
, fetchFromGitHub
, lib
, arch
, ocamlPackages
, ocaml
, zlib
, z3
}:


stdenv.mkDerivation rec {
pname = "sail-riscv";
version = "0.5";

src = fetchFromGitHub {
owner = "riscv";
repo = pname;
rev = version;
hash = "sha256-7PZNNUMaCZEBf0lOCqkquewRgZPooBOjIbGF7JlLnEo=";
};

nativeBuildInputs = with ocamlPackages; [ ocamlbuild findlib ocaml z3 ];
buildInputs = with ocamlPackages; [ sail zlib ];

prePatch = ''
rm -r prover_snapshots
'';

makeFlags = [
"SAIL=sail"
"ARCH=${arch}"
"SAIL_DIR=${ocamlPackages.sail}/share/sail"
];

installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp c_emulator/riscv_sim_${arch} $out/bin
mkdir $out/share/
cp -r generated_definitions/{coq,hol4,isabelle} $out/share/
runHook postInstall
'';


meta = with lib; {
homepage = "https://github.com/riscv/sail-riscv";
description = "A formal specification of the RISC-V architecture, written in Sail";
maintainers = with maintainers; [ genericnerdyusername ];
license = licenses.bsd2;
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38064,6 +38064,14 @@ with pkgs;

sailsd = callPackage ../misc/sailsd { };

sail-riscv-rv32 = callPackage ../applications/virtualization/sail-riscv {
arch = "RV32";
};

sail-riscv-rv64 = callPackage ../applications/virtualization/sail-riscv {
arch = "RV64";
};

shc = callPackage ../tools/security/shc { };

shellz = callPackage ../tools/security/shellz { };
Expand Down

0 comments on commit 42452b1

Please sign in to comment.