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

Subversion Repositories turbo8051

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

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

powered by: WebSVN 2.1.0

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