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
46
module
jpeg_top
(
clk
,
rst
,
end_of_file_signal
,
enable
,
data_in
,
JPEG_bitstream
,
47
data_ready
,
end_of_file_bitstream_count
,
eof_data_partial_ready
);
48
input
clk
;
49
input
rst
;
50
input
end_of_file_signal
;
51
input
enable
;
52
input
[
23
:
0
]
data_in
;
53
output
[
31
:
0
]
JPEG_bitstream
;
54
output
data_ready
;
55
output
[
4
:
0
]
end_of_file_bitstream_count
;
56
output
eof_data_partial_ready
;
57
58
wire
[
31
:
0
]
JPEG_FF
;
59
wire
data_ready_FF
;
60
wire
[
4
:
0
]
orc_reg_in
;
61
62
fifo_out
u19
(.
clk
(
clk
), .
rst
(
rst
), .
enable
(
enable
), .
data_in
(
data_in
),
63
.
JPEG_bitstream
(
JPEG_FF
), .
data_ready
(
data_ready_FF
), .
orc_reg
(
orc_reg_in
));
64
65
ff_checker
u20
(.
clk
(
clk
), .
rst
(
rst
),
66
.
end_of_file_signal
(
end_of_file_signal
), .
JPEG_in
(
JPEG_FF
),
67
.
data_ready_in
(
data_ready_FF
), .
orc_reg_in
(
orc_reg_in
),
68
.
JPEG_bitstream_1
(
JPEG_bitstream
),
69
.
data_ready_1
(
data_ready
), .
orc_reg
(
end_of_file_bitstream_count
),
70
.
eof_data_partial_ready
(
eof_data_partial_ready
));
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
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
code
jpeg_top.v
Generated by
1.8.12