3
0
Fork 0
forked from mirrors/nixpkgs

spike: init at 1.0.0

Spike is the RISC-V ISA simulator from the RISC-V project.
This commit is contained in:
Julian Stecklina 2019-11-10 23:23:37 +01:00
parent 312b238674
commit e750461511
3 changed files with 54 additions and 0 deletions

22
nixos/tests/spike.nix Normal file
View file

@ -0,0 +1,22 @@
import ./make-test-python.nix ({ pkgs, ... }:
let
riscvPkgs = import ../.. { crossSystem = pkgs.stdenv.lib.systems.examples.riscv64-embedded; };
in
{
name = "spike";
meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ blitz ]; };
machine = { pkgs, lib, ... }: {
environment.systemPackages = [ pkgs.spike riscvPkgs.riscv-pk riscvPkgs.hello ];
};
# Run the RISC-V hello applications using the proxy kernel on the
# Spike emulator and see whether we get the expected output.
testScript =
''
machine.wait_for_unit("multi-user.target")
output = machine.succeed("spike -m64 $(which pk) $(which hello)")
assert output == "Hello, world!\n"
'';
})

View file

@ -0,0 +1,30 @@
{ stdenv, fetchgit, dtc }:
stdenv.mkDerivation rec {
pname = "spike";
version = "1.0.0";
src = fetchgit {
url = "https://github.com/riscv/riscv-isa-sim.git";
rev = "v${version}";
sha256 = "1hcl01nj96s3rkz4mrq747s5lkw81lgdjdimb8b1b9h8qnida7ww";
};
nativeBuildInputs = [ dtc ];
enableParallelBuilding = true;
patchPhase = ''
patchShebangs scripts/*.sh
patchShebangs tests/ebreak.py
'';
doCheck = true;
meta = with stdenv.lib; {
description = "A RISC-V ISA Simulator";
homepage = "https://github.com/riscv/riscv-isa-sim";
license = licenses.bsd3;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = with maintainers; [ blitz ];
};
}

View file

@ -20942,6 +20942,8 @@ in
spice-vdagent = callPackage ../applications/virtualization/spice-vdagent { };
spike = callPackage ../applications/virtualization/spike { };
spideroak = callPackage ../applications/networking/spideroak { };
split2flac = callPackage ../applications/audio/split2flac { };