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

Subversion Repositories pci

[/] [pci/] [tags/] [rel_3/] [rtl/] [verilog/] [synchronizer_flop.v] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mihad
//===========================================================================
2 21 mihad
// $Id: synchronizer_flop.v,v 1.3 2002-02-01 15:25:13 mihad Exp $
3 2 mihad
//
4
//////////////////////////////////////////////////////////////////////
5
////                                                              ////
6
//// synchronizer_flop                                            ////
7
////                                                              ////
8
//// This file is part of the general opencores effort.           ////
9
//// <http://www.opencores.org/cores/misc/>                       ////
10
////                                                              ////
11
//// Module Description:                                          ////
12
////                                                              ////
13
//// Make a rising-edge triggered flop with async reset with a    ////
14
////   distinguished name so that it can be replaced with a flop  ////
15
////   which does not make X's during simulation.                 ////
16
////                                                              ////
17
//// This flop should be used instead of a regular flop for ALL   ////
18
////   cross-clock-domain flops.  Manually instantiating this     ////
19
////   flop for all signals which must NEVER go to 1'bX during    ////
20
////   simulation will make it possible for the user to           ////
21
////   substitute a simulation model which does NOT have setup    ////
22
////   and hold checks.                                           ////
23
////                                                              ////
24
//// If a target device library has a component which is          ////
25
////   especially well suited to perform this function, it should ////
26
////   be instantiated by name in this file.  Otherwise, the      ////
27
////   behaviorial version of this module will be used.           ////
28
////                                                              ////
29
//// To Do:                                                       ////
30
//// Nothing                                                      ////
31
////                                                              ////
32
//// Author(s):                                                   ////
33
//// - anynomous                                                  ////
34
////                                                              ////
35
//////////////////////////////////////////////////////////////////////
36
////                                                              ////
37
//// Copyright (C) 2001 Authors and OPENCORES.ORG                 ////
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 21 mihad
// Revision 1.2  2001/10/05 08:14:30  mihad
66
// Updated all files with inclusion of timescale file for simulation purposes.
67
//
68 6 mihad
// Revision 1.1.1.1  2001/10/02 15:33:47  mihad
69
// New project directory structure
70
//
71 2 mihad
// Revision 1.5  2001/09/26 21:51:00  Tadej Markovic
72
//   Added parameter 'width', if module is used for e.g. bus
73
//
74
// Revision 1.4  2001/09/03 13:18:30  bbeaver
75
// no message
76
//
77
// Revision 1.1  2001/09/03 11:16:00  Blue Beaver
78
// no message
79
//
80
// Revision 1.1.1.1  2001/09/03 10:24:58  bbeaver
81
// no message
82
//
83
// Revision 1.1  2001/09/02 11:32:03  Blue Beaver
84
// no message
85
//
86
//
87
 
88 21 mihad
// synopsys translate_off
89 6 mihad
`include "timescale.v"
90 21 mihad
// synopsys translate_on
91 2 mihad
 
92
// If the vendor has a flop which is particularly good at settling out of
93
//   metastability, it should be used here.
94
module synchronizer_flop (
95
  data_in, clk_out, sync_data_out, async_reset
96
);
97
parameter               width = 1 ;
98
 
99
  input   [width-1:0]   data_in;
100
  input                 clk_out;
101
  output  [width-1:0]   sync_data_out;
102
  input                 async_reset;
103
 
104
  reg     [width-1:0]   sync_data_out;
105
 
106
  always @(posedge clk_out or posedge async_reset)
107
  begin
108
    if (async_reset == 1'b1)
109
    begin
110
      sync_data_out <= 0;
111
    end
112
    else
113
    begin
114
// In gate-level simulation, must only go to 1'bX if the input is 1'bX or 1'bZ.
115
// This should NEVER go to 1'bX due to setup or hold violations.
116
      sync_data_out <= data_in;
117
    end
118
  end
119
endmodule
120
 

powered by: WebSVN 2.1.0

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