OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [Integration_test/] [Altera/] [src/] [altera_reset_synchronizer.v] - Blame information for rev 56

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 alirezamon
// (C) 2001-2013 Altera Corporation. All rights reserved.
2
// Your use of Altera Corporation's design tools, logic functions and other 
3
// software and tools, and its AMPP partner logic functions, and any output 
4
// files any of the foregoing (including device programming or simulation 
5
// files), and any associated documentation or information are expressly subject 
6
// to the terms and conditions of the Altera Program License Subscription 
7
// Agreement, Altera MegaCore Function License Agreement, or other applicable 
8
// license agreement, including, without limitation, that your use is for the 
9
// sole purpose of programming logic devices manufactured by Altera and sold by 
10
// Altera or its authorized distributors.  Please refer to the applicable 
11
// agreement for further details.
12
 
13
 
14
// $Id: //acds/rel/13.0/ip/merlin/altera_reset_controller/altera_reset_synchronizer.v#1 $
15
// $Revision: #1 $
16
// $Date: 2013/02/11 $
17
// $Author: swbranch $
18
 
19
// -----------------------------------------------
20
// Reset Synchronizer
21
// -----------------------------------------------
22
 
23
// synthesis translate_off
24
`timescale 1ns / 1ps
25
// synthesis translate_on
26
 
27
 
28
module altera_reset_synchronizer
29
#(
30
    parameter ASYNC_RESET = 0,
31
    parameter DEPTH       = 2
32
)
33
(
34
    input   reset_in /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=R101" */,
35
 
36
    input   clk,
37
    output  reset_out
38
);
39
 
40
    // -----------------------------------------------
41
    // Synchronizer register chain. We cannot reuse the
42
    // standard synchronizer in this implementation 
43
    // because our timing constraints are different.
44
    //
45
    // Instead of cutting the timing path to the d-input 
46
    // on the first flop we need to cut the aclr input.
47
    // 
48
    // We omit the "preserve" attribute on the final
49
    // output register, so that the synthesis tool can
50
    // duplicate it where needed.
51
    // -----------------------------------------------
52
    (*preserve*) reg [DEPTH-1:0] altera_reset_synchronizer_int_chain;
53
    reg altera_reset_synchronizer_int_chain_out;
54
 
55
    generate if (ASYNC_RESET) begin
56
 
57
        // -----------------------------------------------
58
        // Assert asynchronously, deassert synchronously.
59
        // -----------------------------------------------
60
        always @(posedge clk or posedge reset_in) begin
61
            if (reset_in) begin
62
                altera_reset_synchronizer_int_chain <= {DEPTH{1'b1}};
63
                altera_reset_synchronizer_int_chain_out <= 1'b1;
64
            end
65
            else begin
66
                altera_reset_synchronizer_int_chain[DEPTH-2:0] <= altera_reset_synchronizer_int_chain[DEPTH-1:1];
67
                altera_reset_synchronizer_int_chain[DEPTH-1] <= 0;
68
                altera_reset_synchronizer_int_chain_out <= altera_reset_synchronizer_int_chain[0];
69
            end
70
        end
71
 
72
        assign reset_out = altera_reset_synchronizer_int_chain_out;
73
 
74
    end else begin
75
 
76
        // -----------------------------------------------
77
        // Assert synchronously, deassert synchronously.
78
        // -----------------------------------------------
79
        always @(posedge clk) begin
80
            altera_reset_synchronizer_int_chain[DEPTH-2:0] <= altera_reset_synchronizer_int_chain[DEPTH-1:1];
81
            altera_reset_synchronizer_int_chain[DEPTH-1] <= reset_in;
82
            altera_reset_synchronizer_int_chain_out <= altera_reset_synchronizer_int_chain[0];
83
        end
84
 
85
        assign reset_out = altera_reset_synchronizer_int_chain_out;
86
 
87
    end
88
    endgenerate
89
 
90
endmodule
91
 

powered by: WebSVN 2.1.0

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