Line 163... |
Line 163... |
module mkPrediction( IPrediction );
|
module mkPrediction( IPrediction );
|
|
|
//Common state
|
//Common state
|
FIFO#(EntropyDecOT) infifo <- mkSizedFIFO(prediction_infifo_size);
|
FIFO#(EntropyDecOT) infifo <- mkSizedFIFO(prediction_infifo_size);
|
FIFO#(InverseTransOT) infifo_ITB <- mkSizedFIFO(prediction_infifo_ITB_size);
|
FIFO#(InverseTransOT) infifo_ITB <- mkSizedFIFO(prediction_infifo_ITB_size);
|
FIFO#(EntropyDecOT) outfifo <- mkFIFO;
|
FIFO#(EntropyDecOT) outfifochroma <- mkFIFO;
|
|
FIFO#(EntropyDecOT) outfifoluma <- mkFIFO;
|
Reg#(Bool) passFlag <- mkReg(True);
|
Reg#(Bool) passFlag <- mkReg(True);
|
Reg#(Bit#(4)) blockNum <- mkReg(0);
|
Reg#(Bit#(4)) blockNum <- mkReg(0);
|
Reg#(Bit#(4)) pixelNum <- mkReg(0);
|
Reg#(Bit#(4)) pixelNum <- mkReg(0);
|
|
|
Reg#(Bit#(PicWidthSz)) picWidth <- mkReg(maxPicWidthInMB);
|
Reg#(Bit#(PicWidthSz)) picWidth <- mkReg(maxPicWidthInMB);
|
Line 195... |
Line 196... |
Reg#(Bit#(PicAreaSz)) interPskipCount <- mkReg(0);
|
Reg#(Bit#(PicAreaSz)) interPskipCount <- mkReg(0);
|
Reg#(Vector#(5,InterBlockMv)) interTopVal <- mkRegU();
|
Reg#(Vector#(5,InterBlockMv)) interTopVal <- mkRegU();
|
Reg#(Vector#(4,InterBlockMv)) interLeftVal <- mkRegU();
|
Reg#(Vector#(4,InterBlockMv)) interLeftVal <- mkRegU();
|
Reg#(Vector#(4,InterBlockMv)) interTopLeftVal <- mkRegU();
|
Reg#(Vector#(4,InterBlockMv)) interTopLeftVal <- mkRegU();
|
FIFO#(MemReq#(TAdd#(PicWidthSz,2),32)) interMemReqQ <- mkFIFO;
|
FIFO#(MemReq#(TAdd#(PicWidthSz,2),32)) interMemReqQ <- mkFIFO;
|
|
|
Reg#(MemReq#(TAdd#(PicWidthSz,2),32)) interMemReqQdelay <- mkRegU();
|
Reg#(MemReq#(TAdd#(PicWidthSz,2),32)) interMemReqQdelay <- mkRegU();
|
FIFO#(MemResp#(32)) interMemRespQ <- mkFIFO;
|
FIFO#(MemResp#(32)) interMemRespQ <- mkFIFO;
|
Reg#(Bit#(3)) interReqCount <- mkReg(0);
|
Reg#(Bit#(3)) interReqCount <- mkReg(0);
|
Reg#(Bit#(3)) interRespCount <- mkReg(0);
|
Reg#(Bit#(3)) interRespCount <- mkReg(0);
|
|
|
Line 211... |
Line 213... |
RFile1#(Bit#(4),Tuple2#(Bit#(14),Bit#(12))) interMvFile <- mkRFile1Full();
|
RFile1#(Bit#(4),Tuple2#(Bit#(14),Bit#(12))) interMvFile <- mkRFile1Full();
|
Reg#(Bit#(15)) interMvDiffTemp <- mkReg(0);
|
Reg#(Bit#(15)) interMvDiffTemp <- mkReg(0);
|
FIFO#(Tuple2#(Bit#(15),Bit#(13))) interMvDiff <- mkFIFO;
|
FIFO#(Tuple2#(Bit#(15),Bit#(13))) interMvDiff <- mkFIFO;
|
Reg#(Bit#(5)) interNewestMv <- mkReg(0);
|
Reg#(Bit#(5)) interNewestMv <- mkReg(0);
|
|
|
|
|
// Registers for pipelining the interStage rule
|
// Registers for pipelining the interStage rule
|
|
|
Reg#(Bit#(3)) partWidthR <- mkRegU();
|
Reg#(Bit#(3)) partWidthR <- mkRegU();
|
Reg#(Bit#(3)) partHeightR <- mkRegU();
|
Reg#(Bit#(3)) partHeightR <- mkRegU();
|
Reg#(Bit#(3)) numPartR <- mkRegU();
|
Reg#(Bit#(3)) numPartR <- mkRegU();
|
Line 238... |
Line 241... |
Reg#(Vector#(4,Bool)) interTopNonZeroTransCoeff <- mkRegU();
|
Reg#(Vector#(4,Bool)) interTopNonZeroTransCoeff <- mkRegU();
|
Reg#(Vector#(4,Bool)) interLeftNonZeroTransCoeff <- mkRegU();
|
Reg#(Vector#(4,Bool)) interLeftNonZeroTransCoeff <- mkRegU();
|
FIFO#(Tuple2#(Bit#(2),Bit#(2))) interBSfifo <- mkSizedFIFO(32);
|
FIFO#(Tuple2#(Bit#(2),Bit#(2))) interBSfifo <- mkSizedFIFO(32);
|
Reg#(Bool) interBSoutput <- mkReg(True);
|
Reg#(Bool) interBSoutput <- mkReg(True);
|
FIFO#(InterBlockMv) interOutBlockMvfifo <- mkSizedFIFO(8);
|
FIFO#(InterBlockMv) interOutBlockMvfifo <- mkSizedFIFO(8);
|
|
FIFO#(ChromaFlag) memReqTypeFIFO <- mkSizedFIFO(32);
|
|
|
|
|
//Intra state
|
//Intra state
|
Reg#(IntraState) intrastate <- mkReg(Start);
|
Reg#(IntraState) intrastate <- mkReg(Start);
|
Reg#(Bit#(1)) intraChromaFlag <- mkReg(0);
|
Reg#(Bit#(1)) intraChromaFlag <- mkReg(0);
|
Line 303... |
Line 307... |
$display( "Trace Prediction: passing infifo packed %h", pack(infifo.first()));
|
$display( "Trace Prediction: passing infifo packed %h", pack(infifo.first()));
|
case (infifo.first()) matches
|
case (infifo.first()) matches
|
tagged NewUnit . xdata :
|
tagged NewUnit . xdata :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifoluma.enq(infifo.first());
|
|
outfifochroma.enq(infifo.first());
|
$display("ccl4newunit");
|
$display("ccl4newunit");
|
$display("ccl4rbspbyte %h", xdata);
|
$display("ccl4rbspbyte %h", xdata);
|
end
|
end
|
tagged SPSpic_width_in_mbs .xdata :
|
tagged SPSpic_width_in_mbs .xdata :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifoluma.enq(infifo.first());
|
|
outfifochroma.enq(infifo.first());
|
picWidth <= xdata;
|
picWidth <= xdata;
|
interpolator.setPicWidth(xdata);
|
interpolator.setPicWidth(xdata);
|
end
|
end
|
tagged SPSpic_height_in_map_units .xdata :
|
tagged SPSpic_height_in_map_units .xdata :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifoluma.enq(infifo.first());
|
|
outfifochroma.enq(infifo.first());
|
picHeight <= xdata;
|
picHeight <= xdata;
|
interpolator.setPicHeight(xdata);
|
interpolator.setPicHeight(xdata);
|
end
|
end
|
tagged PPSconstrained_intra_pred_flag .xdata :
|
tagged PPSconstrained_intra_pred_flag .xdata :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
////outfifo.enq(infifo.first());
|
|
ppsconstrained_intra_pred_flag <= xdata;
|
ppsconstrained_intra_pred_flag <= xdata;
|
end
|
end
|
tagged SHfirst_mb_in_slice .xdata :
|
tagged SHfirst_mb_in_slice .xdata :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifoluma.enq(infifo.first());
|
|
outfifochroma.enq(infifo.first());
|
firstMb <= xdata;
|
firstMb <= xdata;
|
currMb <= xdata;
|
currMb <= xdata;
|
currMbHor <= xdata;
|
currMbHor <= xdata;
|
currMbVer <= 0;
|
currMbVer <= 0;
|
intra4x4typeLeft <= replicate(15);
|
intra4x4typeLeft <= replicate(15);
|
Line 346... |
Line 353... |
tagged SDmb_skip_run .xdata : passFlag <= False;
|
tagged SDmb_skip_run .xdata : passFlag <= False;
|
tagged SDMmbtype .xdata : passFlag <= False;
|
tagged SDMmbtype .xdata : passFlag <= False;
|
tagged EndOfFile :
|
tagged EndOfFile :
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifochroma.enq(infifo.first());
|
|
outfifoluma.enq(infifo.first());
|
$display( "INFO Prediction: EndOfFile reached" );
|
$display( "INFO Prediction: EndOfFile reached" );
|
//$finish(0);////////////////////////////////
|
//$finish(0);////////////////////////////////
|
end
|
end
|
default:
|
default:
|
begin
|
begin
|
infifo.deq();
|
infifo.deq();
|
outfifo.enq(infifo.first());
|
outfifoluma.enq(infifo.first());
|
|
outfifochroma.enq(infifo.first());
|
end
|
end
|
endcase
|
endcase
|
endrule
|
endrule
|
|
|
|
|
Line 565... |
Line 574... |
if(outFirstQPFlag)
|
if(outFirstQPFlag)
|
begin
|
begin
|
if(infifo_ITB.first() matches tagged IBTmb_qp .xdata)
|
if(infifo_ITB.first() matches tagged IBTmb_qp .xdata)
|
begin
|
begin
|
infifo_ITB.deq();
|
infifo_ITB.deq();
|
outfifo.enq(IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
outfifoluma.enq(IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
|
outfifochroma.enq(IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
outFirstQPFlag <= False;
|
outFirstQPFlag <= False;
|
$display( "Trace Prediction: outputing outFirstQP %h %h %h", outBlockNum, outPixelNum, xdata);
|
$display( "Trace Prediction: outputing outFirstQP %h %h %h", outBlockNum, outPixelNum, xdata);
|
end
|
end
|
else
|
else
|
$display( "ERROR Prediction: outputing unexpected infifo_ITB.first()");
|
$display( "ERROR Prediction: outputing unexpected infifo_ITB.first()");
|
Line 582... |
Line 592... |
interBSfifo.deq();
|
interBSfifo.deq();
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : (interLeftNonZeroTransCoeff[blockVer] ? 2 : zeroExtend(tempHorBS)));
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : (interLeftNonZeroTransCoeff[blockVer] ? 2 : zeroExtend(tempHorBS)));
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : (interTopNonZeroTransCoeff[blockHor]&&blockVer!=0 ? 2 : zeroExtend(tempVerBS)));
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : (interTopNonZeroTransCoeff[blockHor]&&blockVer!=0 ? 2 : zeroExtend(tempVerBS)));
|
outfifo.enq(PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
outfifoluma.enq(PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
|
outfifochroma.enq(PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, False);
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, False);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
|
$display( "Trace Prediction: outputing SkipMB bS %h %h %h %h", outBlockNum, outPixelNum, currMbHor, currMbVer);
|
$display( "Trace Prediction: outputing SkipMB bS %h %h %h %h", outBlockNum, outPixelNum, currMbHor, currMbVer);
|
end
|
end
|
else
|
else
|
begin
|
begin
|
interBSoutput <= True;
|
interBSoutput <= True;
|
outputVector = predictedfifo.first();
|
outputVector = predictedfifo.first();
|
outfifo.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
|
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
outputFlag = 1;
|
outputFlag = 1;
|
predictedfifo.deq();
|
predictedfifo.deq();
|
$display( "Trace Prediction: outputing SkipMB out %h %h %h", outBlockNum, outPixelNum, outputVector);
|
$display( "Trace Prediction: outputing SkipMB out %h %h %h", outBlockNum, outPixelNum, outputVector);
|
end
|
end
|
end
|
end
|
Line 603... |
Line 615... |
begin
|
begin
|
case ( infifo_ITB.first() ) matches
|
case ( infifo_ITB.first() ) matches
|
tagged IBTmb_qp .xdata :
|
tagged IBTmb_qp .xdata :
|
begin
|
begin
|
infifo_ITB.deq();
|
infifo_ITB.deq();
|
outfifo.enq(tagged IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
outfifoluma.enq(tagged IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
|
outfifochroma.enq(tagged IBTmb_qp {qpy:xdata.qpy,qpc:xdata.qpc});
|
outFirstQPFlag <= False;
|
outFirstQPFlag <= False;
|
$display( "Trace Prediction: outputing ITBmb_qp %h %h %h", outBlockNum, outPixelNum, xdata);
|
$display( "Trace Prediction: outputing ITBmb_qp %h %h %h", outBlockNum, outPixelNum, xdata);
|
end
|
end
|
tagged ITBresidual .xdata :
|
tagged ITBresidual .xdata :
|
begin
|
begin
|
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
|
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
|
begin
|
begin
|
interBSoutput <= False;
|
interBSoutput <= False;
|
if(outstatefifo.first() != Inter)
|
if(outstatefifo.first() != Inter)
|
outfifo.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
begin
|
|
outfifoluma.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
|
outfifochroma.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
|
end
|
else
|
else
|
begin
|
begin
|
interBSfifo.deq();
|
interBSfifo.deq();
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : 2);
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : 2);
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : 2);
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : 2);
|
outfifo.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
outfifoluma.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
|
outfifochroma.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
end
|
end
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, True);
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, True);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, True);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, True);
|
$display( "Trace Prediction: outputing ITBresidual bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
|
$display( "Trace Prediction: outputing ITBresidual bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
|
end
|
end
|
Line 641... |
Line 658... |
else if(tempOutputValue[9:0] > 255)
|
else if(tempOutputValue[9:0] > 255)
|
outputVector[ii] = 255;
|
outputVector[ii] = 255;
|
else
|
else
|
outputVector[ii] = tempOutputValue[7:0];
|
outputVector[ii] = tempOutputValue[7:0];
|
end
|
end
|
outfifo.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
|
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
infifo_ITB.deq();
|
infifo_ITB.deq();
|
predictedfifo.deq();
|
predictedfifo.deq();
|
outputFlag = 1;
|
outputFlag = 1;
|
$display( "Trace Prediction: outputing ITBresidual out %h %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), xdata, outputVector);
|
$display( "Trace Prediction: outputing ITBresidual out %h %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), xdata, outputVector);
|
end
|
end
|
Line 654... |
Line 672... |
begin
|
begin
|
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
|
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
|
begin
|
begin
|
interBSoutput <= False;
|
interBSoutput <= False;
|
if(outstatefifo.first() != Inter)
|
if(outstatefifo.first() != Inter)
|
outfifo.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
begin
|
|
outfifoluma.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
|
outfifochroma.enq(tagged PBbS {bShor:(blockHor==0 ? 4 : 3),bSver:(blockVer==0 ? 4 : 3),blockNum: outBlockNum});
|
|
end
|
else
|
else
|
begin
|
begin
|
interBSfifo.deq();
|
interBSfifo.deq();
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempHorBS = tpl_1(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(2) tempVerBS = tpl_2(interBSfifo.first());
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : (interLeftNonZeroTransCoeff[blockVer] ? 2 : zeroExtend(tempHorBS)));
|
Bit#(3) horBS = (tempHorBS==3 ? 4 : (interLeftNonZeroTransCoeff[blockVer] ? 2 : zeroExtend(tempHorBS)));
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : (interTopNonZeroTransCoeff[blockHor]&&blockVer!=0 ? 2 : zeroExtend(tempVerBS)));
|
Bit#(3) verBS = (tempVerBS==3 ? 4 : (interTopNonZeroTransCoeff[blockHor]&&blockVer!=0 ? 2 : zeroExtend(tempVerBS)));
|
outfifo.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
outfifoluma.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
|
outfifochroma.enq(tagged PBbS {bShor:horBS,bSver:verBS,blockNum: outBlockNum});
|
end
|
end
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, False);
|
interLeftNonZeroTransCoeff <= update(interLeftNonZeroTransCoeff, blockVer, False);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
|
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
|
$display( "Trace Prediction: outputing ITBcoeffLevelZeros bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
|
$display( "Trace Prediction: outputing ITBcoeffLevelZeros bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
|
end
|
end
|
Line 674... |
Line 696... |
begin
|
begin
|
interBSoutput <= True;
|
interBSoutput <= True;
|
if(outPixelNum == 12)
|
if(outPixelNum == 12)
|
infifo_ITB.deq();
|
infifo_ITB.deq();
|
outputVector = predictedfifo.first();
|
outputVector = predictedfifo.first();
|
outfifo.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
|
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
|
outputFlag = 1;
|
outputFlag = 1;
|
predictedfifo.deq();
|
predictedfifo.deq();
|
$display( "Trace Prediction: outputing ITBcoeffLevelZeros out %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), outputVector);
|
$display( "Trace Prediction: outputing ITBcoeffLevelZeros out %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), outputVector);
|
end
|
end
|
end
|
end
|
Line 1366... |
Line 1389... |
interIPMbPartNumTemp = interIPMbPartNumTemp-2;
|
interIPMbPartNumTemp = interIPMbPartNumTemp-2;
|
refIndex = ((interstate==InterPskip||interstate==InterP8x8ref0) ? 0 : interRefIdxVector[interIPMbPartNumTemp]);
|
refIndex = ((interstate==InterPskip||interstate==InterP8x8ref0) ? 0 : interRefIdxVector[interIPMbPartNumTemp]);
|
btTemp = IP8x8;
|
btTemp = IP8x8;
|
mvhorTemp = tpl_1(interMvFile.sub({interIPMbPartNumTemp,2'b00}));
|
mvhorTemp = tpl_1(interMvFile.sub({interIPMbPartNumTemp,2'b00}));
|
mvverTemp = tpl_2(interMvFile.sub({interIPMbPartNumTemp,2'b00}));
|
mvverTemp = tpl_2(interMvFile.sub({interIPMbPartNumTemp,2'b00}));
|
|
$display("PARDEBLOCK issuing luma");
|
interpolator.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
interpolator.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
end
|
end
|
else
|
else
|
|
begin
|
|
$display("PARDEBLOCK issuing luma");
|
interpolator.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
interpolator.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
end
|
end
|
|
end
|
else
|
else
|
|
begin
|
|
$display("PARDEBLOCK issuing Chroma");
|
interpolator.request(IPChroma {refIdx:refIndex,uv:interIPStepCount[0],hor:horTemp,ver:truncate(verTemp>>1),mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
interpolator.request(IPChroma {refIdx:refIndex,uv:interIPStepCount[0],hor:horTemp,ver:truncate(verTemp>>1),mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
|
|
end
|
if(interIPSubMbPartNum >= truncate(numSubPart-1))
|
if(interIPSubMbPartNum >= truncate(numSubPart-1))
|
begin
|
begin
|
interIPSubMbPartNum <= 0;
|
interIPSubMbPartNum <= 0;
|
if(interIPMbPartNum >= truncate(numPart-1))
|
if(interIPMbPartNum >= truncate(numPart-1))
|
begin
|
begin
|
Line 1396... |
Line 1426... |
if(subMbType == 1)
|
if(subMbType == 1)
|
interIPSubMbPartNum <= 2;
|
interIPSubMbPartNum <= 2;
|
else
|
else
|
interIPSubMbPartNum <= interIPSubMbPartNum+1;
|
interIPSubMbPartNum <= interIPSubMbPartNum+1;
|
end
|
end
|
$display( "Trace Prediction: interIPProcessStep %h %h %h %h %h %h %h %h %h %h", interstate, interIPStepCount, interIPMbPartNum, interIPSubMbPartNum, refIndex, horTemp, verTemp, mvhorTemp, mvverTemp, pack(btTemp));
|
$display( "PARDEBLOCKTrace Prediction: interIPProcessStep %h %h %h %h %h %h %h %h %h %h", interstate, interIPStepCount, interIPMbPartNum, interIPSubMbPartNum, refIndex, horTemp, verTemp, mvhorTemp, mvverTemp, pack(btTemp));
|
endrule
|
endrule
|
|
|
|
|
rule interDone ( interstate!=Start && interReqCount==0 && interRespCount==0 && interStepCount==0 && interIPStepCount==0 );
|
rule interDone ( interstate!=Start && interReqCount==0 && interRespCount==0 && interStepCount==0 && interIPStepCount==0 );
|
interstate <= Start;
|
interstate <= Start;
|
Line 2270... |
Line 2300... |
endinterface
|
endinterface
|
interface Client mem_client_inter;
|
interface Client mem_client_inter;
|
interface Get request = fifoToGet(interMemReqQ);
|
interface Get request = fifoToGet(interMemReqQ);
|
interface Put response = fifoToPut(interMemRespQ);
|
interface Put response = fifoToPut(interMemRespQ);
|
endinterface
|
endinterface
|
interface Client mem_client_buffer = interpolator.mem_client;
|
|
|
interface Client mem_client_buffer;
|
|
interface Get request;
|
|
method ActionValue#(InterpolatorLoadReq) get();
|
|
InterpolatorLoadReq req <- interpolator.mem_client.request.get();
|
|
if(req matches tagged IPLoadLuma .data)
|
|
begin
|
|
memReqTypeFIFO.enq(Luma);
|
|
end
|
|
else if(req matches tagged IPLoadChroma .data)
|
|
begin
|
|
memReqTypeFIFO.enq(Chroma);
|
|
end
|
|
return req;
|
|
endmethod
|
|
endinterface
|
|
|
|
interface Put response;
|
|
method Action put(InterpolatorLoadResp resp);
|
|
memReqTypeFIFO.deq();
|
|
interpolator.mem_client.response.put(resp);
|
|
endmethod
|
|
endinterface
|
|
endinterface
|
|
|
interface Put ioin = fifoToPut(infifo);
|
interface Put ioin = fifoToPut(infifo);
|
interface Put ioin_InverseTrans = fifoToPut(infifo_ITB);
|
interface Put ioin_InverseTrans = fifoToPut(infifo_ITB);
|
interface Get ioout = fifoToGet(outfifo);
|
interface Get iooutchroma = fifoToGet(outfifoluma);
|
|
interface Get iooutluma = fifoToGet(outfifochroma);
|
|
|
endmodule
|
endmodule
|
|
|
endpackage
|
endpackage
|