main/model: add future value expiration sloppiness parameter
authorBrian Norris <banorris@uci.edu>
Wed, 7 Nov 2012 00:09:59 +0000 (16:09 -0800)
committerBrian Norris <banorris@uci.edu>
Wed, 7 Nov 2012 00:09:59 +0000 (16:09 -0800)
Functionality not implemented yet

main.cc
model.h

diff --git a/main.cc b/main.cc
index 122539811e8f36c0b86f7fadbe823ca6cdbee29a..1aafb696c8f80bd5974957a47eb2c9e0b6324d51 100644 (file)
--- 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 63f45c723d4bdca402d50a2c82d4d0a62f3b5dc7..f843f75cfdfb29ba356932ca65902ec739cbfbb4 100644 (file)
--- 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 {