Add qemu support for Lagarto Ox

The network is still not working automatically, but the eth0 device is
present in the host.

Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
This commit is contained in:
2024-10-14 14:26:59 +02:00
committed by Rodrigo Arias Mallo
parent ccf41b441d
commit 8da3468ee2
4 changed files with 71 additions and 22 deletions

View File

@@ -18,6 +18,7 @@
system = "${system}";
modules = [
./configuration.nix
./lagarto-ox.nix
./vm.nix
];
};
@@ -54,6 +55,18 @@
./no-compressed.nix
];
};
# QEMU configuration (x86 host) for a FPGA Lagarto Ox CPU virtual machine
qemu-lagarto-ox = nixosSystem {
specialArgs = { inherit self; };
system = "${system}";
modules = [
./configuration.nix
./lagarto-ox.nix
./no-compressed.nix
./vm.nix
];
};
};
# A development shell with QEMU ready to boot the RISC-V system in an x86
@@ -131,6 +144,39 @@
'';
};
devShells.x86_64-linux.qemu-lagarto-ox =
let
nixosconf = self.nixosConfigurations.qemu-lagarto-ox;
syspkgs = nixosconf.pkgs;
build = nixosconf.config.system.build;
in syspkgs.mkShell rec {
pname = "lagarto-ox-shell";
nativeBuildInputs = with syspkgs; [ qemu_full ];
COMMIT = if self ? rev then self.rev else "dirty";
TOPLEVEL = build.toplevel;
OPENSBI = syspkgs.opensbi;
KERNEL = build.kernel;
INITRD = build.initialRamdisk;
UBOOT_ENV = syspkgs.uboot-env;
BITSTREAM = syspkgs.bitstream;
BOOTROM = syspkgs.bootrom;
GCROOT = mkRoots syspkgs [
syspkgs.stdenv KERNEL OPENSBI syspkgs.riscv-tools
];
shellHook = ''
echo "Here are the current system pieces:"
echo " COMMIT = $COMMIT"
echo " TOPLEVEL = $TOPLEVEL"
echo " KERNEL = $KERNEL"
echo " OPENSBI = $OPENSBI"
echo " INITRD = $INITRD"
echo " UBOOT_ENV = $UBOOT_ENV"
echo " BITSTREAM = $BITSTREAM"
echo " BOOTROM = $BOOTROM"
echo " GCROOT = $GCROOT"
'';
};
devShells.x86_64-linux.lagarto-ox-rd =
let
nixosconf = self.nixosConfigurations.lagarto-ox;