OpenCores
URL https://opencores.org/ocsvn/bluespec-h264/bluespec-h264/trunk

Subversion Repositories bluespec-h264

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 90 to Rev 91
    Reverse comparison

Rev 90 → Rev 91

/trunk/build/Makefile
1,7 → 1,7
#=======================================================================
# 6.375 Makefile for bsc-compile
#-----------------------------------------------------------------------
# $Id: Makefile,v 1.12 2008-06-26 18:11:07 jamey.hicks Exp $
# $Id: Makefile,v 1.13 2008-06-26 18:11:41 jamey.hicks Exp $
#
 
default : all
33,17 → 33,17
#BSC_OPTS = -u -show-module-use -verilog -keep-fires -aggressive-conditions \
# -relax-method-earliness -relax-method-urgency -v
 
BSC_OPTS = -u -v -verilog -aggressive-conditions
SIM_OPTS = -u -v -sim -aggressive-conditions
BSC_OPTS = +RTS -K100000000 --RTS -u -v -verilog -aggressive-conditions
SIM_OPTS = +RTS -K100000000 --RTS -u -v -sim -aggressive-conditions -show-schedule
 
mainline :
$(BSC_COMP) $(BSC_OPTS) -bdir ./ -p +:$(srcdir) -g $(toplevel_module) $(srcdir)/$(toplevel_module).bsv > out.log
 
release :
$(BSC_COMP) $(BSC_OPTS) -bdir ./ -p +:$(reldir)/ -g $(toplevel_module) $(reldir)/$(toplevel_module).bsv> out.log\
$(BSC_COMP) $(SIM_OPTS) -bdir ./ -p +:$(reldir)/ -g $(toplevel_module) $(reldir)/$(toplevel_module).bsv> out.log\
 
LCP :
$(BSC_COMP) $(SIM_OPTS) -bdir ./ -p +:$(lcpdir):$(reldir)/ -g $(toplevel_module) $(reldir)/$(toplevel_module).bsv> out.log\
$(BSC_COMP) $(SIM_OPTS) -bdir ./ -p +:$(lcpdir):$(reldir)/ -g $(toplevel_module) $(lcpdir)/$(toplevel_module).bsv> out.log\
 
#--------------------------------------------------------------------
# Default make target
/trunk/LumaChromaParallel/mkPrediction.bsv
182,16 → 182,19
FIFOF#(NextOutput) nextoutputfifo <- mkFIFOF;
Reg#(Bit#(4)) outBlockNum <- mkReg(0);
Reg#(Bit#(4)) outPixelNum <- mkReg(0);
FIFO#(Vector#(4,Bit#(8))) predictedfifo <- mkSizedFIFO(prediction_predictedfifo_size);
FIFO#(Tuple3#(ChromaFlag,OutState,Vector#(4,Bit#(8)))) predictedfifoluma <- mkSizedFIFO(prediction_predictedfifo_size);
FIFO#(Tuple3#(ChromaFlag,OutState,Vector#(4,Bit#(8)))) predictedfifochroma <- mkSizedFIFO(prediction_predictedfifo_size);
Reg#(ChromaFlag) outChromaFlag <- mkReg(Luma);
Reg#(Bool) outFirstQPFlag <- mkReg(False);
 
DoNotFire donotfire <- mkDoNotFire();
//Reg#(Vector#(16,Bit#(8))) workVector <- mkRegU();
//Inter state
Interpolator interpolator <- mkInterpolator();
Interpolator interpolator_luma <- mkInterpolator();
Interpolator interpolator_chroma <- mkInterpolator();
Reg#(InterState) interstate <- mkReg(Start);
Reg#(Bit#(PicAreaSz)) interPskipCount <- mkReg(0);
Reg#(Vector#(5,InterBlockMv)) interTopVal <- mkRegU();
243,12 → 246,12
FIFO#(Tuple2#(Bit#(2),Bit#(2))) interBSfifo <- mkSizedFIFO(32);
Reg#(Bool) interBSoutput <- mkReg(True);
FIFO#(InterBlockMv) interOutBlockMvfifo <- mkSizedFIFO(8);
FIFO#(ChromaFlag) memReqTypeFIFO <- mkSizedFIFO(32);
FIFO#(InterpolatorLoadReq) interpolatorLoadReqQ <- mkFIFO;
//Intra state
Reg#(IntraState) intrastate <- mkReg(Start);
Reg#(Bit#(1)) intraChromaFlag <- mkReg(0);
Reg#(ChromaFlag) intraChromaFlag <- mkReg(Luma);
FIFO#(MemReq#(TAdd#(PicWidthSz,2),68)) intraMemReqQ <- mkFIFO;
Reg#(MemReq#(TAdd#(PicWidthSz,2),68)) intraMemReqQdelay <- mkRegU;
FIFO#(MemResp#(68)) intraMemRespQ <- mkFIFO;
292,16 → 295,38
// endrule
//////////////////////////////////////////////////////////////////////////////
 
Reg#(Bit#(64)) total_cycles <- mkReg(0);
 
 
rule incr;
total_cycles <= total_cycles + 1;
endrule
 
rule checkFIFO ( True );
$display( "Trace Prediction: checkFIFO %h", infifo.first() );
endrule
rule checkFIFO_ITB ( True );
$display( "Trace Prediction: checkFIFO_ITB %h", infifo_ITB.first() );
case ( infifo_ITB.first()) matches
tagged ITBcoeffLevelZeros: $display("Caused by ITBcoeffLevelZeros");
tagged ITBresidual .data: $display("Caused by ITBresidual");
tagged IBTmb_qp .data: $display("Caused by ITBmb_qp");
endcase
endrule
rule checkFIFO_predicted ( True );
$display( "Trace Prediction: checkFIFO_predicted %h", predictedfifo.first() );
rule checkFIFO_predictedluma ( True );
$display( "Trace Prediction: checkFIFO_predictedluma %h", predictedfifoluma.first() );
endrule
rule checkFIFO_predictedchroma ( True );
$display( "Trace Prediction: checkFIFO_predictedchroma %h", predictedfifochroma.first() );
endrule
rule checkFIFO_memreqchroma ( True );
$display( "Trace Prediction: checkFIFO_mem_req_chroma %h", interpolator_chroma.mem_request_first() );
endrule
rule checkFIFO_memreqluma ( True );
$display( "Trace Prediction: checkFIFO_mem_req_luma %h", interpolator_chroma.mem_request_first() );
endrule
 
 
rule passing ( passFlag && !outstatefifo.notEmpty() && currMbHor<zeroExtend(picWidth) );
$display( "Trace Prediction: passing infifo packed %h", pack(infifo.first()));
320,7 → 345,8
outfifoluma.enq(infifo.first());
outfifochroma.enq(infifo.first());
picWidth <= xdata;
interpolator.setPicWidth(xdata);
interpolator_luma.setPicWidth(xdata);
interpolator_chroma.setPicWidth(xdata);
end
tagged SPSpic_height_in_map_units .xdata :
begin
328,7 → 354,8
outfifoluma.enq(infifo.first());
outfifochroma.enq(infifo.first());
picHeight <= xdata;
interpolator.setPicHeight(xdata);
interpolator_luma.setPicHeight(xdata);
interpolator_chroma.setPicHeight(xdata);
end
tagged PPSconstrained_intra_pred_flag .xdata :
begin
562,8 → 589,12
endcase
endrule
 
// only 8 filter components for
// for bshor, chroma always ends in zero
// for bsver, bSfileVer.sub((chromaFlag==Luma?blockNumCols:{blockVer[0],blockHor[0],1'b0,columnNumber[1]}));
rule outputing ( currMbHor<zeroExtend(picWidth) );
match{.predictedfifo, .outfifo} = (outChromaFlag==Luma)?tuple2(predictedfifoluma, outfifoluma):
tuple2(predictedfifochroma, outfifochroma);
Bit#(1) outputFlag = 0;
Vector#(4,Bit#(8)) outputVector = replicate(0);
Bit#(2) blockHor = {outBlockNum[2],outBlockNum[0]};
570,6 → 601,7
Bit#(2) blockVer = {outBlockNum[3],outBlockNum[1]};
Bit#(2) pixelVer = {outPixelNum[3],outPixelNum[2]};
Bit#(4) totalVer = {blockVer,pixelVer};
 
$display( "bsFIFO Trace Prediction: outputing (%d,%d)", blockVer,blockHor );
if(outFirstQPFlag)
begin
584,7 → 616,8
else
$display( "ERROR Prediction: outputing unexpected infifo_ITB.first()");
end
else if(nextoutputfifo.first() == SkipMB)
else if(nextoutputfifo.first() == SkipMB) // if(!outFirstQPFlag)
// It's clear that we will first process either the nextoutputfifo or something similar
begin
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
begin
600,20 → 633,31
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
$display( "Trace Prediction: outputing SkipMB bS %h %h %h %h", outBlockNum, outPixelNum, currMbHor, currMbVer);
end
else
else // normally outputing
begin
interBSoutput <= True;
outputVector = predictedfifo.first();
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
match {.chromaFlag, .decodeType, .outputVectorTyped} = predictedfifo.first;
outputVector = outputVectorTyped;
outfifo.enq(tagged PBoutput tuple2(chromaFlag, outputVector));
predictedfifo.deq;
 
if(decodeType != outstatefifo.first)
begin
$display("Trace Prediction: ERROR! decode type is not the same as outfifo");
end
if(chromaFlag != outChromaFlag)
begin
$display("Trace Predicition ERROR! stream chroma flag not equal to outChromaFlag");
end
outputFlag = 1;
predictedfifo.deq();
$display( "Trace Prediction: outputing SkipMB out %h %h %h", outBlockNum, outPixelNum, outputVector);
 
$display( "Trace Prediction: outputing SkipMB out %h %h %h", (outChromaFlag==Luma)?"Luma":"Chroma",outBlockNum, outPixelNum, outputVector);
end
end
else
else // if(!(outFirstQPFlag || nextoutputfifo.first() == SkipMB))
begin
case ( infifo_ITB.first() ) matches
case ( infifo_ITB.first() ) matches // Perhaps this has some latency
tagged IBTmb_qp .xdata :
begin
infifo_ITB.deq();
646,13 → 690,24
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, True);
$display( "Trace Prediction: outputing ITBresidual bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
end
else
else // Normally we'd be outputing here too.
begin
interBSoutput <= True;
Bit#(11) tempOutputValue = 0;
match {.chromaFlag, .decodeType, .outputVectorTyped} = predictedfifo.first;
predictedfifo.deq;
if(decodeType != outstatefifo.first)
begin
$display("Trace Prediction: ERROR! decode type is not the same as outfifo");
end
for(Integer ii=0; ii<4; ii=ii+1)
begin
tempOutputValue = signExtend(xdata[ii]) + zeroExtend((predictedfifo.first())[ii]);
tempOutputValue = signExtend(xdata[ii]) + zeroExtend((outputVectorTyped)[ii]);
if(tempOutputValue[10]==1)
outputVector[ii] = 0;
else if(tempOutputValue[9:0] > 255)
660,17 → 715,22
else
outputVector[ii] = tempOutputValue[7:0];
end
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
outfifo.enq(tagged PBoutput tuple2(chromaFlag,outputVector));
if(chromaFlag != outChromaFlag)
begin
$display("Trace Predicition ERROR! stream chroma flag not equal to outChromaFlag");
end
outputFlag = 1;
infifo_ITB.deq();
predictedfifo.deq();
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 %s %h %h %h", (chromaFlag == Luma)?"Luma":"Chroma",outChromaFlag, outBlockNum, outPixelNum);
end
end
tagged ITBcoeffLevelZeros :
begin
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0)
if(interBSoutput && outChromaFlag==Luma && outPixelNum==0) // Appears to be an initialization thing
begin
interBSoutput <= False;
if(outstatefifo.first() != Inter)
692,17 → 752,29
interTopNonZeroTransCoeff <= update(interTopNonZeroTransCoeff, blockHor, False);
$display( "Trace Prediction: outputing ITBcoeffLevelZeros bS %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, currMbHor, currMbVer);
end
else
else // Normally, we'd be outputing here
begin
interBSoutput <= True;
if(outPixelNum == 12)
begin
infifo_ITB.deq();
outputVector = predictedfifo.first();
outfifoluma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
outfifochroma.enq(tagged PBoutput tuple2(outChromaFlag,outputVector));
end
match {.chromaFlag, .decodeType, .outputVectorTyped} = predictedfifo.first;
outputVector = outputVectorTyped;
outfifo.enq(tagged PBoutput tuple2(chromaFlag, outputVector));
predictedfifo.deq;
if(chromaFlag != outChromaFlag)
begin
$display("Trace Predicition ERROR! stream chroma flag not equal to outChromaFlag");
end
 
if(decodeType != outstatefifo.first)
begin
$display("Trace Prediction: ERROR! decode type is not the same as outfifo");
end
 
outputFlag = 1;
predictedfifo.deq();
$display( "Trace Prediction: outputing ITBcoeffLevelZeros out %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), outputVector);
$display( "Trace Prediction: outputing ITBcoeffLevelZeros %s %h %h %h", (outChromaFlag == Luma)?"Luma":"Chroma",outChromaFlag, outBlockNum, outPixelNum);
end
end
default: $display( "ERROR Prediction: outputing unknown infifo_ITB input" );
750,7 → 822,7
end
endcase
end
else
else // chroma
begin
if(outBlockNum[2]==0)
intraLeftValChroma0 <= update(intraLeftValChroma0,totalVer+1,outputVector[3]);
771,7 → 843,7
else
intra4x4typeTop <= update(intra4x4typeTop,blockHor,14);
end
else
else // Chroma stuff
begin
if(outBlockNum[2]==0)
begin
835,7 → 907,7
if(nextoutputfifo.first() == Intra4x4)
nextoutputfifo.deq();
end
else
else // Luma
begin
if(outBlockNum == 7)
begin
847,7 → 919,10
outstatefifo.deq;
intrastate <= Start;
if(truncate(currMbHor)==picWidth-1 && currMbVer==picHeight-1)
interpolator.endOfFrame();
begin
interpolator_luma.endOfFrame();
interpolator_chroma.endOfFrame();
end
nextoutputfifo.deq();
end
else
858,6 → 933,8
endrule
 
 
 
 
rule currMbHorUpdate( !(currMbHor<zeroExtend(picWidth)) );
Bit#(PicAreaSz) temp = zeroExtend(picWidth);
if((currMbHor >> 3) >= temp)
1391,19 → 1468,19
btTemp = IP8x8;
mvhorTemp = tpl_1(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});
$display("PARDEBLOCK issuing luma at %0d", total_cycles);
interpolator_luma.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
end
else
begin
$display("PARDEBLOCK issuing luma");
interpolator.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
$display("PARDEBLOCK issuing luma at %0d", total_cycles);
interpolator_luma.request(IPLuma {refIdx:refIndex,hor:horTemp,ver:verTemp,mvhor:mvhorTemp,mvver:mvverTemp,bt:btTemp});
end
end
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});
$display("PARDEBLOCK issuing Chroma at %0d", total_cycles);
interpolator_chroma.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))
begin
1437,17 → 1514,22
//$display( "Trace Prediction: interOutputTransfer %h %h", interstate, interOutputCount);
endrule
 
rule interOutputTransfer ( True );
predictedfifo.enq(interpolator.first());
interpolator.deq();
//$display( "Trace Prediction: interOutputTransfer %h %h", interstate, interOutputCount);
//Can probably just drop these rules. They don't add any value
rule interOutputTransferChroma (True);
predictedfifochroma.enq(tuple3(Chroma,Inter,interpolator_chroma.first()));
interpolator_chroma.deq();
$display( "PARDEBLOCK(%0d): Trace Prediction: interOutputTransfer %h", total_cycles, interstate);
endrule
 
 
rule interOutputTransferLuma (True);
predictedfifoluma.enq(tuple3(Luma,Inter,interpolator_luma.first()));
interpolator_luma.deq();
$display( "PARDEBLOCK(%0d):: Trace Prediction: interOutputTransfer %h", total_cycles, interstate);
endrule
 
 
// intra prediction rules
 
rule intraSendReq ( intraReqCount>0 && currMbHor<zeroExtend(picWidth) && !nextoutputfifo.notEmpty() );
Bit#(PicWidthSz) temp2 = truncate(currMbHor);
Bit#(TAdd#(PicWidthSz,2)) temp = 0;
1654,12 → 1736,12
leftAvailable = 0;
else
leftAvailable = 1;
if(blockNum==0 && pixelNum==0 && intraChromaFlag==0)
if(blockNum==0 && pixelNum==0 && intraChromaFlag==Luma)
begin
intraChromaTopAvailable <= topAvailable;
intraChromaLeftAvailable <= leftAvailable;
end
if(intrastate==Intra4x4 && intraChromaFlag==0)
if(intrastate==Intra4x4 && intraChromaFlag==Luma)
begin
if(intraStepCount==2)
begin
1912,7 → 1994,7
else
$display( "ERROR Prediction: intraProcessStep intra4x4 unknown intraStepCount");
end
else if(intrastate==Intra16x16 && intraChromaFlag==0)
else if(intrastate==Intra16x16 && intraChromaFlag==Luma)
begin
//$display( "TRACE Prediction: intraProcessStep intra16x16 %0d %0d %0d %h", intra16x16_pred_mode, currMb, blockNum, select(intraTopVal,blockHor));/////////////////
case(intra16x16_pred_mode)
2082,7 → 2164,7
end
endcase
end
else if(intraChromaFlag==1)
else if(intraChromaFlag==Chroma)
begin
//$display( "TRACE Prediction: intraProcessStep intraChroma %0d %0d %0d %0d %0d %0d %h %h %h %h %h %h %h %h",intra_chroma_pred_mode.first(),intraChromaTopAvailable,intraChromaLeftAvailable,currMb,blockNum,pixelNum,pack(intraLeftValChroma0),pack(intraTopValChroma0),pack(intraLeftValChroma1),pack(intraTopValChroma1),intraLeftValChroma0[0],intraTopValChroma0[3][15:8],intraLeftValChroma1[0],intraTopValChroma1[3][15:8]);///////////////////
Vector#(9,Bit#(8)) tempLeftVec;
2252,16 → 2334,23
 
if(outFlag==1)
begin
predictedfifo.enq(predVector);
if(intraChromaFlag == Luma)
begin
predictedfifoluma.enq(tuple3(intraChromaFlag,(intrastate==Intra4x4)?Intra4x4:Intra,predVector));
end
else
begin
predictedfifochroma.enq(tuple3(intraChromaFlag,(intrastate==Intra4x4)?Intra4x4:Intra,predVector));
end
pixelNum <= pixelNum+4;
if(pixelNum == 12)
begin
if(intraChromaFlag==0)
if(intraChromaFlag==Luma)
begin
blockNum <= blockNum+1;
if(blockNum == 15)
begin
intraChromaFlag <= 1;
intraChromaFlag <= Chroma;
intraStepCount <= 2;
end
else if(intrastate==Intra4x4)
2272,7 → 2361,7
if(blockNum == 7)
begin
blockNum <= 0;
intraChromaFlag <= 0;
intraChromaFlag <= Luma;
intraStepCount <= 0;
intra_chroma_pred_mode.deq();
end
2291,9 → 2380,7
intraStepCount <= nextIntraStepCount;
//$display( "Trace Prediction: intraProcessStep");
endrule
 
interface Client mem_client_intra;
interface Get request = fifoToGet(intraMemReqQ);
interface Put response = fifoToPut(intraMemRespQ);
2303,34 → 2390,42
interface Put response = fifoToPut(interMemRespQ);
endinterface
 
interface Client mem_client_buffer;
interface Client mem_client_buffer_luma;
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;
$display("PARDEBLOCK: Pulling Luma memory request from interpolator");
interpolator_luma.mem_request_deq;
return interpolator_luma.mem_request_first;
endmethod
endinterface
interface Put response;
method Action put(InterpolatorLoadResp resp);
memReqTypeFIFO.deq();
interpolator.mem_client.response.put(resp);
interpolator_luma.mem_client_resp.put(resp);
endmethod
endinterface
endinterface
 
interface Client mem_client_buffer_chroma;
interface Get request;
method ActionValue#(InterpolatorLoadReq) get();
$display("PARDEBLOCK: Pulling Chroma memory request from interpolator");
interpolator_chroma.mem_request_deq;
return interpolator_chroma.mem_request_first;
endmethod
endinterface
interface Put response;
method Action put(InterpolatorLoadResp resp);
interpolator_chroma.mem_client_resp.put(resp);
endmethod
endinterface
endinterface
interface Put ioin = fifoToPut(infifo);
interface Put ioin_InverseTrans = fifoToPut(infifo_ITB);
interface Get iooutchroma = fifoToGet(outfifoluma);
interface Get iooutluma = fifoToGet(outfifochroma);
interface Get iooutchroma = fifoToGet(outfifochroma);
interface Get iooutluma = fifoToGet(outfifoluma);
endmodule
 
/trunk/LumaChromaParallel/IPrediction.bsv
37,14 → 37,14
// Interface for inter-module io
interface Put#(EntropyDecOT) ioin;
interface Put#(InverseTransOT) ioin_InverseTrans;
interface Get#(EntropyDecOT) iooutluma;
interface Get#(EntropyDecOT) iooutchroma;
interface Get#(EntropyDecOT) iooutluma;
 
// Interface for module to memory
interface Client#(MemReq#(TAdd#(PicWidthSz,2),68),MemResp#(68)) mem_client_intra;
interface Client#(MemReq#(TAdd#(PicWidthSz,2),32),MemResp#(32)) mem_client_inter;
interface Client#(InterpolatorLoadReq,InterpolatorLoadResp) mem_client_buffer;
 
interface Client#(InterpolatorLoadReq,InterpolatorLoadResp) mem_client_buffer_luma;
interface Client#(InterpolatorLoadReq,InterpolatorLoadResp) mem_client_buffer_chroma;
endinterface
 
endpackage
/trunk/LumaChromaParallel/mkInterpolator.bsv
30,6 → 30,7
import H264Types::*;
import IInterpolator::*;
import FIFO::*;
import FIFOF::*;
import Vector::*;
 
import Connectable::*;
120,10 → 121,17
Reg#(Bit#(2)) outBlockNum <- mkReg(0);
Reg#(Bit#(2)) outPixelNum <- mkReg(0);
Reg#(Bool) outDone <- mkReg(False);
 
Reg#(Bit#(64)) total_cycles <- mkReg(0);
 
 
rule incr;
total_cycles <= total_cycles + 1;
endrule
 
rule sendEndOfFrameReq( endOfFrameFlag );
endOfFrameFlag <= False;
$display("trace interpolator sending EndOfFrame");
memReqQ.enq(IPLoadEndFrame);
endrule
169,6 → 177,7
else
verAddr = truncate(verTemp);
end
$display("PARDEBLOCK issuing Luma memory req");
memReqQ.enq(IPLoadLuma {refIdx:reqdata.refIdx,horOutOfBounds:horOut,hor:horAddr,ver:verAddr});
Bool verFirst = twoStage || (yfracl==2&&(xfracl==1||xfracl==3));
Bit#(2) loadHorNumMax = (reqdata.bt==IP8x8||reqdata.bt==IP8x4 ? 1 : 0) + (horInter ? 2 : (offset2==0 ? 0 : 1));
235,7 → 244,7
end
if(reqdata.bt==IP16x16 || reqdata.bt==IP16x8 || reqdata.bt==IP8x16)
$display( "ERROR Interpolation: loadLuma block sizes > 8x8 not supported");
$display( "PARDEBLOCK Trace interpolator: loadLuma %h %h %h %h %h %h %h", xfracl, yfracl, loadHorNum, loadVerNum, reqdata.refIdx, horAddr, verAddr);
$display( "PARDEBLOCK Trace interpolator(%0d)): loadLuma %h %h %h %h %h %h %h", total_cycles,xfracl, yfracl, loadHorNum, loadVerNum, reqdata.refIdx, horAddr, verAddr);
endrule
 
 
274,6 → 283,7
else
verAddr = truncate(verTemp);
end
$display("PARDEBLOCK issuing Chroma memory req");
memReqQ.enq(IPLoadChroma {refIdx:reqdata.refIdx,uv:reqdata.uv,horOutOfBounds:horOut,hor:horAddr,ver:verAddr});
Bit#(2) loadHorNumMax = (reqdata.bt==IP4x8||reqdata.bt==IP4x4 ? (offset[1]==0||(xfracc==0&&offset!=3) ? 0 : 1) : ((reqdata.bt==IP16x16||reqdata.bt==IP16x8 ? 1 : 0) + (xfracc==0&&offset==0 ? 0 : 1)));
Bit#(4) loadVerNumMax = (reqdata.bt==IP16x16||reqdata.bt==IP8x16 ? 7 : (reqdata.bt==IP16x8||reqdata.bt==IP8x8||reqdata.bt==IP4x8 ? 3 : 1)) + (yfracc==0 ? 0 : 1);
290,7 → 300,7
reqfifoLoad.deq();
end
end
$display( "PARDEB Trace interpolator: loadChroma %h %h %h %h %h %h %h", xfracc, yfracc, loadHorNum, loadVerNum, reqdata.refIdx, horAddr, verAddr);
$display( "PARDEB Trace interpolator(%0d): loadChroma %h %h %h %h %h %h %h", total_cycles, xfracc, yfracc, loadHorNum, loadVerNum, reqdata.refIdx, horAddr, verAddr);
endrule
 
