| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| // prim_clk_timeout is a simple module that assesses whether the input clock |
| // has stopped ticking as measured by the reference clock. |
| // If both clocks are stopped for whatever reason, this module is effectively dead. |
| `include "prim_assert.sv" |
| module prim_clock_timeout #( |
| parameter int TimeOutCnt = 16, |
| localparam int CntWidth = prim_util_pkg::vbits(TimeOutCnt+1) |
| // clock used to measure whether clk_chk has stopped ticking |
| logic [CntWidth-1:0] cnt; |
| assign timeout = int'(cnt) >= TimeOutCnt; |
| always_ff @(posedge clk_i or negedge rst_ni) begin |
| end else if (ack || !en_i) begin |
| end else if (timeout) begin |
| prim_sync_reqack u_ref_timeout ( |
| endmodule // prim_clk_timeout |