/** dispatch a word to a given destination; may be buffered */
public abstract void sendWord(Destination d, BitVector word);
+ /** dispatch a word to a given destination; may be buffered */
+ public abstract void sendWord(Destination d, BitVector word, BitVector signal);
+
+ /** convenience method: sends the word to d's data destination */
+ public void sendWord(Dock d, BitVector word) { sendWord(d.getDataDestination(), word); }
+
/** dispatch a token to a given destination; may be buffered */
public abstract void sendToken(Destination d);
+ /** convenience method: sends a token to d's data destination */
+ public void sendToken(Dock d) { sendToken(d.getDataDestination()); }
+
+ /** convenience method: sends a token to d's instruction destination */
+ public void sendTorpedo(Dock d) { sendToken(d.getInstructionDestination()); }
+
/** flush all instructions, words, and tokens dispatched so far */
public abstract void flush();
flush();
}
- public void sendToken(Destination d) { sendWord(d, new BitVector(fpga.getWordWidth()), true); }
- public void sendWord(Destination d, BitVector word) { sendWord(d, word, false); }
- private void sendWord(Destination d, BitVector word, boolean token) {
+ public void sendToken(Destination d) { sendWord(d, new BitVector(fpga.getWordWidth()), null, true); }
+ public void sendWord(Destination d, BitVector word) { sendWord(d, word, null, false); }
+ public void sendWord(Destination d, BitVector word, BitVector signal) { sendWord(d, word, signal, false); }
+ private void sendWord(Destination d, BitVector word, BitVector signal, boolean token) {
try {
Dock dispatchFrom = fpga.debugShip.getDock("in");
long out = 0;
out = fpga.PACKET_DATA.setval(out, word);
out = fpga.PACKET_TOKEN.setval(out, token ? 1 : 0);
- out = fpga.PACKET_SIGNAL.setval(out, 0);
+ if (signal==null)
+ out = fpga.PACKET_SIGNAL.setval(out, 0);
+ else
+ out = fpga.PACKET_SIGNAL.setval(out, signal);
out = fpga.PACKET_DEST.setval(out, ((FpgaPath)dispatchFrom.getPath(d, null)).toLong());
synchronized(this) {
for(int i=9; i>=0; i--)
public class InterpreterProcess extends FleetProcess implements Runnable {
private Instruction[] instructions;
- public synchronized void sendWord(Destination d, BitVector word) {
- InterpreterPath path = (InterpreterPath)debugShip.getDock("in").getPath(d, new BitVector(1));
+ public synchronized void sendWord(Destination d, BitVector word) { sendWord(d, word, null); }
+ public synchronized void sendWord(Destination d, BitVector word, BitVector signal) {
+ InterpreterPath path = (InterpreterPath)debugShip.getDock("in").getPath(d, signal==null?new BitVector(1):signal);
((InterpreterDestination)d).
addDataFromFabric(new Packet(path, word, false));
}