From: Adam Megacz Date: Tue, 24 Mar 2009 18:29:35 +0000 (+0000) Subject: clean up InstructionStopper.fill(BitVector) X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9bdf8fe9a109e1e671fdeb972c3ec7005ad1c0bb;p=fleet.git clean up InstructionStopper.fill(BitVector) --- diff --git a/testCode/com/sun/vlsi/chips/marina/test/InstructionStopper.java b/testCode/com/sun/vlsi/chips/marina/test/InstructionStopper.java index 1090911..be47309 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/InstructionStopper.java +++ b/testCode/com/sun/vlsi/chips/marina/test/InstructionStopper.java @@ -28,23 +28,15 @@ public class InstructionStopper extends ProperStopper { super(propInst, controlChain, dataChain, reportChain, cc, model, clockHack, indenter); } - @Override public void fill(BitVector instr) { - // allow user to pass in complete item: data + token + addr - if (instr.getNumBits()==(37+1+14)) {super.fill(instr); return;} - - int n = instr.getNumBits(); - fatal(n!=INSTRUCTION_LENGTH, "InstructionStopper.fill: wrong num bits: "+n+", expect: "+INSTRUCTION_LENGTH); - fatal(INSTRUCTION_LENGTH>37, "Instructions can't be more than 37 bits"); - if (INSTRUCTION_LENGTH<37) { + if (instr.getNumBits()==MarinaPacket.PACKET_WIDTH) { + super.fill(instr); + } else { + MarinaUtils.expectLength(instr, INSTRUCTION_LENGTH); BitVector pad = new BitVector(37-INSTRUCTION_LENGTH, "pad"); pad.setFromLong(0); - instr = instr.cat(pad); + super.fill(new MarinaPacket(instr.cat(pad), false)); } - BitVector t = new BitVector(1, "token"); t.setFromLong(1); - BitVector a = new BitVector(14, "addr"); a.setFromLong(0); - //super.fill(instr.cat(t).cat(a)); - super.fill(t.cat(a).cat(instr)); } public BitVector drainNoCheck() {