Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clk gating issue (patch) #584

Merged
merged 9 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading