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

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [release/] [mkFinalOutput.bsv] - Blame information for rev 84

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 84 jamey.hick
//**********************************************************************
2
// final output implementation
3
//----------------------------------------------------------------------
4
//
5
//
6
 
7
package mkFinalOutput;
8
 
9
import H264Types::*;
10
import IFinalOutput::*;
11
import FIFO::*;
12
import RegFile::*;
13
 
14
import Connectable::*;
15
import GetPut::*;
16
 
17
//-----------------------------------------------------------
18
// Final Output Module
19
//-----------------------------------------------------------
20
 
21
module mkFinalOutput( IFinalOutput );
22
 
23
   FIFO#(BufferControlOT)  infifo    <- mkFIFO;
24
   Reg#(Bit#(27))    index   <- mkReg(0);
25
 
26
   Reg#(Bit#(32)) tick_counter <- mkReg(0);
27
   Reg#(Bit#(32)) data_seen_counter <- mkReg(0);
28
   Reg#(Bit#(32)) last_f_count <- mkReg(0);
29
   Reg#(Bit#(32)) f_count <- mkReg(0);
30
 
31
   rule tick;
32
     tick_counter <= tick_counter + 1;
33
     if(tick_counter%2000000 == 0)
34
       begin
35
         if(last_f_count == f_count)
36
           begin
37
             $display("mkFinalOutput: Warning: no new frames, stuck at %d", last_f_count);
38
           end
39
         else
40
           begin
41
             $display("mkFinalOutput: Feelin' fine current frames: %d", last_f_count);
42
           end
43
         last_f_count <= f_count;
44
       end
45
   endrule
46
 
47
   //-----------------------------------------------------------
48
   // Rules
49
   rule finalout (True);
50
    //  Bit#(32) data_constant = pack(fromInteger(horizontal_pixels * vertical_pixels))*3/2;
51
      //if(data_seen_counter + 4 > data_constant)
52
       // begin
53
       //   f_count <= f_count + 1;
54
       //   data_seen_counter <= 0;
55
       // end
56
      //else
57
      //  begin
58
      //    data_seen_counter <= data_seen_counter+4;
59
      //  end
60
 
61
      index <= index + 4;
62
      if(infifo.first() matches tagged YUV .xdata)
63
         begin
64
            $display("OUT %h", xdata[7:0]);
65
            $display("OUT %h", xdata[15:8]);
66
            $display("OUT %h", xdata[23:16]);
67
            $display("OUT %h", xdata[31:24]);
68
            infifo.deq();
69
         end
70
      else
71
         $finish(0);
72
   endrule
73
 
74
 
75
   interface Put ioin  = fifoToPut(infifo);
76
 
77
endmodule
78
 
79
endpackage

powered by: WebSVN 2.1.0

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