Commit 8f0e6bfa authored by Connor Abbott's avatar Connor Abbott

bifrost: Swap port 2 and port 3 for non-64-bit

For whatever reason, ports 2 and 3 are in a different order between
64-bit and non-64-bit register controls. I could change the 64-bit one,
but I think it makes more sense for port 2 to correspond to source 2 in
DumpSrc().
parent 804dd491
......@@ -18,8 +18,8 @@ static uint64_t bits(uint32_t word, unsigned lo, unsigned high)
struct Regs {
uint64_t uniformConst : 8;
uint64_t reg2 : 6;
uint64_t reg3 : 6;
uint64_t reg2 : 6;
uint64_t reg0 : 5;
uint64_t reg1 : 6;
uint64_t ctrl : 4;
......@@ -73,53 +73,53 @@ static RegCtrl DecodeRegCtrl(Regs regs)
switch (ctrl) {
case 1:
decoded.writeFMA = true;
decoded.fmaReg = regs.reg2;
decoded.fmaReg = regs.reg3;
break;
case 3:
decoded.writeFMA = true;
decoded.fmaReg = regs.reg2;
decoded.fmaReg = regs.reg3;
decoded.readReg2 = true;
decoded.reg2 = regs.reg3;
decoded.reg2 = regs.reg2;
break;
case 4:
decoded.readReg2 = true;
decoded.reg2 = regs.reg3;
decoded.reg2 = regs.reg2;
break;
case 5:
decoded.writeADD = true;
decoded.addReg = regs.reg2;
decoded.addReg = regs.reg3;
break;
case 6:
decoded.writeADD = true;
decoded.addReg = regs.reg2;
decoded.addReg = regs.reg3;
decoded.readReg2 = true;
decoded.reg2 = regs.reg3;
decoded.reg2 = regs.reg2;
break;
case 8:
// clause start
break;
case 9:
decoded.writeFMA = true;
decoded.fmaReg = regs.reg2;
decoded.fmaReg = regs.reg3;
// clause start
break;
case 11:
break;
case 12:
decoded.readReg2 = true;
decoded.reg2 = regs.reg3;
decoded.reg2 = regs.reg2;
// clause start
break;
case 13:
decoded.writeADD = true;
decoded.addReg = regs.reg2;
decoded.addReg = regs.reg3;
// clause start
break;
case 15:
decoded.writeFMA = true;
decoded.fmaReg = regs.reg3;
decoded.fmaReg = regs.reg2;
decoded.writeADD = true;
decoded.addReg = regs.reg2;
decoded.addReg = regs.reg3;
break;
default:
printf("# unknown reg ctrl %d\n", ctrl);
......@@ -269,7 +269,7 @@ static void DumpRegs(RegCtrl ctrl)
printf("port 1: R%d ", ctrl.reg1);
if (ctrl.readReg2)
printf("port 2/3: R%d ", ctrl.reg2);
printf("port 2: R%d ", ctrl.reg2);
if (ctrl.writeFMA)
printf("FMA: R%d ", ctrl.fmaReg);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment