projects
/
cdsspec-compiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c24e6b
)
add some comments
author
Brian Demsky
<bdemsky@uci.edu>
Fri, 27 Jul 2012 08:24:24 +0000
(
01:24
-0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 2 Aug 2012 17:12:53 +0000
(10:12 -0700)
model.cc
patch
|
blob
|
history
nodestack.cc
patch
|
blob
|
history
diff --git
a/model.cc
b/model.cc
index 4c67b5a8056bbcbb54c908f9d8797562c70dd107..02a4a6a29206b34b8b3b22308439807b1b7c1188 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-361,12
+361,12
@@
void ModelChecker::check_current_action(void)
set_backtracking(curr);
}
set_backtracking(curr);
}
-/** @returns whether the current trace is feasible. */
+/** @returns whether the current
partial
trace is feasible. */
bool ModelChecker::isfeasible() {
return !cyclegraph->checkForCycles() && !failed_promise;
}
bool ModelChecker::isfeasible() {
return !cyclegraph->checkForCycles() && !failed_promise;
}
-/** Returns whether the current trace is feasible. */
+/** Returns whether the current
completed
trace is feasible. */
bool ModelChecker::isfinalfeasible() {
return isfeasible() && promises->size()==0;
}
bool ModelChecker::isfinalfeasible() {
return isfeasible() && promises->size()==0;
}
@@
-532,7
+532,7
@@
ClockVector * ModelChecker::get_cv(thread_id_t tid) {
}
}
-/** Resolve promises. */
+/** Resolve
the given
promises. */
void ModelChecker::resolve_promises(ModelAction *write) {
for(unsigned int i=0, promise_index=0;promise_index<promises->size(); i++) {
void ModelChecker::resolve_promises(ModelAction *write) {
for(unsigned int i=0, promise_index=0;promise_index<promises->size(); i++) {
@@
-547,6
+547,9
@@
void ModelChecker::resolve_promises(ModelAction *write) {
}
}
}
}
+/** Compute the set of promises that could potentially be satisfied by
+ * this action. */
+
void ModelChecker::compute_promises(ModelAction *curr) {
for(unsigned int i=0;i<promises->size();i++) {
Promise * promise=(*promises)[i];
void ModelChecker::compute_promises(ModelAction *curr) {
for(unsigned int i=0;i<promises->size();i++) {
Promise * promise=(*promises)[i];
diff --git
a/nodestack.cc
b/nodestack.cc
index 4ece1820ab86b35baad7c6ec1c7ee18b1a19c61b..6f7e6a205f6a7e317b3373837fce74ee8cd202c1 100644
(file)
--- a/
nodestack.cc
+++ b/
nodestack.cc
@@
-57,16
+57,33
@@
void Node::print_may_read_from()
(*it)->print();
}
(*it)->print();
}
+/** This method sets a promise to explore meeting with the given
+ * node.
+ * @param i is the promise index.
+ */
+
void Node::set_promise(uint32_t i) {
if (i>=promises.size())
promises.resize(i+1,0);
promises[i]=1;
}
void Node::set_promise(uint32_t i) {
if (i>=promises.size())
promises.resize(i+1,0);
promises[i]=1;
}
+/** This method looks up whether a given promise should be satisfied
+ * by this node.
+ *
+ * @param i is the promise index.
+ * @return true if the promise should be satisfied by the given model action.
+ */
+
bool Node::get_promise(uint32_t i) {
return (promises[i]==2);
}
bool Node::get_promise(uint32_t i) {
return (promises[i]==2);
}
+/** This method increments to the next combination of promises.
+ *
+ * @return true if we have a valid combination.
+ */
+
bool Node::increment_promise() {
for (unsigned int i=0;i<promises.size();i++) {
if (promises[i]==1) {
bool Node::increment_promise() {
for (unsigned int i=0;i<promises.size();i++) {
if (promises[i]==1) {
@@
-82,6
+99,11
@@
bool Node::increment_promise() {
return false;
}
return false;
}
+/** This method returns whether the promise set is empty.
+ *
+ * @return true if we have explored all promise combinations.
+ */
+
bool Node::promise_empty() {
for (unsigned int i=0;i<promises.size();i++)
if (promises[i]==1)
bool Node::promise_empty() {
for (unsigned int i=0;i<promises.size();i++)
if (promises[i]==1)