1 |
9 |
joaocarlos |
/* --------------------------------------------------------------------------------
|
2 |
|
|
This file is part of FPGA Median Filter.
|
3 |
|
|
|
4 |
|
|
FPGA Median Filter is free software: you can redistribute it and/or modify
|
5 |
|
|
it under the terms of the GNU General Public License as published by
|
6 |
|
|
the Free Software Foundation, either version 3 of the License, or
|
7 |
|
|
(at your option) any later version.
|
8 |
|
|
|
9 |
|
|
FPGA Median Filter is distributed in the hope that it will be useful,
|
10 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
|
|
GNU General Public License for more details.
|
13 |
|
|
|
14 |
|
|
You should have received a copy of the GNU General Public License
|
15 |
|
|
along with FPGA Median Filter. If not, see <http://www.gnu.org/licenses/>.
|
16 |
|
|
-------------------------------------------------------------------------------- */
|
17 |
|
|
/* +----------------------------------------------------------------------------
|
18 |
|
|
Universidade Federal da Bahia
|
19 |
|
|
------------------------------------------------------------------------------
|
20 |
|
|
PROJECT: FPGA Median Filter
|
21 |
|
|
------------------------------------------------------------------------------
|
22 |
|
|
FILE NAME : pixel_network.v
|
23 |
|
|
AUTHOR : João Carlos Bittencourt
|
24 |
|
|
AUTHOR'S E-MAIL : joaocarlos@ieee.org
|
25 |
|
|
-----------------------------------------------------------------------------
|
26 |
|
|
RELEASE HISTORY
|
27 |
|
|
VERSION DATE AUTHOR DESCRIPTION
|
28 |
|
|
1.0 2013-08-13 joao.nunes initial version
|
29 |
|
|
-----------------------------------------------------------------------------
|
30 |
|
|
KEYWORDS: dff, flip-flop, register bank
|
31 |
|
|
-----------------------------------------------------------------------------
|
32 |
|
|
PURPOSE: Group median pipeline registers.
|
33 |
|
|
----------------------------------------------------------------------------- */
|
34 |
2 |
joaocarlos |
module dff_3_pipe
|
35 |
|
|
#(
|
36 |
|
|
parameter DATA_WIDTH = 8
|
37 |
|
|
)(
|
38 |
|
|
input clk,
|
39 |
|
|
input rst_n,
|
40 |
|
|
input [DATA_WIDTH-1:0] d0,
|
41 |
|
|
input [DATA_WIDTH-1:0] d1,
|
42 |
|
|
input [DATA_WIDTH-1:0] d2,
|
43 |
|
|
|
44 |
|
|
output reg [DATA_WIDTH-1:0] q0,
|
45 |
|
|
output reg [DATA_WIDTH-1:0] q1,
|
46 |
|
|
output reg [DATA_WIDTH-1:0] q2
|
47 |
|
|
);
|
48 |
|
|
|
49 |
|
|
always @(posedge clk or negedge rst_n)
|
50 |
|
|
begin : register_bank_3u
|
51 |
|
|
if(~rst_n) begin
|
52 |
|
|
q0 <= {DATA_WIDTH{1'b0}};
|
53 |
|
|
q1 <= {DATA_WIDTH{1'b0}};
|
54 |
|
|
q2 <= {DATA_WIDTH{1'b0}};
|
55 |
|
|
end else begin
|
56 |
|
|
q0 <= d0;
|
57 |
|
|
q1 <= d1;
|
58 |
|
|
q2 <= d2;
|
59 |
|
|
end
|
60 |
|
|
end
|
61 |
|
|
|
62 |
|
|
endmodule
|