projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add traceanalysis support
[model-checker.git]
/
cyclegraph.cc
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 26ea215d434921f2b27fd69e07ef18d1e6029f54..7e5e95602408b47f5d4ff5b746e64db88287366f 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-2,7
+2,6
@@
#include "action.h"
#include "common.h"
#include "promise.h"
#include "action.h"
#include "common.h"
#include "promise.h"
-#include "model.h"
#include "threads-model.h"
/** Initializes a CycleGraph object. */
#include "threads-model.h"
/** Initializes a CycleGraph object. */
@@
-232,8
+231,8
@@
bool CycleGraph::addNodeEdge(CycleNode *fromnode, CycleNode *tonode)
*
* Handles special case of a RMW action, where the ModelAction rmw reads from
* the ModelAction/Promise from. The key differences are:
*
* Handles special case of a RMW action, where the ModelAction rmw reads from
* the ModelAction/Promise from. The key differences are:
- *
(1) no write can occur in between the rmw and the from action
.
- *
(2)
Only one RMW action can read from a given write.
+ *
-# No write can occur in between the @a rmw and @a from actions
.
+ *
-#
Only one RMW action can read from a given write.
*
* @param from The edge comes from this ModelAction/Promise
* @param rmw The edge points to this ModelAction; this action must read from
*
* @param from The edge comes from this ModelAction/Promise
* @param rmw The edge points to this ModelAction; this action must read from
@@
-314,12
+313,12
@@
static void print_node(FILE *file, const CycleNode *node, int label)
{
if (node->is_promise()) {
const Promise *promise = node->getPromise();
{
if (node->is_promise()) {
const Promise *promise = node->getPromise();
- int idx =
model->get_promise_number(promise
);
+ int idx =
promise->get_index(
);
fprintf(file, "P%u", idx);
if (label) {
int first = 1;
fprintf(file, " [label=\"P%d, T", idx);
fprintf(file, "P%u", idx);
if (label) {
int first = 1;
fprintf(file, " [label=\"P%d, T", idx);
- for (unsigned int i = 0 ; i <
model->get_num_threads
(); i++)
+ for (unsigned int i = 0 ; i <
promise->max_available_thread_idx
(); i++)
if (promise->thread_is_available(int_to_id(i))) {
fprintf(file, "%s%u", first ? "": ",", i);
first = 0;
if (promise->thread_is_available(int_to_id(i))) {
fprintf(file, "%s%u", first ? "": ",", i);
first = 0;
@@
-472,6
+471,7
@@
bool CycleGraph::checkPromise(const ModelAction *fromact, Promise *promise) cons
return false;
}
return false;
}
+/** @brief Begin a new sequence of graph additions which can be rolled back */
void CycleGraph::startChanges()
{
ASSERT(rollbackvector.empty());
void CycleGraph::startChanges()
{
ASSERT(rollbackvector.empty());
@@
-531,7
+531,7
@@
CycleNode::CycleNode(const Promise *promise) :
/**
* @param i The index of the edge to return
/**
* @param i The index of the edge to return
- * @returns The
a
CycleNode edge indexed by i
+ * @returns The CycleNode edge indexed by i
*/
CycleNode * CycleNode::getEdge(unsigned int i) const
{
*/
CycleNode * CycleNode::getEdge(unsigned int i) const
{
@@
-544,11
+544,16
@@
unsigned int CycleNode::getNumEdges() const
return edges.size();
}
return edges.size();
}
+/**
+ * @param i The index of the back edge to return
+ * @returns The CycleNode back-edge indexed by i
+ */
CycleNode * CycleNode::getBackEdge(unsigned int i) const
{
return back_edges[i];
}
CycleNode * CycleNode::getBackEdge(unsigned int i) const
{
return back_edges[i];
}
+/** @returns The number of edges entering this CycleNode */
unsigned int CycleNode::getNumBackEdges() const
{
return back_edges.size();
unsigned int CycleNode::getNumBackEdges() const
{
return back_edges.size();