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/] [rtl/] [src_peripheral/] [clk_source/] [xilinx_pll/] [xilinx_pll_sim/] [period_check.v] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
/*
2
 * period_check.v: Determines if the given input has a stable value.
3
 * author: Till Mahlburg
4
 * year: 2019
5
 * organization: Universität Leipzig
6
 * license: ISC
7
 *
8
 */
9
 
10
// synthesis translate_off
11
`timescale 1 ns / 1 ps
12
 
13
module period_check (
14
        input RST,
15
        input PWRDWN,
16
        input clk,
17
        input [31:0] period_length,
18
        output reg period_stable);
19
 
20
        /* tracks the last period length measured */
21
        integer period_length_last;
22
 
23
        /* checks if the measured period length didn't change since the last rising edge of the clk */
24
        always @(posedge clk or posedge RST or posedge PWRDWN) begin
25
                if (PWRDWN) begin
26
                        period_stable <= 1'bx;
27
                        period_length_last <= 0;
28
                end else if (RST) begin
29
                        period_stable <= 1'b0;
30
                        period_length_last <= 0;
31
                end else if (period_length == period_length_last && period_length != 0) begin
32
                        period_stable <= 1'b1;
33
                        period_length_last <= period_length;
34
                end else begin
35
                        period_stable <= 1'b0;
36
                        period_length_last <= period_length;
37
                end
38
        end
39
 
40
endmodule
41
 
42
// synthesis translate_on

powered by: WebSVN 2.1.0

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