Skip to content

Commit

Permalink
config: support per benchmark config
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Nov 15, 2024
1 parent f30f9b6 commit cc63f67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,6 @@ then get help
h
```

it will show you some usage tips
```
DETERMINISTIC_CHECKPOINTS USAGE TIPS
• Set SPEC CPU 2006 source code: edit config.nix : spec2006_path = [...]
• Set input size: edit config.nix : size = xxx (default input is ref)
• Change other configs in config.nix
• Generate the checkpoints of all testCases into result/ : nom-build -A checkpoints
• Generate the checkpoints of a specific testCase into result/ : nom-build -A checkpoints.<testCase>
• E.g.: nom-build -A checkpoints.403_gcc
• Running nom-build without parameters will generate results-* directory containing all intermediate build results, symlinked to the corresponding /nix/store/....nix. You can then use dump_result.py to read the log files within and obtain the dynamic instruction count of the program.
• E.g.: nom-build
```


build the project
```bash
nom-build -A checkpoints -j 10
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/spec2006/build-all.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in stdenv.mkDerivation {
system = "x86_64-linux";

srcs = [
config.spec2006_path
config.src
CPU2006LiteWrapper
];
sourceRoot = ".";
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/spec2006/config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
size = "ref"; # test or ref
src = /nfs/home/yanyue/tools/spec2006;
}
5 changes: 4 additions & 1 deletion benchmarks/spec2006/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ callPackage
, runCommand
, config
}: let
testCases = [
"400.perlbench"
Expand Down Expand Up @@ -32,7 +33,9 @@
"482.sphinx3"
"483.xalancbmk"
];
build-all = callPackage ./build-all.nix {};
build-all = callPackage ./build-all.nix {
config = import ./config.nix // config;
};
in builtins.listToAttrs (
builtins.map (testcase: {
# change `.` to `_`, e.g. "403.gcc" to "403_gcc"
Expand Down
2 changes: 0 additions & 2 deletions config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
simulator = "nemu"; # nemu or qemu
intervals = 20000000;
workload = "miao";
size = "ref"; # test or ref
# TODO: remove *_log
profiling_log = "profiling.log";
checkpoint_log = "checkpoint.log";
spec2006_path = /nfs/home/yanyue/tools/spec2006;
checkpoint_format = "zstd"; # gz or zstd, qemu only support zstd compressed
}
3 changes: 2 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ let
* `nom-build ... --arg <key> <value> ...`
* `nom-build ... --argstr <key> <strvalue> ...`
* E.g: Generate spec2006 checkpoints using given source code, by qemu, in test size:
* `nom-build -A spec2006 --arg spec2006_path ~/Codes/spec2006.tar.gz --argstr simulator qemu --argstr size test`
* `nom-build -A spec2006 --arg src ~/Codes/spec2006.tar.gz --argstr simulator qemu --argstr size test`
* Configure by global config file: edit `./config.nix`
* Configure by per-benchmark config file: edit `./benchmarks/*/config.nix`
## Generation
Expand Down

0 comments on commit cc63f67

Please sign in to comment.