454,7 → 464,7
end
end
work1Vector8 <= work1Vector8Next;
$display( "PARDEBLOCK Trace interpolator: work1Luma %h %h %h %h %h %h", xfracl, yfracl, work1HorNum, work1VerNum, offset, work1Stage);
$display( "PARDEBLOCK Trace interpolator(%0d): work1Luma %h %h %h %h %h %h", total_cycles, xfracl, yfracl, work1HorNum, work1VerNum, offset, work1Stage);
endrule
 
 
637,7 → 647,7
work2Vector8 <= work2Vector8Next;
work2Vector15 <= work2Vector15Next;
resultReady <= resultReadyNext;
$display( "PARDEBLOCK Trace interpolator: work2Luma %h %h %h %h %h", xfracl, yfracl, work2HorNum, work2VerNum, offset);
$display( "PARDEBLOCK Trace interpolator%(0d): work2Luma %h %h %h %h %h",total_cycles, xfracl, yfracl, work2HorNum, work2VerNum, offset);
endrule
 
 
762,7 → 772,7
end
end
work1Vector8 <= work1Vector8Next;
$display( "PARDEBLOCK Trace interpolator: work1Chroma %h %h %h %h %h", xfracc, yfracc, work1HorNum, work1VerNum, offset);
$display( "PARDEBLOCK Trace interpolator(%0d): work1Chroma %h %h %h %h %h", total_cycles, xfracc, yfracc, work1HorNum, work1VerNum, offset);
endrule
 
 
783,7 → 793,7
work2VerNum <= work2VerNum+1;
end
resultReady <= resultReadyNext;
$display( "PARDEBLOCK Trace interpolator: work2Chroma %h %h", work2HorNum, work2VerNum);
$display( "PARDEBLOCK Trace interpolator(%0d): work2Chroma %h %h", total_cycles, work2HorNum, work2VerNum);
endrule
 
 
796,7 → 806,7
if(outBlockNum == 3)
outDone <= True;
end
$display( "Trace interpolator: outputing %h %h", outBlockNum, outPixelNum);
$display( "PARDEBLOCK Trace interpolator(%0d): outputing %h %h", total_cycles, outBlockNum, outPixelNum);
endrule
 
 
847,17 → 857,22
method Action deq();
outfifo.deq();
endmethod
 
method Action endOfFrame();
endOfFrameFlag <= True;
endmethod
interface Client mem_client;
interface Get request = fifoToGet(memReqQ);
interface Put response = fifoToPut(memRespQ);
endinterface
 
method InterpolatorLoadReq mem_request_first();
return memReqQ.first;
endmethod
 
method Action mem_request_deq();
memReqQ.deq;
endmethod
 
interface mem_client_resp = fifoToPut(memRespQ);
endmodule
 
 
/trunk/LumaChromaParallel/mkH264.bsv
60,7 → 60,8
IBufferControl buffercontrol <- mkBufferControl();
 
// Internal connections
mkConnection( prediction.mem_client_buffer, buffercontrol.inter_server );
mkConnection( prediction.mem_client_buffer_luma, buffercontrol.inter_server_luma );
mkConnection( prediction.mem_client_buffer_chroma, buffercontrol.inter_server_chroma );
 
mkConnection( nalunwrap.ioout, entropydec.ioin );
mkConnection( entropydec.ioout_InverseTrans, inversetrans.ioin );
82,6 → 83,7
interface mem_clientD_parameter = deblockfilter.mem_client_parameter;
interface buffer_client_load1 = buffercontrol.buffer_client_load1;
interface buffer_client_load2 = buffercontrol.buffer_client_load2;
interface buffer_client_load3 = buffercontrol.buffer_client_load3;
interface buffer_client_store = buffercontrol.buffer_client_store;
 
