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

Subversion Repositories rxaui_interface_and_xaui_to_rxaui_interface_adapter

[/] [rxaui_interface_and_xaui_to_rxaui_interface_adapter/] [GenericModules/] [sip_reset_sync.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tsahidanie
//-----------------------------------------------------------------------------
2
// Title         : Reset sync
3
// Project       : SIP
4
//-----------------------------------------------------------------------------
5
// File          : sip_reset_sync.v
6
// Author        : Lior Valency
7
// Created       : 20/02/2008
8
// Last modified : 20/02/2008
9
//-----------------------------------------------------------------------------
10
// Description : Synchronizes the reset_ input to the clock and provides
11
//               load_config_ for configuration inputs
12
//-----------------------------------------------------------------------------
13
// Copyright (c) 2007  Marvell International Ltd.
14
//
15
// THIS CODE CONTAINS CONFIDENTIAL INFORMATION OF MARVELL SEMICONDUCTOR, INC.
16
// NO RIGHTS ARE GRANTED HEREIN UNDER ANY PATENT, MASK WORK RIGHT OR COPYRIGHT
17
// OF MARVELL OR ANY THIRD PARTY. MARVELL RESERVES THE RIGHT AT ITS SOLE
18
// DISCRETION TO REQUEST THAT THIS CODE BE IMMEDIATELY RETURNED TO MARVELL.
19
// THIS CODE IS PROVIDED "AS IS". MARVELL MAKES NO WARRANTIES, EXPRESS,
20
// IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE.
21
//
22
//------------------------------------------------------------------------------
23
// Modification history :
24
// 12/12/2007  : created
25
//-----------------------------------------------------------------------------
26
 
27
/////////////////////////////////////////////
28
//MODULE tg_p_reset_sync
29
/////////////////////////////////////////////
30
module sip_reset_sync (/*AUTOARG*/
31
  // Outputs
32
  load_config_, reset_out_, reset_chg_,
33
  // Inputs
34
  clk, reset_in_, scan_mode_
35
  ); //module hi_reset_sync.
36
 
37
 
38
 
39
 
40
  //-------------------------------------------------------------------------
41
  // Interface (input/output) signals Declaration file
42
  //-------------------------------------------------------------------------
43
  input clk;
44
  input reset_in_;   // RESET input pin from pad
45
  input scan_mode_;   // scan mode indication
46
  output load_config_ ;   // load_enable_ for configuration inputs
47
  output reset_out_;   // internal reset_ synchronized to clk
48
  output reset_chg_;   // Change has occured in reset signal
49
  //-------------------------------------------------------------------------
50
  // Internal signals Declaration file
51
  //-------------------------------------------------------------------------
52
  reg    reset_synch1_; // reset_ synchronizer #1
53
  reg    reset_synch2_; // reset_ synchronizer #2
54
  reg    reset_synch3_; // reset_ synchronizer #3
55
  reg    reset_synch4_; // reset_ synchronizer #4
56
  wire   reset_chg_tmp_;// difference in value of sync2 and sync3
57
  //-------------------------------------------------------------------------
58
 
59
///////////////////////////////////////////////////////////////////////////
60
// 
61
// CASE#1: RESET PIN ASSERTION (going LOW)  (assertion is not synch'ed)
62
//      ===============================
63
// 
64
//                 |        |        |        |        |        |  
65
//  clk           _/~~~~\___/~~~~\___/~~~~\___/~~~~\___/~~~~\___/~
66
//                 |        |        |        |        |        |  
67
// reset_in_      ~~~~~~~\_______________________________________ input pin
68
//                 |        |        |        |        |        |
69
// load_config_   ~~~~~~~\________________________________________ sync load_
70
//                 |        |        |        |        |        |  
71
// reset_out_     ~~~~~~~\________________________________________ sync reset_
72
//                 |        |        |        |        |        |
73
// reset_chg_     ~~~~~~~~~~~~~~~~~~~~\________/~~~~~~~~~~~~~~~~~
74
//                 |        |        |        |        |        |
75
// 
76
//
77
// CASE#2: RESET PIN DE-ASSERTION (going HIGH) (de-assertion is synch'ed)
78
//      ==================================
79
// 
80
//                 |        |        |        |        |        |  
81
//  clk           _/~~~~\___/~~~~\___/~~~~\___/~~~~\___/~~~~\___/~
82
//                 |        |        |        |        |        |  
83
// reset_in_      _______/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input pin
84
//                 |        |        |        |        |        |  
85
//  ** CASE2.1 early synchronization
86
//                 |        |        |        |        |        |  
87
// load_config_   _____________________________/~~~~~~~~~~~~~~~~~~ sync load_
88
//                 |        |        |        |        |        |  
89
// reset_out_     ______________________________________/~~~~~~~~~ sync reset_
90
//                 |        |        |        |        |        |  
91
//  ** CASE2.2 late synchronization
92
//                 |        |        |        |        |        |  
93
// load_config_   ______________________________________/~~~~~~~~~ sync load_
94
//                 |        |        |        |        |        |  
95
// reset_out_     _______________________________________________/~ sync reset_
96
//                 |        |        |        |        |        |
97
// reset_chg_     ~~~~~~~~~~~~~~~~~~~~\________/~~~~~~~~~~~~~~~~~
98
//                 |        |        |        |        |        |
99
// 
100
//   NOTE: reset_in_ de-assertion is asynchronous, therefore the internal
101
//         reset signals may be de-asserted "early" or "late" as
102
//         described above.
103
//
104
///////////////////////////////////////////////////////////////////////////
105
//-------------------------------------------------------------------------
106
// module BODY
107
//-------------------------------------------------------------------------
108
 
109
  // bypass syncronizers if scan_mode_ is active (LOW)
110
  assign load_config_  = (scan_mode_ == 1'b0) ? (reset_in_) :
111
                         (reset_synch3_ & reset_in_);
112
  assign reset_out_    = (scan_mode_ == 1'b0) ? (reset_in_) :
113
                         (reset_synch4_ & reset_in_);
114
 
115
  assign reset_chg_tmp_ = (((reset_synch2_ == 1'b0) && (reset_synch3_ == 1'b1)) ||
116
                           ((reset_synch2_ == 1'b1) && (reset_synch3_ == 1'b0))) ? 1'b0 : 1'b1;
117
 
118
  assign reset_chg_    = (scan_mode_ == 1'b0) ? (reset_in_) :
119
                         reset_chg_tmp_;
120
 
121
 
122
 
123
 
124
always @ (posedge clk)
125
  begin
126
 
127
    reset_synch1_       <= #1 reset_in_;
128
    reset_synch2_       <= #1 reset_synch1_;
129
    reset_synch3_       <= #1 reset_synch2_;
130
    reset_synch4_       <= #1 reset_synch3_;
131
 
132
  end // always @ (posedge clk)
133
 
134
//-------------------------------------------------------------------------
135
endmodule // sip_reset_sync
136
//-------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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