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

Subversion Repositories nysa_sata

[/] [nysa_sata/] [trunk/] [rtl/] [generic/] [cross_clock_enable.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 cospan
`timescale 1ns/1ps
2
 
3
module cross_clock_enable (
4
  input         rst,
5
  input         in_en,
6
 
7
  input         out_clk,
8
  output  reg   out_en
9
 
10
);
11
 
12
//Parameters
13
//Registers/Wires
14
reg       [2:0]  out_en_sync;
15
//Submodules
16
//Asynchronous Logic
17
//Synchronous Logic
18
always @ (posedge out_clk) begin
19
  if (rst) begin
20
    out_en_sync   <=  0;
21
    out_en        <=  0;
22
  end
23
  else begin
24
    if (out_en_sync[2:1] == 2'b11) begin
25
      out_en      <=  1;
26
    end
27
    else if (out_en_sync[2:1] == 2'b00) begin
28
      out_en      <=  0;
29
    end
30
    out_en_sync   <=  {out_en_sync[1:0], in_en};
31
  end
32
end
33
endmodule

powered by: WebSVN 2.1.0

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