Skip to content

Commit

Permalink
Fix clk gating issue (patch) (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseCalero authored Sep 18, 2024
1 parent d862250 commit 798fd6f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions hw/fpga/prim_xilinx_clk.sv
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ module xilinx_clk_gating (
output logic clk_o
);

logic clk_en;

// Use a latch based clock gate instead of BUFGCE. Otherwise we quickly run out of BUFGCTRL cells on the FPGAs.
always_latch begin
if (clk_i == 1'b0) clk_en <= en_i | test_en_i;
end

assign clk_o = clk_i & clk_en;

// In Zynq7000, just bypass the clock gating because there are not enough BUFGs that can be
// cascaded with the BUFG of the MMCM.
// In the Zynq UltraScale+, it can be implemented as BUFGCE without trouble, since there
// are > 500 BUFGCEs and the rules for cascading are more relaxed.
// NOTE: This **cannot** be substituted by a latch+and
assign clk_o = clk_i;

endmodule

Expand Down

0 comments on commit 798fd6f

Please sign in to comment.