Skip to content

Commit

Permalink
Redo _rdy hack for 32bit and larger correctly (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
uge authored Feb 25, 2020
1 parent 366ca1c commit 73999ce
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/ordt/output/systemverilog/decode/SystemVerilogDecodeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2344,37 +2344,37 @@ else if (ringWidth == 32) {
this.addCombinAssign(groupName, " end");
this.addCombinAssign(groupName, " end");

String finalRetCntStr = getSerialMaxDataCountStr(useTransactionSize, transactionsInWord, pioInterfaceRetTransactionSizeName);

// RES_READ - send read data
this.addCombinAssign(groupName, " " + RES_READ + ": begin // RES_READ");
this.addCombinAssign(groupName, " " + resValidDlyName[0] + " = 1'b1;"); // res is valid

this.addCombinAssign(groupName, " if ( !" + ringResRdyName + ") begin ");
this.addCombinAssign(groupName, " " + ringDataCntNextName + " = " + ringDataCntName + ";" );

this.addCombinAssign(groupName, " end else begin" );
this.addCombinAssign(groupName, " if (" + ringDataCntName + " == " + finalRetCntStr + ") " + ringStateNextName + " = " + IDLE + ";");

if (useDataCounter) {
// if final count we're done
this.addCombinAssign(groupName, " if ( !" + ringResRdyName + ") begin ");
this.addCombinAssign(groupName, " " + ringDataCntNextName + " = " + ringDataCntName + ";" );

// bump the data count
this.addCombinAssign(groupName, " " + ringDataCntNextName + " = " + ringDataCntName + " + " + maxDataXferCountBits + "'b1;");
this.addCombinAssign(groupName, " end");
this.addCombinAssign(groupName, " end else begin" );

// bump the data count
this.addCombinAssign(groupName, " " + ringDataCntNextName + " = " + ringDataCntName + " + " + maxDataXferCountBits + "'b1;");
// send the data slice while
for (int idx=0; idx<maxDataXferCount; idx++) {
prefix = (idx == 0)? "" : "else ";
this.addCombinAssign(groupName, " "+ prefix + "if (" + ringDataCntName + " == " + maxDataXferCountBits + "'d" + idx + ")");
this.addCombinAssign(groupName, " " + resDataDlyName[0] + " = " + ringRdCaptureName + SystemVerilogSignal.genRefArrayString(ringWidth*idx, ringWidth) + ";");
}

// if final count we're done
String finalRetCntStr = getSerialMaxDataCountStr(useTransactionSize, transactionsInWord, pioInterfaceRetTransactionSizeName);
this.addCombinAssign(groupName, " if (" + ringDataCntName + " == " + finalRetCntStr + ") " + ringStateNextName + " = " + IDLE + ";");
this.addCombinAssign(groupName, " end");
}
else {
this.addCombinAssign(groupName, " " + resDataDlyName[0] + " = " + ringRdCaptureName + SystemVerilogSignal.genRefArrayString(0, ringWidth) + ";");
this.addCombinAssign(groupName, " " + ringStateNextName + " = " + IDLE + ";");
this.addCombinAssign(groupName, " " + resDataDlyName[0] + " = " + ringRdCaptureName + SystemVerilogSignal.genRefArrayString(0, ringWidth) + ";");
this.addCombinAssign(groupName, " " + ringStateNextName + " = " + IDLE + ";");
}

this.addCombinAssign(groupName, " end");

// CMD_BYPASS - feed write data into bypass fifo
Expand Down

0 comments on commit 73999ce

Please sign in to comment.