Skip to content

Commit

Permalink
more information about channel probe errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed May 31, 2023
1 parent 2c95f35 commit bf48b97
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions chpsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,20 @@ int ChpSim::_collect_sharedvars (Expr *e, int pc, int undo)
_probe = new WaitForOne (0);
}
if (c->probe && c->probe != _probe) {
int dy;
fprintf (stderr, "Process %s: channel `",
_proc ? _proc->getName() : "-global-");
act_connection *x = _sc->getConnFromOffset (_proc, e->u.x.val, 2, &dy);
x->Print (stderr);
fprintf (stderr, "'; ");
fprintf (stderr, "Instance: ");
if (getName()) {
getName()->Print (stderr);
}
else {
fprintf (stderr, "<>");
}
fprintf (stderr, "\n");
fatal_error ("Channel is being probed by multiple processes!");
}
c->probe = _probe;
Expand All @@ -717,6 +731,20 @@ int ChpSim::_collect_sharedvars (Expr *e, int pc, int undo)
_probe = new WaitForOne (0);
}
if (c->probe && c->probe != _probe) {
int dy;
fprintf (stderr, "Process %s: channel `",
_proc ? _proc->getName() : "-global-");
act_connection *x = _sc->getConnFromOffset (_proc, e->u.x.val, 2, &dy);
x->Print (stderr);
fprintf (stderr, "'; ");
fprintf (stderr, "Instance: ");
if (getName()) {
getName()->Print (stderr);
}
else {
fprintf (stderr, "<>");
}
fprintf (stderr, "\n");
fatal_error ("Channel is being probed by multiple processes!");
}
c->probe = _probe;
Expand Down

0 comments on commit bf48b97

Please sign in to comment.