ci: fix am native tests
All checks were successful
Build abstract machine with nix / build-packages (abstract-machine) (push) Successful in 17s
Build abstract machine with nix / build-packages (nemu) (push) Successful in 8s
Build abstract machine with nix / build-packages (nemu-lib) (push) Successful in 7s
Build abstract machine with nix / build-packages (rv32Cross.abstract-machine) (push) Successful in 12s
Build npc tests / npc-build (flow) (push) Successful in 8s
Build npc tests / npc-build (flow-simlib) (push) Successful in 10s
All checks were successful
Build abstract machine with nix / build-packages (abstract-machine) (push) Successful in 17s
Build abstract machine with nix / build-packages (nemu) (push) Successful in 8s
Build abstract machine with nix / build-packages (nemu-lib) (push) Successful in 7s
Build abstract machine with nix / build-packages (rv32Cross.abstract-machine) (push) Successful in 12s
Build npc tests / npc-build (flow) (push) Successful in 8s
Build npc tests / npc-build (flow-simlib) (push) Successful in 10s
This commit is contained in:
parent
5ba306c74e
commit
b403f8a40b
8 changed files with 661 additions and 53 deletions
|
@ -21,5 +21,5 @@ set_target_properties(
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
am-native
|
am-native
|
||||||
PUBLIC SDL2::SDL2
|
PUBLIC SDL2::SDL2 dl
|
||||||
PRIVATE klib_interface am_interface)
|
PRIVATE klib_interface am_interface)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <sys/mman.h>
|
#include "platform.h"
|
||||||
#include <sys/auxv.h>
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "platform.h"
|
#include <stdlib.h>
|
||||||
|
#include <sys/auxv.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#define MAX_CPU 16
|
#define MAX_CPU 16
|
||||||
#define TRAP_PAGE_START (void *)0x100000
|
#define TRAP_PAGE_START (void *)0x100000
|
||||||
|
@ -102,7 +102,8 @@ static void init_platform() {
|
||||||
uintptr_t pad = (uintptr_t)vaddr & 0xfff;
|
uintptr_t pad = (uintptr_t)vaddr & 0xfff;
|
||||||
void *vaddr_align = vaddr - pad;
|
void *vaddr_align = vaddr - pad;
|
||||||
uintptr_t size = phdr[i].p_memsz + pad;
|
uintptr_t size = phdr[i].p_memsz + pad;
|
||||||
void *temp_mem = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
void *temp_mem = mmap(NULL, size, PROT_READ | PROT_WRITE,
|
||||||
|
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||||
assert(temp_mem != (void *)-1);
|
assert(temp_mem != (void *)-1);
|
||||||
|
|
||||||
// save data and bss sections
|
// save data and bss sections
|
||||||
|
@ -110,11 +111,13 @@ static void init_platform() {
|
||||||
|
|
||||||
// save the address of mmap() which will be used after munamp(),
|
// save the address of mmap() which will be used after munamp(),
|
||||||
// since calling the library functions requires accessing GOT, which will be unmapped
|
// since calling the library functions requires accessing GOT, which will be unmapped
|
||||||
void *(*mmap_libc)(void *, size_t, int, int, int, off_t) = dlsym(RTLD_NEXT, "mmap");
|
void *(*mmap_libc)(void *, size_t, int, int, int, off_t) =
|
||||||
|
dlsym(RTLD_NEXT, "mmap");
|
||||||
assert(mmap_libc != NULL);
|
assert(mmap_libc != NULL);
|
||||||
// load the address of memcpy() on stack, which can still be accessed
|
// load the address of memcpy() on stack, which can still be accessed
|
||||||
// after the data section is unmapped
|
// after the data section is unmapped
|
||||||
void *(*volatile memcpy_libc_temp)(void *, const void *, size_t) = memcpy_libc;
|
void *(*volatile memcpy_libc_temp)(void *, const void *, size_t) =
|
||||||
|
memcpy_libc;
|
||||||
|
|
||||||
// unmap the data and bss sections
|
// unmap the data and bss sections
|
||||||
ret2 = munmap(vaddr_align, size);
|
ret2 = munmap(vaddr_align, size);
|
||||||
|
@ -176,7 +179,8 @@ static void init_platform() {
|
||||||
void __am_exit_platform(int code) {
|
void __am_exit_platform(int code) {
|
||||||
// let Linux clean up other resource
|
// let Linux clean up other resource
|
||||||
extern int __am_mpe_init;
|
extern int __am_mpe_init;
|
||||||
if (__am_mpe_init && cpu_count() > 1) kill(0, SIGKILL);
|
if (__am_mpe_init && cpu_count() > 1)
|
||||||
|
kill(0, SIGKILL);
|
||||||
exit(code);
|
exit(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,10 +189,12 @@ void __am_pmem_map(void *va, void *pa, int prot) {
|
||||||
int mmap_prot = PROT_NONE;
|
int mmap_prot = PROT_NONE;
|
||||||
// we do not support executable bit, so mark
|
// we do not support executable bit, so mark
|
||||||
// all readable pages executable as well
|
// all readable pages executable as well
|
||||||
if (prot & MMAP_READ) mmap_prot |= PROT_READ | PROT_EXEC;
|
if (prot & MMAP_READ)
|
||||||
if (prot & MMAP_WRITE) mmap_prot |= PROT_WRITE;
|
mmap_prot |= PROT_READ | PROT_EXEC;
|
||||||
void *ret = mmap(va, __am_pgsize, mmap_prot,
|
if (prot & MMAP_WRITE)
|
||||||
MAP_SHARED | MAP_FIXED, pmem_fd, (uintptr_t)(pa - pmem));
|
mmap_prot |= PROT_WRITE;
|
||||||
|
void *ret = mmap(va, __am_pgsize, mmap_prot, MAP_SHARED | MAP_FIXED, pmem_fd,
|
||||||
|
(uintptr_t)(pa - pmem));
|
||||||
assert(ret != (void *)-1);
|
assert(ret != (void *)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,13 +211,9 @@ void __am_get_intr_sigmask(sigset_t *s) {
|
||||||
memcpy_libc(s, &__am_intr_sigmask, sizeof(__am_intr_sigmask));
|
memcpy_libc(s, &__am_intr_sigmask, sizeof(__am_intr_sigmask));
|
||||||
}
|
}
|
||||||
|
|
||||||
int __am_is_sigmask_sti(sigset_t *s) {
|
int __am_is_sigmask_sti(sigset_t *s) { return !sigismember(s, SIGVTALRM); }
|
||||||
return !sigismember(s, SIGVTALRM);
|
|
||||||
}
|
|
||||||
|
|
||||||
void __am_send_kbd_intr() {
|
void __am_send_kbd_intr() { kill(getpid(), SIGUSR1); }
|
||||||
kill(getpid(), SIGUSR1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void __am_pmem_protect() {
|
void __am_pmem_protect() {
|
||||||
// int ret = mprotect(PMEM_START, PMEM_SIZE, PROT_NONE);
|
// int ret = mprotect(PMEM_START, PMEM_SIZE, PROT_NONE);
|
||||||
|
@ -226,5 +228,4 @@ void __am_pmem_unprotect() {
|
||||||
// This dummy function will be called in trm.c.
|
// This dummy function will be called in trm.c.
|
||||||
// The purpose of this dummy function is to let linker add this file to the object
|
// The purpose of this dummy function is to let linker add this file to the object
|
||||||
// file set. Without it, the constructor of @_init_platform will not be linked.
|
// file set. Without it, the constructor of @_init_platform will not be linked.
|
||||||
void __am_platform_dummy() {
|
void __am_platform_dummy() {}
|
||||||
}
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ add_library(am-riscv-nemu cte.c start.S trap.S vme.c ${NEMU_SOURCES})
|
||||||
target_compile_options(am-riscv-nemu PRIVATE ${NEMU_COMPILE_OPTIONS}
|
target_compile_options(am-riscv-nemu PRIVATE ${NEMU_COMPILE_OPTIONS}
|
||||||
${RISCV_COMPILE_OPTIONS})
|
${RISCV_COMPILE_OPTIONS})
|
||||||
|
|
||||||
target_link_options(am-riscv-nemu PRIVATE ${NEMU_LINK_OPITIONS}
|
target_link_options(am-riscv-nemu INTERFACE ${NEMU_LINK_OPITIONS}
|
||||||
${RISCV_LINK_OPTIONS})
|
${RISCV_LINK_OPTIONS})
|
||||||
|
|
||||||
target_include_directories(am-riscv-nemu PRIVATE ${NEMU_INCLUDE_DIRECTORIES})
|
target_include_directories(am-riscv-nemu PRIVATE ${NEMU_INCLUDE_DIRECTORIES})
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
set(NEMU_COMPILE_OPTIONS -fdata-sections -ffunction-sections)
|
set(NEMU_COMPILE_OPTIONS -fdata-sections -ffunction-sections)
|
||||||
set(NEMU_LINK_OPTIONS
|
set(NEMU_LINK_OPTIONS
|
||||||
|
-nostartfiles
|
||||||
|
-nolibc
|
||||||
--defsym=_pmem_start=0x80000000
|
--defsym=_pmem_start=0x80000000
|
||||||
--defsym=_entry_offset=0x0
|
--defsym=_entry_offset=0x0
|
||||||
--gc-sections
|
--gc-sections
|
||||||
-e _start)
|
-e
|
||||||
set(NEMU_INCLUDE_DIRECTORIES
|
_start)
|
||||||
${CMAKE_SOURCE_DIR}/am/src/platform/nemu/include)
|
set(NEMU_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/am/src/platform/nemu/include)
|
||||||
file(GLOB_RECURSE NEMU_SOURCES
|
file(GLOB_RECURSE NEMU_SOURCES ${CMAKE_SOURCE_DIR}/am/src/platform/nemu/*.[cS])
|
||||||
${CMAKE_SOURCE_DIR}/am/src/platform/nemu/*.[cS])
|
|
||||||
set(INCLUDE_LINKER_SCRIPT ON)
|
set(INCLUDE_LINKER_SCRIPT ON)
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{ stdenv,
|
{ stdenv
|
||||||
lib,
|
, lib
|
||||||
cmake,
|
, cmake
|
||||||
SDL2,
|
, SDL2
|
||||||
isa ? "native",
|
, glibc
|
||||||
platform ? [ ]
|
, isa ? "native"
|
||||||
|
, platform ? [ ]
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "abstract-machine";
|
pname = "abstract-machine";
|
||||||
|
|
|
@ -9,7 +9,6 @@ set(SOURCES cpp.c int64.c stdio.c stdlib.c string.c
|
||||||
add_library(klib ${SOURCES})
|
add_library(klib ${SOURCES})
|
||||||
target_link_libraries(klib PUBLIC am_interface klib_interface)
|
target_link_libraries(klib PUBLIC am_interface klib_interface)
|
||||||
target_compile_options(klib PUBLIC -fno-builtin)
|
target_compile_options(klib PUBLIC -fno-builtin)
|
||||||
target_link_options(klib PUBLIC -nostartfiles -nolibc)
|
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS klib
|
TARGETS klib
|
||||||
|
|
608
flake.lock
608
flake.lock
|
@ -1,5 +1,48 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"am-kernels": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
|
"ysyx-workbench": "ysyx-workbench"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1723617032,
|
||||||
|
"narHash": "sha256-oL5Vx933Jhn+T9jn67wFbh8vy7w8OJNCn4DOOlX/r0U=",
|
||||||
|
"ref": "dev",
|
||||||
|
"rev": "3ee527c3de481e38767fffbd9e16bf48359fc638",
|
||||||
|
"revCount": 78,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/am-kernels.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"ref": "dev",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/am-kernels.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"diffu": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_5",
|
||||||
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"nur-xin": "nur-xin_2",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1723627842,
|
||||||
|
"narHash": "sha256-+Ovf1e5ESap4sGMsH945SkZLhyYUxGE7shKVl3Ue1CQ=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "7b3881a9712bcb7bfea90614a44888ae5df6e849",
|
||||||
|
"revCount": 17,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/diffu.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/diffu.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -16,6 +59,54 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_3": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_4": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
|
@ -52,7 +143,182 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_3": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_4": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_5": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_5"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_6": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_6"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_7": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_7"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_8": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_8"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
|
"ysyx-workbench",
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_3": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"diffu",
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore_4": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"pre-commit-hooks",
|
"pre-commit-hooks",
|
||||||
|
@ -105,6 +371,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-circt162_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1705645507,
|
||||||
|
"narHash": "sha256-tX3vipIAmNDBA8WNWG4oY4KyTfnm2YieTHO2BhG8ISA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "7995cae3ad60e3d6931283d650d7f43d31aaa5c7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "7995cae3ad60e3d6931283d650d7f43d31aaa5c7",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710695816,
|
"lastModified": 1710695816,
|
||||||
|
@ -121,7 +403,130 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-stable_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710695816,
|
||||||
|
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710695816,
|
||||||
|
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710695816,
|
||||||
|
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1711703276,
|
||||||
|
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709237383,
|
||||||
|
"narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur-xin": {
|
"nur-xin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
|
"ysyx-workbench",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721891452,
|
||||||
|
"narHash": "sha256-2c9nDuXXARzoRXE67lte5kKBeFb1XmTNsvdiIbRUEgE=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "de8ad578fc4fe527772cec23a7f660bde14c8570",
|
||||||
|
"revCount": 152,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/nur.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/nur.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nur-xin_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"diffu",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721891452,
|
||||||
|
"narHash": "sha256-2c9nDuXXARzoRXE67lte5kKBeFb1XmTNsvdiIbRUEgE=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "de8ad578fc4fe527772cec23a7f660bde14c8570",
|
||||||
|
"revCount": 152,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/nur.git"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/nur.git"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nur-xin_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
|
@ -147,6 +552,7 @@
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
|
@ -165,13 +571,90 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks_2": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_2",
|
||||||
|
"flake-utils": "flake-utils_4",
|
||||||
|
"gitignore": "gitignore_2",
|
||||||
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
|
"ysyx-workbench",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712055707,
|
||||||
|
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pre-commit-hooks_3": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_3",
|
||||||
|
"flake-utils": "flake-utils_6",
|
||||||
|
"gitignore": "gitignore_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"diffu",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712055707,
|
||||||
|
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pre-commit-hooks_4": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_4",
|
||||||
|
"flake-utils": "flake-utils_8",
|
||||||
|
"gitignore": "gitignore_4",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable_4"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712055707,
|
||||||
|
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"am-kernels": "am-kernels",
|
||||||
"nixpkgs": "nixpkgs",
|
"diffu": "diffu",
|
||||||
"nixpkgs-circt162": "nixpkgs-circt162",
|
"flake-utils": "flake-utils_7",
|
||||||
"nur-xin": "nur-xin",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"nixpkgs-circt162": "nixpkgs-circt162_2",
|
||||||
|
"nur-xin": "nur-xin_3",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks_4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
@ -203,6 +686,121 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_5": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_6": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_7": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems_8": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ysyx-workbench": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"am-kernels",
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-circt162": "nixpkgs-circt162",
|
||||||
|
"nur-xin": "nur-xin",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1723551098,
|
||||||
|
"narHash": "sha256-/AnVxufgQoAuvNBSKm0BG+tTS++/HuaNoW+loroSQig=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "8ee1551dc2857091fca6456c1367aab7090899fe",
|
||||||
|
"revCount": 119,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/ysyx-workbench"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.xinyang.life/xin/ysyx-workbench"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -11,11 +11,11 @@
|
||||||
url = "git+https://git.xinyang.life/xin/nur.git";
|
url = "git+https://git.xinyang.life/xin/nur.git";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
# diffu.url = "github:xinyangli/diffu";
|
diffu.url = "git+https://git.xinyang.life/xin/diffu.git";
|
||||||
# am-kernels.url = "git+https://git.xinyang.life/xin/am-kernels.git";
|
am-kernels.url = "git+https://git.xinyang.life/xin/am-kernels.git?ref=dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, flake-utils, nixpkgs, nixpkgs-circt162, pre-commit-hooks, nur-xin }@inputs:
|
outputs = { self, flake-utils, nixpkgs, nixpkgs-circt162, pre-commit-hooks, nur-xin, diffu, am-kernels }@inputs:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
|
@ -135,6 +135,14 @@
|
||||||
mini-gdbstub
|
mini-gdbstub
|
||||||
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
] ++ self.checks.${system}.pre-commit-check.enabledPackages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
devShells.difftest = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
diffu.packages.${system}.default
|
||||||
|
am-kernels.packages.${system}.rv32Cross.am-kernels-npc
|
||||||
|
self.packages.${system}.nemu-lib
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue