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