projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update readme
[c11tester.git]
/
model.h
diff --git
a/model.h
b/model.h
index 12aeebcce1df645950ce702d07c14f459da15de6..d71ad8f69204f9a1905269595f80cdbff191a0f8 100644
(file)
--- a/
model.h
+++ b/
model.h
@@
-18,6
+18,11
@@
#include "classlist.h"
#include "snapshot-interface.h"
#include "classlist.h"
#include "snapshot-interface.h"
+#define ENTER_MODEL_FLAG (inside_model = 1)
+#define EXIT_MODEL_FLAG (inside_model = 0)
+#define GET_MODEL_FLAG (inside_model)
+#define RESTORE_MODEL_FLAG(f) (inside_model = f)
+
/** @brief Model checker execution stats */
struct execution_stats {
int num_total; /**< @brief Total number of executions */
/** @brief Model checker execution stats */
struct execution_stats {
int num_total; /**< @brief Total number of executions */
@@
-36,7
+41,6
@@
public:
void exit_model_checker();
ModelExecution * get_execution() const { return execution; }
void exit_model_checker();
ModelExecution * get_execution() const { return execution; }
- ModelHistory * get_history() const { return history; }
int get_execution_number() const { return execution_number; }
int get_execution_number() const { return execution_number; }
@@
-44,6
+48,7
@@
public:
Thread * get_thread(const ModelAction *act) const;
Thread * get_current_thread() const;
Thread * get_thread(const ModelAction *act) const;
Thread * get_current_thread() const;
+ thread_id_t get_current_thread_id() const;
uint64_t switch_thread(ModelAction *act);
uint64_t switch_thread(ModelAction *act);
@@
-64,7
+69,6
@@
private:
/** The scheduler to use: tracks the running/ready Threads */
Scheduler * const scheduler;
/** The scheduler to use: tracks the running/ready Threads */
Scheduler * const scheduler;
- ModelHistory * history;
ModelExecution *execution;
Thread * init_thread;
ModelExecution *execution;
Thread * init_thread;
@@
-72,15
+76,12
@@
private:
unsigned int curr_thread_num;
Thread * chosen_thread;
unsigned int curr_thread_num;
Thread * chosen_thread;
- bool thread_chosen;
bool break_execution;
void startRunExecution(Thread *old);
void finishRunExecution(Thread *old);
bool break_execution;
void startRunExecution(Thread *old);
void finishRunExecution(Thread *old);
- void consumeAction();
- void chooseThread(ModelAction *act, Thread *thr);
Thread * getNextThread(Thread *old);
Thread * getNextThread(Thread *old);
-
void
handleChosenThread(Thread *old);
+
bool
handleChosenThread(Thread *old);
modelclock_t checkfree;
modelclock_t checkfree;
@@
-106,8
+107,10
@@
private:
void print_stats() const;
};
void print_stats() const;
};
+extern int inside_model;
extern ModelChecker *model;
void parse_options(struct model_params *params);
void install_trace_analyses(ModelExecution *execution);
extern ModelChecker *model;
void parse_options(struct model_params *params);
void install_trace_analyses(ModelExecution *execution);
+void createModelIfNotExist();
#endif /* __MODEL_H__ */
#endif /* __MODEL_H__ */