Skip to content

Commit cc63f67

Browse files
committed
config: support per benchmark config
1 parent f30f9b6 commit cc63f67

File tree

6 files changed

+11
-20
lines changed

6 files changed

+11
-20
lines changed

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ then get help
4747
h
4848
```
4949

50-
it will show you some usage tips
51-
```
52-
DETERMINISTIC_CHECKPOINTS USAGE TIPS
53-
54-
• Set SPEC CPU 2006 source code: edit config.nix : spec2006_path = [...]
55-
• Set input size: edit config.nix : size = xxx (default input is ref)
56-
• Change other configs in config.nix
57-
• Generate the checkpoints of all testCases into result/ : nom-build -A checkpoints
58-
• Generate the checkpoints of a specific testCase into result/ : nom-build -A checkpoints.<testCase>
59-
• E.g.: nom-build -A checkpoints.403_gcc
60-
• 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.
61-
• E.g.: nom-build
62-
```
63-
64-
6550
build the project
6651
```bash
6752
nom-build -A checkpoints -j 10

benchmarks/spec2006/build-all.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ in stdenv.mkDerivation {
3737
system = "x86_64-linux";
3838

3939
srcs = [
40-
config.spec2006_path
40+
config.src
4141
CPU2006LiteWrapper
4242
];
4343
sourceRoot = ".";

benchmarks/spec2006/config.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
size = "ref"; # test or ref
3+
src = /nfs/home/yanyue/tools/spec2006;
4+
}

benchmarks/spec2006/default.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{ callPackage
22
, runCommand
3+
, config
34
}: let
45
testCases = [
56
"400.perlbench"
@@ -32,7 +33,9 @@
3233
"482.sphinx3"
3334
"483.xalancbmk"
3435
];
35-
build-all = callPackage ./build-all.nix {};
36+
build-all = callPackage ./build-all.nix {
37+
config = import ./config.nix // config;
38+
};
3639
in builtins.listToAttrs (
3740
builtins.map (testcase: {
3841
# change `.` to `_`, e.g. "403.gcc" to "403_gcc"

config.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
simulator = "nemu"; # nemu or qemu
33
intervals = 20000000;
44
workload = "miao";
5-
size = "ref"; # test or ref
65
# TODO: remove *_log
76
profiling_log = "profiling.log";
87
checkpoint_log = "checkpoint.log";
9-
spec2006_path = /nfs/home/yanyue/tools/spec2006;
108
checkpoint_format = "zstd"; # gz or zstd, qemu only support zstd compressed
119
}

shell.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ let
1616
* `nom-build ... --arg <key> <value> ...`
1717
* `nom-build ... --argstr <key> <strvalue> ...`
1818
* E.g: Generate spec2006 checkpoints using given source code, by qemu, in test size:
19-
* `nom-build -A spec2006 --arg spec2006_path ~/Codes/spec2006.tar.gz --argstr simulator qemu --argstr size test`
19+
* `nom-build -A spec2006 --arg src ~/Codes/spec2006.tar.gz --argstr simulator qemu --argstr size test`
2020
* Configure by global config file: edit `./config.nix`
21+
* Configure by per-benchmark config file: edit `./benchmarks/*/config.nix`
2122
2223
## Generation
2324

0 commit comments

Comments
 (0)