-
Notifications
You must be signed in to change notification settings - Fork 814
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ibex,fpga] Fix FPGA related Ibex counter issue
This commit fixes the reset logic of the Ibex counter module for the FPGA. Signed-off-by: Pascal Nasahl <[email protected]> (commit is original to earlgrey_1.0.0)
- Loading branch information
1 parent
20bf77b
commit c643d81
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
hw/vendor/patches/lowrisc_ibex/rtl/0002-Fix-fpga-counter-reset.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/ibex_counter.sv b/ibex_counter.sv | ||
index c78e510ee4..b4dc7ec347 100644 | ||
--- a/ibex_counter.sv | ||
+++ b/ibex_counter.sv | ||
@@ -55,8 +55,12 @@ module ibex_counter #( | ||
localparam int DspPragma = CounterWidth < 49 ? "yes" : "no"; | ||
(* use_dsp = DspPragma *) logic [CounterWidth-1:0] counter_q; | ||
|
||
- // DSP output register requires synchronous reset. | ||
- `define COUNTER_FLOP_RST posedge clk_i | ||
+ if (CounterWidth < 49) begin : g_dsp_counter | ||
+ // DSP output register requires synchronous reset. | ||
+ `define COUNTER_FLOP_RST posedge clk_i | ||
+ end else begin : g_no_dsp_counter | ||
+ `define COUNTER_FLOP_RST posedge clk_i or negedge rst_ni | ||
+ end | ||
`else | ||
logic [CounterWidth-1:0] counter_q; | ||
|