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 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mihad
//===========================================================================
2
// $Id: synchronizer_flop.v,v 1.1.1.1 2001-10-02 15:33:47 mihad Exp $
3
//
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
// Revision 1.5  2001/09/26 21:51:00  Tadej Markovic
66
//   Added parameter 'width', if module is used for e.g. bus
67
//
68
// Revision 1.4  2001/09/03 13:18:30  bbeaver
69
// no message
70
//
71
// Revision 1.1  2001/09/03 11:16:00  Blue Beaver
72
// no message
73
//
74
// Revision 1.1.1.1  2001/09/03 10:24:58  bbeaver
75
// no message
76
//
77
// Revision 1.1  2001/09/02 11:32:03  Blue Beaver
78
// no message
79
//
80
//
81
 
82
`timescale 1ns/1ps
83
 
84
// If the vendor has a flop which is particularly good at settling out of
85
//   metastability, it should be used here.
86
module synchronizer_flop (
87
  data_in, clk_out, sync_data_out, async_reset
88
);
89
parameter               width = 1 ;
90
 
91
  input   [width-1:0]   data_in;
92
  input                 clk_out;
93
  output  [width-1:0]   sync_data_out;
94
  input                 async_reset;
95
 
96
  reg     [width-1:0]   sync_data_out;
97
 
98
  always @(posedge clk_out or posedge async_reset)
99
  begin
100
    if (async_reset == 1'b1)
101
    begin
102
      sync_data_out <= 0;
103
    end
104
    else
105
    begin
106
// In gate-level simulation, must only go to 1'bX if the input is 1'bX or 1'bZ.
107
// This should NEVER go to 1'bX due to setup or hold violations.
108
      sync_data_out <= data_in;
109
    end
110
  end
111
endmodule
112
 

powered by: WebSVN 2.1.0

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