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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [rtl/] [gmac/] [mac/] [dble_reg.v] - Blame information for rev 76

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 dinesha
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Tubo 8051 cores MAC Interface Module                        ////
4
////                                                              ////
5
////  This file is part of the Turbo 8051 cores project           ////
6
////  http://www.opencores.org/cores/turbo8051/                   ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Turbo 8051 definitions.                                     ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////    nothing                                                   ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Dinesh Annayya, dinesha@opencores.org                 ////
16
////                                                              ////
17 76 dinesha
////  Revision : Mar 2, 2011                                      //// 
18
////                                                              ////
19 12 dinesha
//////////////////////////////////////////////////////////////////////
20
////                                                              ////
21
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
22
////                                                              ////
23
//// This source file may be used and distributed without         ////
24
//// restriction provided that this copyright statement is not    ////
25
//// removed from the file and that any derivative work contains  ////
26
//// the original copyright notice and the associated disclaimer. ////
27
////                                                              ////
28
//// This source file is free software; you can redistribute it   ////
29
//// and/or modify it under the terms of the GNU Lesser General   ////
30
//// Public License as published by the Free Software Foundation; ////
31
//// either version 2.1 of the License, or (at your option) any   ////
32
//// later version.                                               ////
33
////                                                              ////
34
//// This source is distributed in the hope that it will be       ////
35
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
36
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
37
//// PURPOSE.  See the GNU Lesser General Public License for more ////
38
//// details.                                                     ////
39
////                                                              ////
40
//// You should have received a copy of the GNU Lesser General    ////
41
//// Public License along with this source; if not, download it   ////
42
//// from http://www.opencores.org/lgpl.shtml                     ////
43
////                                                              ////
44
//////////////////////////////////////////////////////////////////////
45
 
46
/***************************************************************
47
  Description:
48
        Synchronizes the pulse from one clock to another
49
 * clock domain
50
***********************************************************************/
51
module half_dup_dble_reg (
52
                   //outputs
53
                   sync_out_pulse,
54
                   //inputs
55
                   in_pulse,
56
                   dest_clk,
57
                   reset_n);
58
 
59
  output sync_out_pulse; //output synchronised to slow clock
60
  input  in_pulse;       //input based on fast clock, pulse
61
  input  dest_clk;           //slow clock
62
  input  reset_n;
63
 
64
  reg    s1_sync_out,d_sync_out,s2_sync_out;
65
 
66
  //double register the data in the slow clock domain
67
  always @(posedge dest_clk or negedge reset_n)
68
    begin
69
      if (!reset_n)
70
        begin
71
          s1_sync_out <= 0;
72
          s2_sync_out <= 0;
73
          d_sync_out <= 0;
74
        end // if (reset_n)
75
      else
76
        begin
77
          s1_sync_out <= in_pulse;
78
          s2_sync_out <= s1_sync_out;
79
          d_sync_out <= s2_sync_out;
80
        end // else: !if(reset_n)
81
    end // always @ (posedge dest_clk  or negedge reset_n)
82
 
83
  assign sync_out_pulse = d_sync_out;
84
 
85
endmodule // dble_reg
86
 
87
 
88
 
89
 
90
 
91
 

powered by: WebSVN 2.1.0

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