mirror of
https://github.com/openhwgroup/cve2.git
synced 2025-04-24 05:57:28 -04:00
Make dummy clock gating module compatible with latch-based reg file
The latch-based register file needs a clock gating cell that is transparent for the clock enable signal only during the low clock phase.
This commit is contained in:
parent
89b0d3a200
commit
2ed71a499a
1 changed files with 10 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Dummy clock gating module
|
||||
// Dummy clock gating module compatible with latch-based register file
|
||||
|
||||
module prim_clock_gating #(
|
||||
parameter Impl = "default"
|
||||
|
@ -13,6 +13,14 @@ module prim_clock_gating #(
|
|||
output logic clk_o
|
||||
);
|
||||
|
||||
assign clk_o = en_i ? clk_i : 0;
|
||||
logic clk_en;
|
||||
|
||||
always_latch begin
|
||||
if (clk_i == 1'b0) begin
|
||||
clk_en <= en_i | test_en_i;
|
||||
end
|
||||
end
|
||||
|
||||
assign clk_o = clk_i & clk_en;
|
||||
|
||||
endmodule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue