OpenCores
URL https://opencores.org/ocsvn/socgen/socgen/trunk

Subversion Repositories socgen

[/] [socgen/] [trunk/] [Projects/] [opencores.org/] [wishbone/] [ip/] [wb_uart16550/] [rtl/] [verilog/] [sync_flops] - Blame information for rev 131

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  uart_sync_flops.v                                             ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the "UART 16550 compatible" project    ////
7
////  http://www.opencores.org/cores/uart16550/                   ////
8
////                                                              ////
9
////  Documentation related to this project:                      ////
10
////  - http://www.opencores.org/cores/uart16550/                 ////
11
////                                                              ////
12
////  Projects compatibility:                                     ////
13
////  - WISHBONE                                                  ////
14
////  RS232 Protocol                                              ////
15
////  16550D uart (mostly supported)                              ////
16
////                                                              ////
17
////  Overview (main Features):                                   ////
18
////  UART core receiver logic                                    ////
19
////                                                              ////
20
////  Known problems (limits):                                    ////
21
////  None known                                                  ////
22
////                                                              ////
23
////  To Do:                                                      ////
24
////  Thourough testing.                                          ////
25
////                                                              ////
26
////  Author(s):                                                  ////
27
////      - Andrej Erzen (andreje@flextronics.si)                 ////
28
////      - Tadej Markovic (tadejm@flextronics.si)                ////
29
////                                                              ////
30
////  Created:        2004/05/20                                  ////
31
////  Last Updated:   2004/05/20                                  ////
32
////                  (See log for the revision history)          ////
33
////                                                              ////
34
////                                                              ////
35
//////////////////////////////////////////////////////////////////////
36
////                                                              ////
37
//// Copyright (C) 2000, 2001 Authors                             ////
38
////                                                              ////
39
//// This source file may be used and distributed without         ////
40
//// restriction provided that this copyright statement is not    ////
41
//// removed from the file and that any derivative work contains  ////
42
//// the original copyright notice and the associated disclaimer. ////
43
////                                                              ////
44
//// This source file is free software; you can redistribute it   ////
45
//// and/or modify it under the terms of the GNU Lesser General   ////
46
//// Public License as published by the Free Software Foundation; ////
47
//// either version 2.1 of the License, or (at your option) any   ////
48
//// later version.                                               ////
49
////                                                              ////
50
//// This source is distributed in the hope that it will be       ////
51
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
52
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
53
//// PURPOSE.  See the GNU Lesser General Public License for more ////
54
//// details.                                                     ////
55
////                                                              ////
56
//// You should have received a copy of the GNU Lesser General    ////
57
//// Public License along with this source; if not, download it   ////
58
//// from http://www.opencores.org/lgpl.shtml                     ////
59
////                                                              ////
60
//////////////////////////////////////////////////////////////////////
61
//
62
// CVS Revision History
63
//
64
// $Log: not supported by cvs2svn $
65
//
66
 
67
 
68
 
69
module `VARIANT`SYNC_FLOPS
70
(
71
  // internal signals
72
  rst_i,
73
  clk_i,
74
  stage1_rst_i,
75
  stage1_clk_en_i,
76
  async_dat_i,
77
  sync_dat_o
78
);
79
 
80
 
81
parameter width         = 1;
82
parameter init_value    = 1'b0;
83
 
84
input                           rst_i;                  // reset input
85
input                           clk_i;                  // clock input
86
input                           stage1_rst_i;           // synchronous reset for stage 1 FF
87
input                           stage1_clk_en_i;        // synchronous clock enable for stage 1 FF
88
input   [width-1:0]             async_dat_i;            // asynchronous data input
89
output  [width-1:0]             sync_dat_o;             // synchronous data output
90
 
91
 
92
//
93
// Interal signal declarations
94
//
95
 
96
reg     [width-1:0]             sync_dat_o;
97
reg     [width-1:0]             flop_0;
98
 
99
 
100
// first stage
101
always @ (posedge clk_i )
102
begin
103
    if (rst_i)
104
        flop_0 <=  {width{init_value}};
105
    else
106
        flop_0 <=  async_dat_i;
107
end
108
 
109
// second stage
110
always @ (posedge clk_i )
111
begin
112
    if (rst_i)
113
        sync_dat_o <=  {width{init_value}};
114
    else if (stage1_rst_i)
115
        sync_dat_o <=  {width{init_value}};
116
    else if (stage1_clk_en_i)
117
        sync_dat_o <=  flop_0;
118
end
119
 
120
endmodule

powered by: WebSVN 2.1.0

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