Skip to content

Commit

Permalink
Fixed bug in FSM.
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk committed Apr 28, 2020
1 parent 738715b commit f406c91
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cells/fsm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ export const FSM = Box.define('FSM', {
}
}
const trans = next_trans();
this.set('next_trans', trans.id);
if (!trans) return { out: Vector3vl.xes(bits.out) };
else return { out: trans.get('ctrlOut') };
if (!trans) {
this.set('next_trans', undefined);
return { out: Vector3vl.xes(bits.out) };
} else {
this.set('next_trans', trans.id);
return { out: trans.get('ctrlOut') };
}
},
gateParams: Box.prototype.gateParams.concat(['bits', 'polarity', 'wirename', 'states', 'init_state', 'trans_table'])
});
Expand Down

0 comments on commit f406c91

Please # to comment.