blob: 3113c55f82b3976c8226105cb826f93293fbbda8 [file] [log] [blame]
lowRISC Contributors802543a2019-08-31 12:12:56 +01001// 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// Clock inverter
6// Varies on the process
7
Michael Schaffner8d6a5ab2019-10-23 11:35:08 -07008module prim_clock_inverter #(
9 parameter bit HasScanMode = 1'b1
10) (
11 input clk_i,
12 input scanmode_i,
13 output logic clk_no // Inverted
lowRISC Contributors802543a2019-08-31 12:12:56 +010014);
15
Michael Schaffner8d6a5ab2019-10-23 11:35:08 -070016 if (HasScanMode) begin : gen_scan
17 prim_clock_mux2 i_dft_tck_mux (
18 .clk0_i ( ~clk_i ),
19 .clk1_i ( clk_i ), // bypass the inverted clock for testing
20 .sel_i ( scanmode_i ),
21 .clk_o ( clk_no )
22 );
23 end else begin : gen_noscan
24 logic unused_scanmode;
25 assign unused_scanmode = scanmode_i;
26 assign clk_no = ~clk_i;
27 end
Nils Graf78607aa2019-09-16 15:47:23 -070028
lowRISC Contributors802543a2019-08-31 12:12:56 +010029endmodule