2020-04-24 23:36:52 +00:00
|
|
|
import ./make-test-python.nix ({ pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2021-01-15 22:18:51 +00:00
|
|
|
riscvPkgs = import ../.. { crossSystem = pkgs.lib.systems.examples.riscv64-embedded; };
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
name = "spike";
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with pkgs.lib.maintainers; { maintainers = [ blitz ]; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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)")
|
2021-03-15 08:37:03 +00:00
|
|
|
assert "Hello, world!" in output
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|