diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-27 16:37:55 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-09-27 16:37:55 +0200 |
| commit | 41be2d294e5b6f55d485d635065096f274bc89c1 (patch) | |
| tree | d1906840307eedc503e66f6aebf746717f57d1ed /tools/001_derive_h48 | |
| parent | 15fe089b3e625cb6d3a19dee661f4fc9c6224699 (diff) | |
| download | nissy-core-41be2d294e5b6f55d485d635065096f274bc89c1.tar.gz nissy-core-41be2d294e5b6f55d485d635065096f274bc89c1.zip | |
Made table derivation tool more flexible
So apparently my RAM is broken. That took me a while to figure out.
While I get a replacement, I have to restrict myself to a weaker
test for the intermediate tables: instead of deriving them from
the huge table and checking that they are the same, I have to derive
a small h0k2 table from the intermediate ones and check that it is
correct. This is not a 100% proof of correctness, but it is good
enough (and much faster).
Diffstat (limited to 'tools/001_derive_h48')
| -rw-r--r-- | tools/001_derive_h48/derive_h48.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/001_derive_h48/derive_h48.c b/tools/001_derive_h48/derive_h48.c new file mode 100644 index 0000000..3c7f8cc --- /dev/null +++ b/tools/001_derive_h48/derive_h48.c | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include "../tool.h" | ||
| 2 | |||
| 3 | char *opts_large, *opts_small, *filename_large, *filename_small; | ||
| 4 | |||
| 5 | void run(void) { | ||
| 6 | derivedata_run(opts_large, opts_small, filename_large, filename_small); | ||
| 7 | } | ||
| 8 | |||
| 9 | int main(int argc, char **argv) { | ||
| 10 | char description[256]; | ||
| 11 | |||
| 12 | if (argc < 5) { | ||
| 13 | fprintf(stderr, | ||
| 14 | "Error: not enough arguments. Required:\n" | ||
| 15 | "1. Options for large table\n" | ||
| 16 | "2. Options for derived table\n" | ||
| 17 | "3. Filename containing large table\n" | ||
| 18 | "4. Filename for saving derived table\n"); | ||
| 19 | return 1; | ||
| 20 | } | ||
| 21 | |||
| 22 | opts_large = argv[1]; | ||
| 23 | opts_small = argv[2]; | ||
| 24 | filename_large = argv[3]; | ||
| 25 | filename_small = argv[4]; | ||
| 26 | sprintf(description, "deriving %s from %s\n", opts_small, opts_large); | ||
| 27 | |||
| 28 | nissy_setlogger(log_stderr); | ||
| 29 | |||
| 30 | timerun(run, description); | ||
| 31 | |||
| 32 | return 0; | ||
| 33 | } | ||
