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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [rtl/] [gmac/] [mac/] [s2f_sync.v] - Blame information for rev 12

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
  Description:
45
        Synchronizes the pulse from one clock to another
46
 * clock domain
47
***********************************************************************/
48
//`timescale 1ns/100ps
49
module s2f_sync (
50
                   //outputs
51
                   sync_out_pulse,
52
                   //inputs
53
                   in_pulse,
54
                   dest_clk,
55
                   reset_n);
56
 
57
  output sync_out_pulse; //output synchronised to slow clock
58
  input  in_pulse;       //input based on fast clock, pulse
59
  input  dest_clk;           //slow clock
60
  input  reset_n;
61
 
62
  reg    sync1_out, sync2_out, sync3_out;
63
 
64
  always @(posedge dest_clk or negedge reset_n)
65
    begin
66
      if (!reset_n)
67
        begin
68
          sync1_out <= 0;
69
          sync2_out <= 0;
70
          sync3_out <= 0;
71
        end // if (!reset_n)
72
      else
73
        begin
74
          sync1_out <= in_pulse;
75
          sync2_out <= sync1_out;
76
          sync3_out <= sync2_out;
77
        end // else: !if(reset_n)
78
    end // always @ (posedge dest_clk or negedge reset_n)
79
 
80
  assign sync_out_pulse = sync2_out && !sync3_out;
81
endmodule // s2f_sync
82
 
83
 
84
 
85
 
86
 

powered by: WebSVN 2.1.0

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