Compare commits

..

2 Commits

Author SHA1 Message Date
wangfiox 962c4b8853 🔧 2024-07-26 23:22:00 +08:00
wangfiox a17a3c7314 🔧 2024-07-26 22:30:35 +08:00
3 changed files with 161 additions and 0 deletions

60
flake.lock Normal file
View File

@ -0,0 +1,60 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"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"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1719899612,
"narHash": "sha256-8dHhS9LNyhWAgQfYs6QBlRB/Bvi+ilUfKoIO39U8faE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "08683639c23b5daa3f603fee68218a1812842511",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

45
flake.nix Normal file
View File

@ -0,0 +1,45 @@
{
description = "Rust development environment with Clang and LLVM support";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
libPath = pkgs.lib.makeLibraryPath [
# load external libraries that you need in your rust project here
"."
];
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
llvmPackages_16.bintools
llvmPackages_16.libllvm
llvmPackages_16.llvm
llvmPackages_16.stdenv
rocmPackages.llvm.polly
clang
rustup
glib
gcc
libxml2
(with pkgsCross.riscv64; [ glib.stdenv.cc buildPackages.gdb ])
qemu
];
LD_LIBRARY_PATH = libPath;
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
'';
# LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
};
});
}

56
zci.toml Normal file
View File

@ -0,0 +1,56 @@
data_dir = "."
cases = ["functional_c"]
server = "http://10.249.12.73/zci"
executer = "simulate_1"
[test]
task_name = "test"
task_path = "./data_cli/task1"
cases = ["performance_c"]
server_ip = "10.249.12.73"
server_port = 8080
tag = "starfive"
[test.config]
cache = false
execute_cmd = "{bin}"
total_timeout = 10000
case_timeout = 1000
per_timeout = 100
intermediary_break = false
# [test.config.envs]
# LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:data/lib"
[status]
server_ip = "10.249.12.73"
server_port = 8080
[compile]
cache = false
# compiler = "clang"
compiler = "/home/wangfiox/Documents/compiler/target/debug/compiler-cs"
# compile_cmd = "{compiler} -S {sy} -l {asm} -o /dev/null"
compile_cmd = "{compiler} -S {sy} -o {asm}"
[asm2bin]
cache = false
asm2bin_cmd = "riscv64-unknown-linux-gnu-gcc {asm} -Llib -lsysy -march=rv64gc -o {bin}"
[execute]
cache = false
execute_cmd = "qemu-riscv64 {bin}"
per_timeout = 20
intermediary_break = false
[expect]
cache = false
compile_cmd = "riscv64-unknown-linux-gnu-gcc -x c {sy} -S -o {asm} -march=rv64gc"
asm2bin_cmd = "riscv64-unknown-linux-gnu-gcc {asm} -Lsysy-data/lib -lsysy -march=rv64gc -o {bin}"
execute_cmd = "qemu-riscv64 {bin}"
[clean]
dirs = ["asm", "bin", "diff", "output", "log"] # "expect",
[diff]
cache = true
diff_cmd = "diff {out1} {out2}"