WIP: Working spec cpu with clang epi

This commit is contained in:
Rodrigo Arias 2024-05-13 18:59:00 +02:00
parent c4676535ec
commit f69e04ccbe
3 changed files with 49 additions and 9 deletions

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, self, ... }:
{ {
imports = [ imports = [
@ -10,6 +10,10 @@
system = "riscv64-linux"; system = "riscv64-linux";
}; };
nixpkgs.overlays = [
self.inputs.bscpkgs.bscOverlay
];
networking.hostName = "nixos-riscv"; networking.hostName = "nixos-riscv";
system.stateVersion = "24.05"; system.stateVersion = "24.05";

View File

@ -1,6 +1,36 @@
{ {
"nodes": { "nodes": {
"bscpkgs": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"dirtyRev": "e605f7dfad67a6bf15c1f1ff83e0c8a1c9ee42b9-dirty",
"dirtyShortRev": "e605f7d-dirty",
"lastModified": 1715179381,
"narHash": "sha256-487pg/odvGPcEVpCBDS3gVmK/4o3Yv7S/uvI2HYECGM=",
"type": "git",
"url": "file:///home/Computational/rarias/bscpkgs"
},
"original": {
"type": "git",
"url": "file:///home/Computational/rarias/bscpkgs"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1700390070,
"narHash": "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0=",
"path": "/nix/store/z7y28qzhk7driiwcw78k0mb24laknm0f-source",
"rev": "e4ad989506ec7d71f7302cc3067abd82730a4beb",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1706092046, "lastModified": 1706092046,
"narHash": "sha256-Cbethl95Cu+WVIWfaAnRRBZiz5PmXxQvg4vXNqIZQUg=", "narHash": "sha256-Cbethl95Cu+WVIWfaAnRRBZiz5PmXxQvg4vXNqIZQUg=",
@ -18,7 +48,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "bscpkgs": "bscpkgs",
"nixpkgs": "nixpkgs_2"
} }
} }
}, },

View File

@ -1,17 +1,20 @@
{ {
inputs.nixpkgs.url = "github:rodarima/nixpkgs/fix-pkgs-static-gcc-march"; inputs.nixpkgs.url = "github:rodarima/nixpkgs/fix-pkgs-static-gcc-march";
#inputs.bscpkgs.url = "path:/home/Computational/rarias/bscpkgs";
inputs.bscpkgs.url = "/home/Computational/rarias/bscpkgs";
outputs = { self, nixpkgs, ... }: outputs = { self, nixpkgs, bscpkgs, ... }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
overlay = import ./overlay.nix; #overlay = import ./overlay.nix;
pkgs = import nixpkgs { inherit system; }; #pkgs = import nixpkgs { inherit system; };
in { in {
overlay = import ./overlay.nix; #overlay = import ./overlay.nix;
nixosConfigurations = { nixosConfigurations = {
# The qemu configuration defines a system that runs in the RISC-V # The qemu configuration defines a system that runs in the RISC-V
# architecture, but is build from an x86 host machine. # architecture, but is build from an x86 host machine.
qemu = nixpkgs.lib.nixosSystem { qemu = nixpkgs.lib.nixosSystem {
specialArgs = { inherit self; };
system = "${system}"; system = "${system}";
modules = [ modules = [
./configuration.nix ./configuration.nix
@ -21,6 +24,7 @@
# Same, but disable compressed instructions # Same, but disable compressed instructions
qemu-nc = nixpkgs.lib.nixosSystem { qemu-nc = nixpkgs.lib.nixosSystem {
specialArgs = { inherit self; };
system = "${system}"; system = "${system}";
modules = [ modules = [
./configuration.nix ./configuration.nix
@ -31,6 +35,7 @@
# FPGA Lagarto Hun CPU # FPGA Lagarto Hun CPU
lagarto-hun = nixpkgs.lib.nixosSystem { lagarto-hun = nixpkgs.lib.nixosSystem {
specialArgs = { inherit self; };
system = "${system}"; system = "${system}";
modules = [ modules = [
./configuration.nix ./configuration.nix
@ -47,9 +52,9 @@
nixosconf = self.nixosConfigurations.qemu-nc; nixosconf = self.nixosConfigurations.qemu-nc;
syspkgs = nixosconf.pkgs; syspkgs = nixosconf.pkgs;
toplevel = nixosconf.config.system.build.toplevel; toplevel = nixosconf.config.system.build.toplevel;
in pkgs.mkShell { in syspkgs.mkShell {
pname = "qemu-shell"; pname = "qemu-shell";
buildInputs = with pkgs; [ qemu e2fsprogs ]; buildInputs = with syspkgs; [ qemu e2fsprogs ];
# Here we tell the run script where to find the system # Here we tell the run script where to find the system
NIXOS_SYSTEM_TOPLEVEL = toplevel; NIXOS_SYSTEM_TOPLEVEL = toplevel;
OPENSBI = syspkgs.opensbi-uboot; OPENSBI = syspkgs.opensbi-uboot;
@ -59,7 +64,7 @@
nixosconf = self.nixosConfigurations.lagarto-hun; nixosconf = self.nixosConfigurations.lagarto-hun;
syspkgs = nixosconf.pkgs; syspkgs = nixosconf.pkgs;
build = nixosconf.config.system.build; build = nixosconf.config.system.build;
in pkgs.mkShell { in syspkgs.mkShell {
pname = "lagarto-hun-shell"; pname = "lagarto-hun-shell";
TOPLEVEL = build.toplevel; TOPLEVEL = build.toplevel;
OPENSBI = syspkgs.opensbi; OPENSBI = syspkgs.opensbi;