#include "snapshot-interface.h"
#include "plugins.h"
-static void param_defaults(struct model_params *params)
+void param_defaults(struct model_params *params)
{
params->verbose = !!DBG_ENABLED();
params->uninitvalue = 0;
/** The model_main function contains the main model checking loop. */
static void model_main()
{
- modelchecker_started = true;
snapshot_record(0);
model->run();
delete model;
/* Configure output redirection for the model-checker */
redirect_output();
- //Initialize snapshotting library
- if (!model)
+ //Initialize snapshotting library and model checker object
+ if (!model) {
snapshot_system_init(10000, 1024, 1024, 40000);
+ model = new ModelChecker();
+ }
- struct model_params params;
-
- param_defaults(¶ms);
register_plugins();
- parse_options(¶ms, main_argc, main_argv);
+
+ //Parse command line options
+ model_params *params = model->getParams();
+ parse_options(params, main_argc, main_argv);
//Initialize race detector
initRaceDetector();
snapshot_stack_init();
-
- if (!model)
- model = new ModelChecker();
-
- model->setParams(params);
install_trace_analyses(model->get_execution());
+ //Start everything up
+ modelchecker_started = true;
startExecution(&model_main);
}
#include "traceanalysis.h"
#include "execution.h"
#include "bugmessage.h"
+#include "params.h"
ModelChecker *model = NULL;
bool modelchecker_started = false;
init_thread = new Thread(execution->get_next_id(), (thrd_t *) malloc(sizeof(thrd_t)), &user_main_wrapper, NULL, NULL); // L: user_main_wrapper passes the user program
execution->add_thread(init_thread);
scheduler->set_current_thread(init_thread);
+ execution->setParams(¶ms);
+ param_defaults(¶ms);
}
/** @brief Destructor */
}
/** Method to set parameters */
-void ModelChecker::setParams(struct model_params params) {
- this->params = params;
- execution->setParams(¶ms);
+model_params * ModelChecker::getParams() {
+ return ¶ms;
}
/**