-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a new method to decode instructions (#2)
* Add zig to nix flake * Add direnv * Update imgfile * Use a new method to decode instructions * Remove zig 0.12.0 from ci
- Loading branch information
Showing
11 changed files
with
244 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.direnv | ||
# zig build output | ||
zig-out/ | ||
zig-cache/ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
{ | ||
description = "MEMU"; | ||
description = "MEMU"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
zig-overlay.url = "github:mitchellh/zig-overlay"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils }@inputs: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = import nixpkgs { inherit system;}; | ||
deps = with pkgs; [ | ||
git | ||
gnumake autoconf automake | ||
cmake ninja | ||
pkgsCross.riscv64-embedded.buildPackages.gcc | ||
]; | ||
in | ||
{ | ||
legacyPackages = pkgs; | ||
devShell = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } { | ||
buildInputs = deps; | ||
RV64_TOOLCHAIN_ROOT = "${pkgs.pkgsCross.riscv64-embedded.buildPackages.gcc}"; | ||
shellHook = '' | ||
export EMU_CC=$RV64_TOOLCHAIN_ROOT/bin/riscv64-none-elf-gcc | ||
export EMU_OBJCOPY=$RV64_TOOLCHAIN_ROOT/bin/riscv64-none-elf-objcopy | ||
make test-img | ||
unset EMU_CC | ||
unset EMU_OBJCOPY | ||
''; | ||
}; | ||
} | ||
) | ||
// { inherit inputs;}; | ||
outputs = { | ||
self, | ||
zig-overlay, | ||
nixpkgs, | ||
flake-utils, | ||
} @ inputs: | ||
flake-utils.lib.eachDefaultSystem | ||
( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [zig-overlay.overlays.default]; | ||
}; | ||
deps = with pkgs; [ | ||
git | ||
gnumake | ||
autoconf | ||
automake | ||
cmake | ||
ninja | ||
zigpkgs.master | ||
pkgsCross.riscv64-embedded.buildPackages.gcc | ||
]; | ||
in { | ||
legacyPackages = pkgs; | ||
formatter = pkgs.alejandra; | ||
devShells.default = pkgs.mkShell.override {stdenv = pkgs.clangStdenv;} { | ||
buildInputs = deps; | ||
RV64_TOOLCHAIN_ROOT = "${pkgs.pkgsCross.riscv64-embedded.buildPackages.gcc}"; | ||
shellHook = '' | ||
export EMU_CC=$RV64_TOOLCHAIN_ROOT/bin/riscv64-none-elf-gcc | ||
export EMU_OBJCOPY=$RV64_TOOLCHAIN_ROOT/bin/riscv64-none-elf-objcopy | ||
make test-img | ||
unset EMU_CC | ||
unset EMU_OBJCOPY | ||
''; | ||
}; | ||
} | ||
) | ||
// {inherit inputs;}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.