hw/ip/prim_generic/rtl/prim_generic_clock_mux2.sv Cov: 100%
1: // Copyright lowRISC contributors.
2: // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3: // SPDX-License-Identifier: Apache-2.0
4:
5: module prim_generic_clock_mux2 (
6: input clk0_i,
7: input clk1_i,
8: input sel_i,
9: output logic clk_o
10: );
11:
12: assign clk_o = (sel_i) ? clk1_i : clk0_i;
13:
14: // make sure sel is never X (including during reset)
15: // need to use ##1 as this could break with inverted clocks that
16: // start with a rising edge at the beginning of the simulation.
17: `ASSERT(selKnown0, ##1 !$isunknown(sel_i), clk0_i, 0)
18: `ASSERT(selKnown1, ##1 !$isunknown(sel_i), clk1_i, 0)
19:
20: endmodule : prim_generic_clock_mux2
21: