Skip to content

Commit

Permalink
error message on chp/circuit concurrent drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Feb 10, 2023
1 parent 5b346e4 commit 02f6af0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ act_channel_state::act_channel_state(expr_multires &vinit)
sufrag_st = 0;
rfrag_st = 0;
rufrag_st = 0;
frag_warn = 0;
ct = NULL;
fH = NULL;
cm = NULL;
Expand Down
1 change: 1 addition & 0 deletions channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct act_channel_state {
// send_rest/recv_rest
unsigned int rfrag_st:2; // send/recv, send_up/recv_up, or
// send_rest/recv_rest
unsigned int frag_warn:1; // warning for double frag
unsigned int sufrag_st:8; // micro-state within frag state
unsigned int rufrag_st:8; // micro-state within frag state

Expand Down
28 changes: 28 additions & 0 deletions chpsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,20 @@ int ChpSim::varSend (int pc, int wakeup, int id, int off, int flavor,
}

if (c->fragmented) {
if (c->rfrag_st != 0 && !c->frag_warn) {
int dy;
ActId *pr;
act_connection *x = _sc->getConnFromOffset (_proc, id, 2, &dy);
msgPrefix(actsim_log_fp());
fprintf (actsim_log_fp(), "Channel has fragmented send and recv? (`");
pr = x->toid();
pr->Print (actsim_log_fp());
fprintf (actsim_log_fp(), "')\n");
msgPrefix (actsim_log_fp());
fprintf (actsim_log_fp(), "CHP+hse/circuits are driving the same end of the channel?\n");
c->frag_warn = 1;
delete pr;
}
#if 0
printf ("[send %p] fragmented; in-st: %d / %d; wake-up: %d\n", c,
c->sfrag_st, c->sufrag_st, wakeup);
Expand Down Expand Up @@ -1848,6 +1862,20 @@ int ChpSim::varRecv (int pc, int wakeup, int id, int off, int flavor,


if (c->fragmented) {
if (c->sfrag_st != 0 && !c->frag_warn) {
int dy;
ActId *pr;
act_connection *x = _sc->getConnFromOffset (_proc, id, 2, &dy);
msgPrefix(actsim_log_fp());
fprintf (actsim_log_fp(), "Channel has fragmented send and recv? (`");
pr = x->toid();
pr->Print (actsim_log_fp());
fprintf (actsim_log_fp(), "')\n");
msgPrefix (actsim_log_fp());
fprintf (actsim_log_fp(), "CHP+hse/circuits are driving the same end of the channel?\n");
c->frag_warn = 1;
delete pr;
}
#if 0
printf ("[recv %p] fragmented; in-st: %d / %d\n", c,
c->rfrag_st, c->rufrag_st);
Expand Down

0 comments on commit 02f6af0

Please sign in to comment.