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

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [src/] [mkFinalOutput.bsv] - Diff between revs 9 and 19

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 19
Line 12... Line 12...
import RegFile::*;
import RegFile::*;
 
 
import Connectable::*;
import Connectable::*;
import GetPut::*;
import GetPut::*;
 
 
`define INPUT_SIZE 17740800
 
 
 
//-----------------------------------------------------------
//-----------------------------------------------------------
// Final Output Module
// Final Output Module
//-----------------------------------------------------------
//-----------------------------------------------------------
 
 
module mkFinalOutput( IFinalOutput );
module mkFinalOutput( IFinalOutput );
 
 
   FIFO#(BufferControlOT)  infifo    <- mkFIFO;
   FIFO#(BufferControlOT)  infifo    <- mkFIFO;
   RegFile#(Bit#(27), Bit#(8)) rfile <- mkRegFileLoad("golden.hex", 0, `INPUT_SIZE);
 
 
 
   Reg#(Bit#(27))    index   <- mkReg(0);
   Reg#(Bit#(27))    index   <- mkReg(0);
 
 
   Reg#(Bit#(32)) tick_counter <- mkReg(0);
   Reg#(Bit#(32)) tick_counter <- mkReg(0);
   Reg#(Bit#(32)) data_seen_counter <- mkReg(0);
   Reg#(Bit#(32)) data_seen_counter <- mkReg(0);
   Reg#(Bit#(32)) last_f_count <- mkReg(0);
   Reg#(Bit#(32)) last_f_count <- mkReg(0);
Line 49... Line 45...
   endrule
   endrule
 
 
   //-----------------------------------------------------------
   //-----------------------------------------------------------
   // Rules
   // Rules
   rule finalout (True);
   rule finalout (True);
      Bit#(32) data_constant = pack(fromInteger(horizontal_pixels * vertical_pixels))*3/2;
    //  Bit#(32) data_constant = pack(fromInteger(horizontal_pixels * vertical_pixels))*3/2;
      if(data_seen_counter + 4 > data_constant)
      //if(data_seen_counter + 4 > data_constant)
        begin
       // begin
          f_count <= f_count + 1;
       //   f_count <= f_count + 1;
          data_seen_counter <= 0;
       //   data_seen_counter <= 0;
        end
       // end
      else
      //else
        begin
      //  begin
          data_seen_counter <= data_seen_counter+4;
      //    data_seen_counter <= data_seen_counter+4;
        end
      //  end
 
 
      index <= index + 4;
      index <= index + 4;
      if(infifo.first() matches tagged YUV .xdata)
      if(infifo.first() matches tagged YUV .xdata)
         begin
         begin
            $display("OUT %h", xdata[31:24]);
 
            $display("OUT %h", xdata[23:16]);
 
            $display("OUT %h", xdata[15:8]);
 
            $display("OUT %h", xdata[7:0]);
            $display("OUT %h", xdata[7:0]);
            if( xdata[7:0] != rfile.sub(index))
            $display("OUT %h", xdata[15:8]);
              begin
            $display("OUT %h", xdata[23:16]);
                $display("mkFinalOutput: ccl5finalout ERROR %h, index %d", xdata[7:0], index);
            $display("OUT %h", xdata[31:24]);
              end
 
            if( xdata[15:8] != rfile.sub(index + 1))
 
              begin
 
                $display("mkFinalOutput: ccl5finalout ERROR %h, index %d", xdata[15:8], index + 1);
 
              end
 
            if( xdata[23:16] != rfile.sub(index+2))
 
              begin
 
                $display("mkFinalOutput: ccl5finalout ERROR %h, index %d", xdata[23:16], index+2);
 
              end
 
            if( xdata[31:24] != rfile.sub(index+3))
 
              begin
 
                $display("mkFinalOutput: ccl5finalout ERROR %h, index %d", xdata[31:24], index+3);
 
              end
 
            infifo.deq();
            infifo.deq();
         end
         end
      else
      else
         $finish(0);
         $finish(0);
   endrule
   endrule

powered by: WebSVN 2.1.0

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