From 805a3e1b51dacac117b394f1c1b0220e3ae9f5e4 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 31 Jul 2012 16:58:00 -0700 Subject: [PATCH 1/1] model: add documentation [Split from Brian Demsky's work] --- model.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/model.cc b/model.cc index 1b379000..3262f5e5 100644 --- a/model.cc +++ b/model.cc @@ -235,6 +235,11 @@ void ModelChecker::set_backtracking(ModelAction *act) } } +/** + * Returns last backtracking point. The model checker will explore a different + * path for this point in the next execution. + * @return The ModelAction at which the next execution should diverge. + */ ModelAction * ModelChecker::get_next_backtrack() { ModelAction *next = next_backtrack; @@ -319,6 +324,7 @@ void ModelChecker::check_current_action(void) add_action_to_lists(curr); } +/** @returns whether the current trace is feasible. */ bool ModelChecker::isfeasible() { return !cyclegraph->checkForCycles(); } @@ -332,6 +338,11 @@ void ModelChecker::process_rmw(ModelAction * act) { lastread->upgrade_rmw(act); } +/** + * Updates the cyclegraph with the constraints imposed from the current read. + * @param curr The current action. Must be a read. + * @param rf The action that curr reads from. Must be a write. + */ void ModelChecker::r_modification_order(ModelAction * curr, const ModelAction *rf) { std::vector *thrd_lists = &(*obj_thrd_map)[curr->get_location()]; unsigned int i; @@ -360,6 +371,10 @@ void ModelChecker::r_modification_order(ModelAction * curr, const ModelAction *r } } +/** + * Updates the cyclegraph with the constraints imposed from the current write. + * @param curr The current action. Must be a write. + */ void ModelChecker::w_modification_order(ModelAction * curr) { std::vector *thrd_lists = &(*obj_thrd_map)[curr->get_location()]; unsigned int i; @@ -450,6 +465,11 @@ ModelAction * ModelChecker::get_parent_action(thread_id_t tid) return parent; } +/** + * Returns the clock vector for a given thread. + * @param tid The thread whose clock vector we want + * @return Desired clock vector + */ ClockVector * ModelChecker::get_cv(thread_id_t tid) { return get_parent_action(tid)->get_cv(); } -- 2.34.1