jpeg_top.v
Go to the documentation of this file.
/////////////////////////////////////////////////////////////////////
//// ////
//// JPEG Encoder Core - Verilog ////
//// ////
//// Author: David Lundgren ////
//// davidklun@gmail.com ////
//// ////
/////////////////////////////////////////////////////////////////////
//// ////
//// Copyright (C) 2009 David Lundgren ////
//// davidklun@gmail.com ////
//// ////
//// This source file may be used and distributed without ////
//// restriction provided that this copyright statement is not ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer.////
//// ////
//// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ////
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ////
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ////
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR ////
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ////
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE ////
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR ////
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ////
//// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ////
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ////
//// POSSIBILITY OF SUCH DAMAGE. ////
//// ////
/////////////////////////////////////////////////////////////////////
/* This is the top level module of the JPEG Encoder Core.
This module takes the output from the fifo_out module and sends it
to the ff_checker module to check for FF's in the bitstream. When it finds an
FF, it puts a 00 after it, and then continues with the rest of the bitstream.
At the end of the file, if there is not a full 32 bit set of JPEG data, then the
signal "eof_data_partial_ready" will go high, to indicate there
are less than 32 valid JPEG bits in the bitstream. The number of valid bits in the
last JPEG_bitstream value is written to the signal "end_of_file_bitstream_count".
*/
`timescale 1ns / 100ps
//`define TRACE
module jpeg_top(clk, rst, end_of_file_signal, enable, data_in, JPEG_bitstream,
data_ready, end_of_file_bitstream_count, eof_data_partial_ready);
input clk;
input rst;
input end_of_file_signal;
input enable;
input [23:0] data_in;
output [31:0] JPEG_bitstream;
output data_ready;
output [4:0] end_of_file_bitstream_count;
output eof_data_partial_ready;
wire [31:0] JPEG_FF;
wire data_ready_FF;
wire [4:0] orc_reg_in;
fifo_out u19 (.clk(clk), .rst(rst), .enable(enable), .data_in(data_in),
.JPEG_bitstream(JPEG_FF), .data_ready(data_ready_FF), .orc_reg(orc_reg_in));
ff_checker u20 (.clk(clk), .rst(rst),
.end_of_file_signal(end_of_file_signal), .JPEG_in(JPEG_FF),
.data_ready_in(data_ready_FF), .orc_reg_in(orc_reg_in),
.JPEG_bitstream_1(JPEG_bitstream),
.data_ready_1(data_ready), .orc_reg(end_of_file_bitstream_count),
.eof_data_partial_ready(eof_data_partial_ready));
`ifdef TRACE
`include "IVERILOG_INCLUDE.v"
initial begin
$dumpfile (fstname);
$dumpvars (0,jpeg_top); //SuppressThisWarning VEditor - VDT bug, does not recognize the name of the top module
end
`endif
endmodule
jpeg_top.3389eof_data_partial_ready
3389eof_data_partial_ready
Definition: jpeg_top.v:56
fifo_out.3341data_ready
3341data_readyreg
Definition: fifo_out.v:80
ff_checker.3150JPEG_bitstream_1
3150JPEG_bitstream_1reg[31:0]
Definition: ff_checker.v:64
jpeg_top.3381clk
3381clk
Definition: jpeg_top.v:48
fifo_out.3217data_in
[23:0] 3217data_in
Definition: fifo_out.v:44
fifo_out.3214clk
3214clk
Definition: fifo_out.v:43
jpeg_top.ff_checker
u20 ff_checker
Definition: jpeg_top.v:65
ff_checker.3112clk
3112clk
Definition: ff_checker.v:44
ff_checker.3114end_of_file_signal
3114end_of_file_signal
Definition: ff_checker.v:46
jpeg_top.3384enable
3384enable
Definition: jpeg_top.v:51
jpeg_top.3388end_of_file_bitstream_count
[4:0] 3388end_of_file_bitstream_count
Definition: jpeg_top.v:55
jpeg_top.3392orc_reg_in
3392orc_reg_inwire[4:0]
Definition: jpeg_top.v:60
jpeg_top.3391data_ready_FF
3391data_ready_FFwire
Definition: jpeg_top.v:59
jpeg_top.3382rst
3382rst
Definition: jpeg_top.v:49
ff_checker.3113rst
3113rst
Definition: ff_checker.v:45
fifo_out.3216enable
3216enable
Definition: fifo_out.v:43
jpeg_top.fifo_out
u19 fifo_out
Definition: jpeg_top.v:62
jpeg_top
Definition: jpeg_top.v:46
jpeg_top.3386JPEG_bitstream
[31:0] 3386JPEG_bitstream
Definition: jpeg_top.v:53
fifo_out.3215rst
3215rst
Definition: fifo_out.v:43
ff_checker.3202eof_data_partial_ready
3202eof_data_partial_readyreg
Definition: ff_checker.v:85
ff_checker.3116data_ready_in
3116data_ready_in
Definition: ff_checker.v:48
fifo_out.3274JPEG_bitstream
3274JPEG_bitstreamreg[31:0]
Definition: fifo_out.v:65
jpeg_top.3390JPEG_FF
3390JPEG_FFwire[31:0]
Definition: jpeg_top.v:58
jpeg_top.3387data_ready
3387data_ready
Definition: jpeg_top.v:54
ff_checker.3115JPEG_in
[31:0] 3115JPEG_in
Definition: ff_checker.v:47
jpeg_top.3383end_of_file_signal
3383end_of_file_signal
Definition: jpeg_top.v:50
jpeg_top.3385data_in
[23:0] 3385data_in
Definition: jpeg_top.v:52
ff_checker.3196data_ready_1
3196data_ready_1reg
Definition: ff_checker.v:83
fifo_out.3238orc_reg
3238orc_regreg[4:0]
Definition: fifo_out.v:59
ff_checker.3190orc_reg
3190orc_regreg[4:0]
Definition: ff_checker.v:79
ff_checker.3117orc_reg_in
[4:0] 3117orc_reg_in
Definition: ff_checker.v:49