From b76705db31ea3cc095400bb870114ee92f834201 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 6 Nov 2012 16:09:59 -0800 Subject: [PATCH] main/model: add future value expiration sloppiness parameter Functionality not implemented yet --- main.cc | 9 +++++++-- model.h | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/main.cc b/main.cc index 12253981..1aafb696 100644 --- a/main.cc +++ b/main.cc @@ -21,6 +21,7 @@ static void param_defaults(struct model_params * params) { params->enabledcount = 1; params->bound = 0; params->maxfuturevalues = 0; + params->expireslop = 2; } static void print_usage(struct model_params *params) { @@ -39,18 +40,19 @@ static void print_usage(struct model_params *params) { "-s Maximum actions that the model checker will wait for\n" " a write from the future past the expected number of\n" " actions. Default: %d\n" +"-S Future value expiration sloppiness. Default: %u\n" "-f Specify a fairness window in which actions that are\n" " enabled sufficiently many times should receive\n" " priority for execution. Default: %d\n" "-e Enabled count. Default: %d\n" "-b Upper length bound. Default: %d\n" "-- Program arguments follow.\n\n", -params->maxreads, params->maxfuturevalues, params->maxfuturedelay, params->fairwindow, params->enabledcount, params->bound); +params->maxreads, params->maxfuturevalues, params->maxfuturedelay, params->expireslop, params->fairwindow, params->enabledcount, params->bound); exit(EXIT_SUCCESS); } static void parse_options(struct model_params *params, int *argc, char ***argv) { - const char *shortopts = "hm:M:s:f:e:b:"; + const char *shortopts = "hm:M:s:S:f:e:b:"; int opt; bool error = false; while (!error && (opt = getopt(*argc, *argv, shortopts)) != -1) { @@ -61,6 +63,9 @@ static void parse_options(struct model_params *params, int *argc, char ***argv) case 's': params->maxfuturedelay = atoi(optarg); break; + case 'S': + params->expireslop = atoi(optarg); + break; case 'f': params->fairwindow = atoi(optarg); break; diff --git a/model.h b/model.h index 63f45c72..f843f75c 100644 --- a/model.h +++ b/model.h @@ -41,6 +41,11 @@ struct model_params { /** @brief Maximum number of future values that can be sent to the same * read */ int maxfuturevalues; + + /** @brief Only generate a new future value/expiration pair if the + * expiration time exceeds the existing one by more than the slop + * value */ + unsigned int expireslop; }; struct PendingFutureValue { -- 2.34.1