@@ -40,6 +40,7 @@ static void _hse_record_ids (act_channel_state *ch,
4040 if (!b) {
4141 int off;
4242 int type;
43+ bool found;
4344
4445 b = ihash_add (ch->fH , (long )ac);
4546
@@ -73,18 +74,29 @@ static void _hse_record_ids (act_channel_state *ch,
7374 ntmp = newtmp;
7475 }
7576
76- off = sc->getLocalOffset (ntmp, mysi, &type);
77- Assert (type == 0 , " HSE in channel has non-boolean ops?" );
78- if (myc != c && (off < 0 && ((-off) & 1 ))) {
77+ if (sc->hasLocalOffset (ntmp, mysi)) {
78+ off = sc->getLocalOffset (ntmp, mysi, &type);
79+ found = true ;
80+ }
81+ else {
82+ found = false ;
83+ }
84+ Assert (!found || type == 0 , " HSE in channel has non-boolean ops?" );
85+ if (found && (myc != c && (off < 0 && ((-off) & 1 )))) {
7986 stateinfo_t *saved = sc->cursi ();
8087 sc->setsi (mysi);
8188 off = myc->getGlobalOffset (off, 0 );
8289 b->i = off;
8390 sc->setsi (saved);
8491 }
8592 else {
86- off = myc->getGlobalOffset (off, 0 );
87- b->i = off;
93+ if (found) {
94+ off = myc->getGlobalOffset (off, 0 );
95+ b->i = off;
96+ }
97+ else {
98+ b->i = -1 ;
99+ }
88100 }
89101
90102 if (ntmp != ch_name) {
@@ -448,36 +460,38 @@ int ChanMethods::runMethod (ActSimCore *sim,
448460fatal_error (" %s: Internal error running method %d" , ch->ct ->getName (),
449461 idx);
450462 }
451- v = ch->_dummy ->getBool (b->i );
452- if (_ops[idx].op [from].type == CHAN_OP_BOOL_T) {
453- if (v != 1 ) {
463+ if (b->i != -1 ) {
464+ v = ch->_dummy ->getBool (b->i );
465+ if (_ops[idx].op [from].type == CHAN_OP_BOOL_T) {
466+ if (v != 1 ) {
454467#ifdef DUMP_ALL
455- printf (" nm:g#%d := 1\n " , b->i );
456- #endif
457- ch->_dummy ->setBool (b->i , 1 );
458- v = -1 ;
468+ printf (" nm:g#%d := 1\n " , b->i );
469+ #endif
470+ ch->_dummy ->setBool (b->i , 1 );
471+ v = -1 ;
472+ }
459473}
460- }
461- else {
462- if (v != 0 ) {
463- ch->_dummy ->setBool (b->i , 0 );
474+ else {
475+ if (v != 0 ) {
476+ ch->_dummy ->setBool (b->i , 0 );
464477#ifdef DUMP_ALL
465- printf (" nm:g#%d := 0\n " , b->i );
478+ printf (" nm:g#%d := 0\n " , b->i );
466479#endif
467- v = -1 ;
480+ v = -1 ;
481+ }
468482}
469- }
470- if (v == -1 ) {
471- const ActSim::watchpt_bucket *nm;
472- if ((nm = sim->chkWatchPt (0 , b->i ))) {
473- BigInt tmpv;
474- ch->_dummy ->msgPrefix ();
475- printf (" %s := %c\n " , nm->s , _ops[idx].op [from].type == CHAN_OP_BOOL_T ?
476- ' 1' : ' 0' );
477- tmpv = (_ops[idx].op [from].type == CHAN_OP_BOOL_T ? 1 : 0 );
478- sim->recordTrace (nm, 0 , ACT_CHAN_IDLE, tmpv);
483+ if (v == -1 ) {
484+ const ActSim::watchpt_bucket *nm;
485+ if ((nm = sim->chkWatchPt (0 , b->i ))) {
486+ BigInt tmpv;
487+ ch->_dummy ->msgPrefix ();
488+ printf (" %s := %c\n " , nm->s , _ops[idx].op [from].type == CHAN_OP_BOOL_T ?
489+ ' 1' : ' 0' );
490+ tmpv = (_ops[idx].op [from].type == CHAN_OP_BOOL_T ? 1 : 0 );
491+ sim->recordTrace (nm, 0 , ACT_CHAN_IDLE, tmpv);
492+ }
493+ ch->_dummy ->boolProp (b->i );
479494}
480- ch->_dummy ->boolProp (b->i );
481495 }
482496 from++;
483497 break ;
0 commit comments