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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [rtl/] [lib/] [dble_reg.v] - Blame information for rev 43

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

Line No. Rev Author Line
1 11 dinesha
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Tubo 8051 cores common library 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
/***************************************************************
46
  Description:
47
        Synchronizes the pulse from one clock to another
48
 * clock domain
49
***********************************************************************/
50
//`timescale 1ns/100ps
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.