ibex/syn/rtl/prim_clock_gating.v
Tom Roberts 35abca14ab [syn] Use latch-based register file in yosys
- Add a technology map for latches (only works with nandgate45 library
  at the moment)
- Add a real latch-based clock gating cell
- Update timing path reporting to differentiate between register and
  latch paths
- Update summary results in README to reflect the latch-based numbers,
  plus add numbers for a micro-riscy-style (RV32EC) config

Signed-off-by: Tom Roberts <tomroberts@lowrisc.org>
2020-08-10 13:36:32 +01:00

23 lines
452 B
Verilog

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
// Example clock gating module for yosys synthesis
module prim_clock_gating (
input clk_i,
input en_i,
input test_en_i,
output clk_o
);
reg en_latch;
always @* begin
if (!clk_i) begin
en_latch = en_i | test_en_i;
end
end
assign clk_o = en_latch & clk_i;
endmodule