-ship: Alu2
+ship: Alu
== Ports ===========================================================
data in: in1
== TeX ==============================================================
-{\tt Alu2} is a ``two-input'' arithmetic logic unit. It includes
+{\tt Alu} is a ``two-input'' arithmetic logic unit. It includes
logic for performing arithmetic operations on a pair of arguments.
Currently this includes
addition ({\sc add}),
// FIXME: need test for ADD carry-out c-flag
#ship debug : Debug
-#ship alu : Alu2
+#ship alu : Alu
#expect 17
#expect 1
set ilc=4;
collect, send to debug.in;
alu.inOp:
- set word= Alu2.inOp[ADD]; deliver;
- set word= Alu2.inOp[SUB]; deliver;
- set word= Alu2.inOp[IN1]; deliver;
- set word= Alu2.inOp[IN2]; deliver;
+ set word= Alu.inOp[ADD]; deliver;
+ set word= Alu.inOp[SUB]; deliver;
+ set word= Alu.inOp[IN1]; deliver;
+ set word= Alu.inOp[IN2]; deliver;
alu.inOp:
- set word= Alu2.inOp[MIN]; deliver;
- set word= Alu2.inOp[MAX]; deliver;
- set word= Alu2.inOp[CMP]; deliver;
- set word= Alu2.inOp[CMP]; deliver;
+ set word= Alu.inOp[MIN]; deliver;
+ set word= Alu.inOp[MAX]; deliver;
+ set word= Alu.inOp[CMP]; deliver;
+ set word= Alu.inOp[CMP]; deliver;
alu.out:
collect, send to debug.in; // MIN
// ships required in order to run this code
#ship debug : Debug
#ship csa : CarrySaveAdder
-#ship alu : Alu2
+#ship alu : Alu
#ship fifo : Fifo
fifo.in:
alu.in1: set ilc=4; recv, deliver;
alu.in2: set ilc=4; recv, deliver;
alu.inOp:
- set word=Alu2.inOp[ADD];
+ set word=Alu.inOp[ADD];
set ilc=4; deliver;
alu.out:
collect, send to alu.in1;
#ship debug : Debug
#ship lut : Lut3
-#ship alu : Alu2
+#ship alu : Alu
lut.in1: set word= 85; set ilc=*; deliver;
lut.in2: set word= 51; set ilc=*; deliver;
set word= 1;
set ilc=*; deliver;
alu.inOp:
- set word= Alu2.inOp[ADD];
+ set word= Alu.inOp[ADD];
set ilc=*; deliver;
alu.in1:
set word= 0;
public static void main(String[] s) {
Fleet fleet = new Interpreter(new String[] {
- "Alu2",
+ "alu2",
"Debug"
},
/* logging */ true);
- Ship alu = fleet.getShip("Alu2", 0);
+ Ship alu = fleet.getShip("alu2", 0);
Ship debug = fleet.getShip("Debug", 0);
Dock debugIn = debug.getDock("in");
public static void main(String[] s) {
Fleet fleet = new Interpreter(new String[] {
- "Alu2",
+ "alu2",
"Debug"
},
/* logging */ true);
- Ship alu = fleet.getShip("Alu2", 0);
+ Ship alu = fleet.getShip("alu2", 0);
Ship debug = fleet.getShip("Debug", 0);
Dock debugIn = debug.getDock("in");
public static void main(String[] s) {
Fleet fleet = new Interpreter(new String[] {
- "Alu2",
+ "alu2",
"Fifo",
"Debug"
},
/* logging */ true);
- Ship alu = fleet.getShip("Alu2", 0);
+ Ship alu = fleet.getShip("alu2", 0);
Ship debug = fleet.getShip("Debug", 0);
Ship fifo = fleet.getShip("Fifo", 0);
Dock debugIn = debug.getDock("in");
for(int i=0; i<LANES; i++) {
createShip("Fifo", "fifo"+i);
- createShip("Alu2", "alu"+i);
+ createShip("Alu", "alu"+i);
}
createShip("Rotator", "rotator");
createShip("Lut3", "lut");
this.opcode = opcode;
}
public Dock[] _setInputs() {
- if (alu == null) alu = allocate("Alu2");
+ if (alu == null) alu = allocate("alu2");
return new Dock[] { alu.getDock("out") };
}
public void emitPrologue(ArrayList<Instruction> il) {
this.incr = incr;
}
public Dock[] _setInputs() {
- if (alu == null) alu = allocate("Alu2");
+ if (alu == null) alu = allocate("alu2");
return new Dock[] { alu.getDock("out") };
}
public void emitPrologue(ArrayList<Instruction> il) {
this.max = max;
}
public Dock[] _setInputs() {
- if (alu == null) alu = allocate("Alu2");
+ if (alu == null) alu = allocate("alu2");
return new Dock[] { alu.getDock("out") };
}
public void emitPrologue(ArrayList<Instruction> il) {
"Fifo", "Fifo",
"Fifo", "Fifo",
"Fifo", "Fifo",
- "Alu2", "Alu2",
- "Alu2", "Alu2",
- "Alu2", "Alu2",
- "Alu2", "Alu2",
- "Alu2", "Alu2",
- "Alu2", "Alu2",
+ "alu2", "alu2",
+ "alu2", "alu2",
+ "alu2", "alu2",
+ "alu2", "alu2",
+ "alu2", "alu2",
+ "alu2", "alu2",
"Video"
}, false));
#expect 2
#ship debug : Debug
-#ship alu : Alu2
+#ship alu : Alu
// attempts to get tokens to "collide" in the switch fabric
#ship debug0 : Debug
#ship fifo0 : Fifo
#ship fifo1 : Fifo
-#ship alu20 : Alu2
-#ship alu21 : Alu2
+#ship alu20 : Alu
+#ship alu21 : Alu
fifo0.out: set olc=1;
#expect 42
#expect 46
-#ship alu : Alu2
+#ship alu : Alu
#ship debug : Debug
-alu.inOp: set word= Alu2.inOp[ADD];
+alu.inOp: set word=Alu.inOp[ADD];
set ilc=*; deliver;
debug.in: set ilc=*; recv, deliver, send token to alu.out;