lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 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 | // Clock inverter |
| 6 | // Varies on the process |
| 7 | |
Michael Schaffner | 8d6a5ab | 2019-10-23 11:35:08 -0700 | [diff] [blame] | 8 | module 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 Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 14 | ); |
| 15 | |
Michael Schaffner | 8d6a5ab | 2019-10-23 11:35:08 -0700 | [diff] [blame] | 16 | 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 Graf | 78607aa | 2019-09-16 15:47:23 -0700 | [diff] [blame] | 28 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 29 | endmodule |