CodeBag baseCodeBag = new CodeBag();
CodeBag rootCodeBag = new CodeBag();
skip = false;
- Dock dock = null;
- if (fleet instanceof Fpga) {
- dock = ((Fpga)fleet).getUniversalSource();
- } else {
- dock = ((Interpreter)fleet).getUniversalSource();
- }
- //baseCodeBag.add(new Set(dock, false, IgnoreOLC, SetDest.DataLatch, (rootCodeBag.getFakeAddress())), true);
Tree<String> parsed = (Tree<String>)parseIt(r);
walk(parsed, rootCodeBag);
ArrayList<Instruction> ret = new ArrayList<Instruction>();
Fleet fpga = fleet;
- Dock us = null;
- if (fleet instanceof Fpga) {
- us = ((Fpga)fleet).getUniversalSource();
- } else {
- us = ((Interpreter)fleet).getUniversalSource();
- }
-
Dock inAddrWrite = null;
Dock inDataWrite = null;
Dock inCBD = null;
}
for(int i=0; i<instructions.length; i++) {
- Instruction inst = instructions[i];
- /*
- if (i==0) {
- long lit = ((Instruction.Set)inst).immediate;
- long offset = (lit >> 6) & ~(-1L << 10);
- long size = (lit >> 0) & ~(-1L << 6);
- //startcbd = (offset << 6) | size;
- size = 0;
- offset = 0;
- continue;
- }
- */
- long lit = ((Fpga)fpga).writeInstruction(instructions[i], us);
+ long lit = ((Fpga)fpga).writeInstruction(instructions[i], out);
ret.add(discard(out));
ret.add(new Instruction.Shift(inDataWrite, false, IgnoreOLC, new BitVector(fpga.getWordWidth()).set(getField(36, 19, lit))));
ret.add(new Instruction.Shift(inDataWrite, false, IgnoreOLC, new BitVector(fpga.getWordWidth()).set(getField(18, 0, lit))));
DataOutputStream dos = new DataOutputStream(os);
for(Instruction inst : instructions)
- fpga.writeInstruction(dos, fpga.getUniversalSource(), inst);
+ fpga.writeInstruction(dos, fpga.debugShip.getDock("in"), inst);
dos.flush();
final InputStream is = new BufferedInputStream(s.getInputStream());
// FIXME this should use a BitVector not a long!
protected abstract Path getPathByAddr(Dock source, long dest);
- /** FIXME: this is a hack for now */
- protected abstract Dock getUniversalSource();
-
/** read a machine-formatted instruction from a file (into a Java object) */
public Instruction readInstruction(DataInputStream is, Dock dispatchFrom) throws IOException {
long inst = 0;
}
public Instruction readInstruction(long inst, Dock dispatchFrom) {
- Dock dock = getPathByAddr(getUniversalSource(), DISPATCH_PATH.getval(inst)).getDestination().getDock();
+ Dock dock = getPathByAddr(dispatchFrom, DISPATCH_PATH.getval(inst)).getDestination().getDock();
if (TAIL.get(inst)) return new Tail(dock);
long instr = 0;
if (d.dock != null)
- instr = DISPATCH_PATH.setval(instr, getDestAddr(getUniversalSource().getPath(d.dock.getInstructionDestination(),null)));
+ instr = DISPATCH_PATH.setval(instr, getDestAddr(dispatchFrom.getPath(d.dock.getInstructionDestination(),null)));
boolean dl = false;
Instruction pi = d;