// Interface for output
/trunk/LumaChromaParallel/DeblockParallel.bsv
160,10 → 160,13
tagged PBoutput .xdata: begin
match {.chromaFlag, .vec} = xdata;
if(chromaFlag == Chroma)
begin
begin
deblockfilterchroma.ioin.put(dataIn);
end
else
begin
$display("PARDEBLOCK ERROR! passing luma data to chroma filter");
end
end
default: begin
185,6 → 188,10
deblockfilterluma.ioin.put(dataIn);
end
else
begin
$display("PARDEBLOCK ERROR! passing chroma data to luma filter");
end
end
default: begin
/trunk/LumaChromaParallel/mkDeblockFilter.bsv
518,7 → 518,12
end
tagged PBoutput .xdata :
begin
$display( "ERROR Deblocking Filter: passing PBoutput");
$display( "ERROR Deblocking Filter(%s): passing PBoutput", csStr);
match {.colorFlag, .data} = xdata;
if(chromaFlag != colorFlag)
begin
$display( "ERROR Deblocking Filter(%s): color mismatch", csStr);
end
end
tagged EndOfFile :
begin
806,10 → 811,7
bSfileHor.upd(xdata.blockNum, xdata.bShor);
bSfileVer.upd(xdata.blockNum, xdata.bSver);
$display( "TRACE Deblocking Filter(%s): horizontal bsFIFO data: %d, subblock(%0d, %0d) row: %0d, ",csStr,infifo.first(), blockHor, blockVer, pixelNum);
if(blockNum != xdata.blockNum)
begin
$display( "PARDEBLOCK(%s) ERROR %0d cyclels: horizontal bsFIFO , subblock(%0d) expected subblock(%0d) ",csStr, total_cycles,blockNum, xdata.blockNum);
end
 
end
tagged PBoutput .predOutput :
begin
816,7 → 818,7
match {.predChromaFlag, .xdata} = predOutput;
if(predChromaFlag != chromaFlag)
begin
$display("PARDEBLOCK ERROR chroma flag mismatch in deblocking filter");
$display("PARDEBLOCK deblockingFilter(%s) ERROR chroma flag mismatch in deblocking filter",csStr);
end
Bit#(PicWidthSz) currMbHorT = truncate(currMbHor);
if((chromaFlag == Chroma) && (blockHor[1] == 1))
938,7 → 940,23
end
pixelNum <= pixelNum+1;
end
default: $display( "ERROR Deblocking Filter: horizontal non-PBoutput input");
default: begin
$display( "ERROR Deblocking Filter(%s): horizontal non-PBoutput input at sublock (%0d,%0d)", csStr,blockHor,blockVer);
case(infifo.first()) matches
tagged NewUnit . xdata : $display("Caused by NewUnit");
tagged SPSpic_width_in_mbs .xdata : $display("Caused by SPSpic_width_in_mbs");
tagged SPSpic_height_in_map_units .xdata : $display("Caused by SPSpic_height_in_map_units");
tagged PPSdeblocking_filter_control_present_flag .xdata : $display("Caused by PPSdeblocking_filter_control_present_flag");
tagged SHfirst_mb_in_slice .xdata : $display("Caused by SHfirst_mb_in_slice");
tagged SHdisable_deblocking_filter_idc .xdata : $display("Caused by SHdisable_deblocking_filter_idc");
tagged SHslice_alpha_c0_offset .xdata : $display("Caused by SHslice_alpha_c0_offset");
tagged SHslice_beta_offset .xdata : $display("Caused by SHslice_beta_offset");
tagged IBTmb_qp .xdata : $display("Caused by IBTmb_qp");
tagged EndOfFile : $display("Caused by EndOfFile");
default:
$display("Caused by Unknown");
endcase
end
endcase
endrule
 
/trunk/LumaChromaParallel/mkTH.bsv
67,6 → 67,7
if(cyclecount > 600000000)
begin
$display( "ERROR mkTH: time out" );
$finish(0);
end
endrule
80,6 → 81,7
mkConnection( h264.mem_clientD_parameter, memD_parameter.mem_server );
mkConnection( h264.buffer_client_load1, framebuffer.server_load1 );
mkConnection( h264.buffer_client_load2, framebuffer.server_load2 );
mkConnection( h264.buffer_client_load3, framebuffer.server_load3 );
mkConnection( h264.buffer_client_store, framebuffer.server_store );
mkConnection( h264.ioout, finaloutput.ioin );

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.