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

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [src/] [mkFinalOutput.bsv] - Blame information for rev 19

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

Line No. Rev Author Line
1 2 jamey.hick
//**********************************************************************
2
// final output implementation
3
//----------------------------------------------------------------------
4
//
5
//
6
 
7
package mkFinalOutput;
8
 
9
import H264Types::*;
10
import IFinalOutput::*;
11
import FIFO::*;
12 6 jamey.hick
import RegFile::*;
13 2 jamey.hick
 
14
import Connectable::*;
15
import GetPut::*;
16
 
17
//-----------------------------------------------------------
18
// Final Output Module
19
//-----------------------------------------------------------
20
 
21
module mkFinalOutput( IFinalOutput );
22
 
23 19 jamey.hick
   FIFO#(BufferControlOT)  infifo    <- mkFIFO;
24 6 jamey.hick
   Reg#(Bit#(27))    index   <- mkReg(0);
25 2 jamey.hick
 
26 6 jamey.hick
   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 2 jamey.hick
   //-----------------------------------------------------------
48
   // Rules
49 6 jamey.hick
   rule finalout (True);
50 19 jamey.hick
    //  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 6 jamey.hick
 
61
      index <= index + 4;
62 2 jamey.hick
      if(infifo.first() matches tagged YUV .xdata)
63
         begin
64 19 jamey.hick
            $display("OUT %h", xdata[7:0]);
65
            $display("OUT %h", xdata[15:8]);
66
            $display("OUT %h", xdata[23:16]);
67 9 jamey.hick
            $display("OUT %h", xdata[31:24]);
68 2 jamey.hick
            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-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.