Skip to content

Commit

Permalink
Keep track of rows processed
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-g committed Aug 30, 2015
1 parent 8927d8f commit cc705b4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ private enum Mode {
private final DFEsmStateValue readEnableData, readMaskData, rowFinishedData, rowLengthData;
private final DFEsmStateValue cycleCounter;
private final DFEsmStateValue firstReadPosition;
private final DFEsmStateValue rowsProcessed;

private final DFEsmStateValue crtPos, toread, iLengthRead;
private final int inputWidth;
Expand All @@ -45,6 +46,7 @@ public ParallelCsrReadControl(DFEManager owner, int inputWidth, boolean dbg) {
oFirstReadPosition = io.pushOutput("firstReadPosition", dfeUInt(32), 1);

cycleCounter = state.value(dfeInt(32), 0);
rowsProcessed = state.value(dfeInt(32), 0);
crtPos = state.value(dfeUInt(32), 0);
firstReadPosition = state.value(dfeUInt(32), 0);
toread = state.value(dfeUInt(32), 0);
Expand Down Expand Up @@ -85,6 +87,7 @@ protected void nextState() {
cycleCounter.next <== 0;
firstReadPosition.next <== crtPos;
readMaskOutValid.next <== true;
rowsProcessed.next <== rowsProcessed + 1;
//debug.simPrintf("Empty row \n");
} ELSE {
mode.next <== Mode.OutputtingCommands;
Expand All @@ -96,6 +99,7 @@ protected void nextState() {
}
CASE (Mode.OutputtingCommands) {
IF (outputNotStall()) {
rowsProcessed.next <== rowsProcessed + 1;
readMaskOutValid.next <== true;

DFEsmAssignableValue canread = assignable.value(dfeUInt(32));
Expand Down Expand Up @@ -173,7 +177,7 @@ protected void outputFunction() {
if (dbg)
IF (readMaskOutValid)
debug.simPrintf(
"ReadControl SM -- iLength %d, readmask: %d, readeenable: %d toread: %d, crtPos: %d, rowLength %d, rowFinished %d cycleCounter %d\n",
iLength, readMaskData, readEnableData, toread, crtPos, rowLengthData, rowFinishedData, cycleCounter);
"ReadControl SM -- rowsProcessed %d, iLength %d, readmask: %d, readeenable: %d toread: %d, crtPos: %d, rowLength %d, rowFinished %d cycleCounter %d\n",
rowsProcessed, iLength, readMaskData, readEnableData, toread, crtPos, rowLengthData, rowFinishedData, cycleCounter);
}
}

0 comments on commit cc705b4

Please sign in to comment.